latest Post

What is the DataReader in ADO.Net?

  • DataReader holds only one table at a time.
  • It only provides read only access mode and cannot write data.
  • It is not required local storage to data store.
  • Holds one row at a time.
  • Uses less memory.
  • DataReader do not maintain relation.

  1. protected void Bind()  
  2. {  
  3.     SqlConnection con = new SqlConnection("your database connection string ");  
  4.     con.Open();  
  5.     SqlCommand cmd = new SqlCommand("Write your query or procedure ", con);  
  6.     SqlDataReader dr = cmd.ExecuteReader();  
  7.     grid.DataSource = dr;  
  8.     grid.DataBind();  

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment