DataSource和DataSet之间的区别 [英] Difference between DataSource and DataSet

查看:198
本文介绍了DataSource和DataSet之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在处理项目,其主要任务是读取存储在SQL数据库中的数据,并以用户友好的形式显示。使用的编程语言是C ++。我在Borland C ++ Builder 6环境中工作。但我认为题目中提出的问题与编程语言或图书馆无关。当从数据库读取数据时,我经常在类名中满足这些术语,而不知道它们代表什么。我明白他们表现为数据库中存储的数据的接口。但是为什么需要使用两个接口类而不是一个?

I am currently working on project whose main task is to read data stored in SQL database and to display them in user-friendly form. Programming language used is C++. I am working in Borland C++ Builder 6 environment. But I think question posed in title is independent from programming language or libraries. When reading data from db i am quite frequently meeting with these terms in class names without knowing exactly what they represent. I understand that they behave as interface to data stored in db. But why there is need to use two interface classes instead of one?

推荐答案

DataSource =如何连接到数据库
DataSet =内存数据库的结构

DataSource = How you connect to your database DataSet = Structure of your database in memory

更多详细信息(从考试70-516:TS:使用Microsoft .NET Framework 4书籍访问数据):

More in details (from the Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4 book):

DataSource这是您为其分配的主要属性数据。您可以
分配实现IList,IListSource,IBindingList或IBindingListView
接口的任何内容。可以分配给DataSource属性的项目的一些示例是
数组(IList),列表(IList),数据表(IListSource)和数据集(IListSource)。

DataSource This is the primary property to which you assign your data. You can assign anything that implements the IList, IListSource, IBindingList, or IBindingListView interface. Some examples of items that can be assigned to the DataSource property are arrays (IList), lists (IList), data tables (IListSource), and data sets (IListSource).

DataSet是一种基于内存的表格,关系数据表示,是主要断开连接的数据对象。在概念上,将DataSet视为内存关系数据库,但它只是缓存数据,并且不提供对当今关系数据库至关重要的任何事务属性(原子性,一致性,隔离性,持久性)。 DataSet包含DataTable和DataRelation对象的集合

DataSet is a memory-based, tabular, relational representation of data and is the primary disconnected data object. Conceptually, think of DataSet as an in-memory relational database, but it’s simply cached data and doesn’t provide any of the transactional properties (atomicity, consistency, isolation, durability) that are essential to today’s relational databases. DataSet contains a collection of DataTable and DataRelation objects

这篇关于DataSource和DataSet之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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