Write to us
MS SQL Server
Free Tech Magazines
Asp.Net Web Hosting
Link to Us
Questions & Answers
Tips & Tricks
How to Convert a SqlDataReader To a DataTable or DataSet in Asp.Net?
10/11/2008 8:42:29 AM
To convert a SqlDataReader to DataTable or DataSet, use DataTable's Load method. Just look at the sample block of statements below.
string sql = "Select * from MyTable";
SqlCommand cmd = new SqlCommand(sql, MyConnection);
SqlDataReader dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
//Load the SqlDataReader object to the DataTable object as follows.
Post New Tips/Tricks
View all Tips/Tricks
Speech Technology Magazine
Speech Technology is recognized worldwide as the leading source of information on speech technology solutions that are changing communications and technology needs of organizations worldwide.
Many .NET teams are underperforming, is yours?
Explore how you can turn your .NET developer training program from a commonly ignored budget line-item into a strategic weapon in today's competitive software environment.
100% Free Subscription until Stock lost.
View complete list.
. www.AspdotnetCodes.com. All rights reserved.