C#: What Else Do You Use Besides DataSet(C#:除了 DataSet 你还用什么)
问题描述
我发现自己对 .Net 中的 DataSet/DataTable/DataRow 范式越来越不满意,主要是因为它通常比我真正想做的要复杂几个步骤.在我绑定到控件的情况下,DataSet 很好.但在其他情况下,似乎有相当多的精神开销.
I've found myself increasingly unsatisfied with the DataSet/DataTable/DataRow paradigm in .Net, mostly because it's often a couple of steps more complicated than what I really want to do. In cases where I'm binding to controls, DataSets are fine. But in other cases, there seems to be a fair amount of mental overhead.
我玩过一些 SqlDataReader,这似乎对通过选择进行简单的短途旅行很有用,但我觉得 .Net 中可能还有一些其他模型对了解更多信息很有用.我觉得我在这方面找到的所有帮助都默认使用 DataSet.也许那和 DataReader 真的是最好的选择.
I've played a bit with SqlDataReader, and that seems to be good for simple jaunts through a select, but I feel like there may be some other models lurking in .Net that are useful to learn more about. I feel like all of the help I find on this just uses DataSet by default. Maybe that and DataReader really are the best options.
我不是在寻找最好/最差的细分,只是想知道我的选择是什么以及您对它们的体验.谢谢!
I'm not looking for a best/worst breakdown, just curious what my options are and what experiences you've had with them. Thanks!
-埃里克·斯普尔
推荐答案
自从 .NET 3.5 出来后,我就一直用 LINQ.真的那么好;我看不出有任何理由再使用那些旧拐杖了.
Since .NET 3.5 came out, I've exclusively used LINQ. It's really that good; I don't see any reason to use any of those old crutches any more.
尽管 LINQ 很出色,但我认为任何 ORM 系统都可以让您摆脱这些麻烦.
As great as LINQ is, though, I think any ORM system would allow you to do away with that dreck.
这篇关于C#:除了 DataSet 你还用什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C#:除了 DataSet 你还用什么
基础教程推荐
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
