Click here to Skip to main content
15,920,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

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

Regards.
 
Share this answer
 
Hi syed,
SqlDataAdapter and DataReader[^]
I hope it clears your doubt.
If you need more, send me a query.
 
Share this answer
 
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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900