Hi....
How can we define SQLDataReaderClass and define architecture in ADO.NET?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
SenthilkumarRank #387 · 6.5K reputationPosted Jan 4, 2012, 6:09 PM EST
The sql data reader is designed to move forward and it cannot come front and fourth while iterating the sql data reader. The SqlCommand has the connection and the required table/sql query/ stored procedure to retrieve the data from the database.
SqlConnection sqlConnection = new SqlConnection(connectionString);
sqlConnection.Open();
SqlCommand sqlCommand = new SqlCommand("SELECT * FROM Product",sqlConnection);
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
Now the sqldatareader has the record set and it can be iterated to manipulate the data.
The main advantages is it will not bulk loaded and it will load the data on demand. So it will improve the performance significantly. The disadvantages is it always needs the connection.
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 4, 2012, 6:25 PM EST
please refer following sites.
http://www.dotnetperls.com/sqldatareader
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx
http://stackoverflow.com/questions/4290986/sql-data-reader-class
hope this help.
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 4, 2012, 7:00 PM EST
SQLDataReaderClass Provides a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.
Please refer the below link
http://www.triconsole.com/dotnet/sqldatareader_class.php
Thanks