打印本文 打印本文 关闭窗口 关闭窗口
第五课 使用断开数据--DataSet和SqlDataAdapter(翻译)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数15903  更新时间:2007/11/14 13:12:43  文章录入:mintao  责任编辑:mintao
raction by using the DataSet and SqlDataAdapter objects.

在第三课中,我们讨论了使用Sqlcommand对象的与数据源的完全连接操作模型。在第四课,我们学习了如何通过连接使用SqlDataReader快速的读取数据。这节课介绍如何通过使用DataSetSqlDataAdapter来实现SqlConnectionSqlDataReader交互之间的事情。

A DataSet is an in-memory data store that can hold numerous tables.  DataSets only hold data and do not interact with a data source.  It is the SqlDataAdapter that manages connections with the data source and gives us disconnected behavior.  The SqlDataAdapter opens a connection only when required and closes it as soon as it has performed its task.  For example, the SqlDataAdapter performs the following tasks when filling a DataSet with data:

DataSet是存储在内存中的数据,它保存了大量的表。DataSet只存储数据而并不与数据源发生交互。它通过SqlDataAdapter来管理与数据源的连接并给予我们非连接的行为。只有当需要的时候,SqlDataAdapter打开连接并在完成任务后关闭它。比如,当Data填充数据的时候SqlDataAdapter执行以下的操作:

  1. Open connection
  2. Retrieve data into DataSet
  3. Close connection

1.           打开连接

2.          

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ...  下一页 >> 

打印本文 打印本文 关闭窗口 关闭窗口