C#数据集或没有? [英] C# Dataset or not?

查看:136
本文介绍了C#数据集或没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点在C#中的数据集的概念混淆(编码ASP.NET网站,这不是问题)。在我的阅读我的理解是,他们使用(基本上)作为我的应用程序,我的数据(或数据库)之间的接口。我明白了。我不明白的是有些文章引用的数据集为脱机存储,其中更新(插入,等...)在批量应用或从不和其他的接口方面发挥更多,在读取和更新(插入,等...)被立即应用到强调数据库。

I'm a bit confused by the Dataset concept in C# (coding ASP.NET sites, not that it matters). In my reading I'm understanding that they are used (essentially) as interfaces between my app and my data (or database). I get that. What I don't understand is some articles refer to datasets as "offline storage" where updates (inserts, etc...) are applied in batch or never, and others play more to the "interface" aspect, where reads and updates (inserts, etc...) are applied immediately to the underlining database.

能否有人请解释深入浅出的数据集?难道我要真的使用它们?也许一些简单的例子情况下可能会清除它为我说话。否则,我不明白为什么我不能只创建一个简单的类选择,插入,更新从我的数据库,为什么我会在意一些XML层?

Can someone please explain datasets in simple terms? Do I want to really use them? Maybe some short example cases might clear it up for me. Otherwise, I don't see why I cannot just create a simple Class that selects, inserts, updates from my database, why would I care about some XML layer?

您智慧AP preciated。

Your wisdom is appreciated.

推荐答案

这是一个工具,它有一些方便的功能 - 有时他们都很好,但坦白说,我用起来很很少亲自 - 通常是preferring简单通过类似的东西短小精悍波苏斯(或您自己的preferred ORM /微ORM - 不管)。

It is a tool, and it has some handy features - sometimes they are fine, but frankly I use them very very rarely personally - usually preferring simple POCOs via things like dapper (or your own preferred ORM / micro-ORM - whatever).

主要时间的DataSet / 数据表是非常有用的是,如果你正在创建的的东西本身就是动态的 - 例如,如堆栈交换数据资源管理器 - 基本工具,其中的架构回来是用户定义的。

The main time that DataSet / DataTable is useful is if you are creating something that is itself dynamic - for example, like Stack Exchange Data Explorer - basically tools where the schema coming back is user-defined.

在大多数业务线的软件,这根本不是这样的 - 所以数据表不是IMO去到工具

In most line-of-business software, this is simply not the case - so DataTable is not IMO the go-to tool.

这篇关于C#数据集或没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆