数据适配器填充方法 [英] data adapter fill method

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

问题描述

当我们调用DataAdapter的Fill方法从数据源检索数据并将其倒入数据集时, 使用SelectCommand属性中的Command对象 . DataAdapter是位于我们的DataSet和数据源之间的网守.下划线的语句意味着什么,任何人都可以解释

When we call the DataAdapter''s Fill method to retrieve data from a data source and pour it into a DataSet, the Command object in the SelectCommand property is used. The DataAdapter is the gatekeeper that sits between our DataSet and the data source.what does it mean by underlined statement can any one pls explain

推荐答案

.Fill方法,您正在寻找从数据库中检索数据的方法.在直接的SQL中,您可以使用select语句来完成此操作,在ADO.net中,ergo可以抽象为SqlCommand或OleDbCommand.逻辑上,在此抽象中使用SelectCommand属性来告诉DataAdapter确切的是要从数据库中选择哪些数据并填充到DataSet/DataTable中.
If you''re calling the .Fill method, you''re looking to retrieve data from the database. In straight SQL you''d do this with a select statement, ergo in ADO.net this is abstracted as a SqlCommand or OleDbCommand. Logically the SelectCommand property is used in this abstraction to tell the DataAdapter exactly which data to select from the database and fill into your DataSet/DataTable.


SqlDataAdapter 是ADO.NET数据提供程序的一部分. SqlDataAdapter 通过 SqlConnection 对象提供数据集和数据源之间的通信.SqlDataAdapter与 DataSet 一起提供断开连接的数据检索机制.

SqlDataAdapter SelectCommand 属性是一个Command对象,它从数据源中检索数据. DataAdapter的Fill方法用于使用SelectCommand的结果填充DataSet.

Fill 方法将要填充的DataSet和 DataTable 对象或要用 SelectCommand返回的行填充的DataTable的名称作为其参数. .

希望对您有所帮助:)
SqlDataAdapter is a part of the ADO.NET Data Provider. SqlDataAdapter provides the communication between the Dataset and the Data Source with the help of SqlConnection Object .The SqlDataAdapter works with the DataSet to provide a disconnected data retrieval mechanism.

The SelectCommand property of the SqlDataAdapter is a Command object that retrieves data from the data source. The Fill method of the DataAdapter is used to populate a DataSet with the results of the SelectCommand.

Fill method takes as its arguments a DataSet to be populated, and a DataTable object , or the name of the DataTable to be filled with the rows returned from the SelectCommand.

hope it helps :)


这篇关于数据适配器填充方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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