C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






DataTableReader in ADO.NET 2.0


Posted Date: 13 Jan 2008    Resource Type: Code Snippets    Category: ADO.NET

Posted By: @@@ Hyderabadi Biryani @@@       Member Level: Diamond
Rating:     Points: 10



DataTableReader obtains the contents of one or more DataTable objects in the form of one or more read-only, forward-only result sets. It is a combination of both DataTable and SqlDataReader.
A DataTableReader can contain more than one DataTable(s), in a disconnected mode, as a read-only and forward-only record sets. Below code shows how to create DataTableReader from DataTable’s CreateDataReader method.



private void FetchDataTableReader()
{
string sql = "Select * from Customers";
SqlDataAdapter da = new SqlDataAdapter(sql,”YourConnectionString”);
DataTable dt = new DataTable(); da.Fill(dt);
DataTableReader dtr = dt.CreateDataReader();
if (dtr.HasRows)
{
while (dtr.Read())
{
Response.Write(dtr[“Cus_Name”].ToString() + "
");
}
}
else
Response.Write("No Data");
}







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Using the SqlDataReader Object
Previous Resource: Using Transactions
Return to Discussion Resource Index
Post New Resource
Category: ADO.NET


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

teleconferencing

Contact Us    Privacy Policy    Terms Of Use