数据源和数据集的区别 [英] Difference between DataSource and DataSet

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

问题描述

我目前正在从事一个项目,其主要任务是读取存储在 SQL 数据库中的数据并以用户友好的形式显示它们.使用的编程语言是C++.我在 Borland C++ Builder 6 环境中工作.但我认为标题中提出的问题与编程语言或库无关.从 db 读取数据时,我经常会在类名中遇到这些术语,但并不知道它们究竟代表什么.我知道它们充当存储在数据库中的数据的接口.但是为什么需要使用两个接口类而不是一个呢?

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

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

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