hi friends
i am a fresher now my problem is i have created a table with some columns in sqldatabase, now i want to display that tabledata in my asp page of gridview when pressed displaybutton .i would be very thankfull if you help me this in stepwise and how to add web.config file in asp page
Loading
Krishna GaradPosted Jun 20, 2011, 6:05 AM
private void button1_Click
{
SqlConnection cn=new SqlConnection("Your Connection String Here");
string sql="Select * from TableName";
SqlDataAdapter ds=new SqlDataAdapter(sql,cn);
DataSet ds=new DataSet();
da.Fill(ds,"TableName");
Gridview1.DataSource=ds.Tables[0];
GridView.DataBind();
}