我可以使用sqldataadapter进行类似sql的操作并在文本框中读取vallues吗 [英] can i use sqldataadapter to make sql operation like and read vallues in textbox like

查看:90
本文介绍了我可以使用sqldataadapter进行类似sql的操作并在文本框中读取vallues吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用命令类和datareader检索数据

我可以同时使用sqldataadapter和datareader来读取单个行值吗?

we use command class and datareader for retrieving the data

can i use sqldataadapter and datareader for the same purpose to read only single row value

推荐答案

当然可以.但是使用datareader效率更高,速度更快.

问候.
Of course you can. But using datareader is more efficient and faster.

Regards.


赛德,
SqlDataAdapter和DataReader [
Hi syed,
SqlDataAdapter and DataReader[^]
I hope it clears your doubt.
If you need more, send me a query.


DataReader:

您可以使用ADO.NET DataReader从数据库中检索只读的,仅转发的数据流.查询执行时将返回结果,并将结果存储在客户端的网络缓冲区中,直到您使用DataReader的Read方法请求它们为止.使用DataReader可以通过在数据可用时立即对其进行检索,以及(默认情况下)一次仅在内存中存储一​​行来提高应用程序性能,从而减少系统开销.


数据适配器:

DataAdapter用于从数据源检索数据并填充DataSet中的表. DataAdapter还可以将对DataSet所做的更改解析回数据源. DataAdapter使用.NET Framework数据提供程序的Connection对象连接到数据源,并使用Command对象从数据源检索数据并解决对数据源的更改.

您可以在这里找到更多详细信息

http://msdn.microsoft.com/en-us/library/ms254931.aspx [ ^ ]
DataReader:

You can use the ADO.NET DataReader to retrieve a read-only, forward-only stream of data from a database. Results are returned as the query executes, and are stored in the network buffer on the client until you request them using the Read method of the DataReader. Using the DataReader can increase application performance both by retrieving data as soon as it is available, and (by default) storing only one row at a time in memory, reducing system overhead.


DataAdapter:

A DataAdapter is used to retrieve data from a data source and populate tables within a DataSet. The DataAdapter also resolves changes made to the DataSet back to the data source. The DataAdapter uses the Connection object of the .NET Framework data provider to connect to a data source, and it uses Command objects to retrieve data from and resolve changes to the data source.

More deatils you can find from here

http://msdn.microsoft.com/en-us/library/ms254931.aspx[^]


这篇关于我可以使用sqldataadapter进行类似sql的操作并在文本框中读取vallues吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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