try this.. :)
how to retrive data from sql server ?[
^]
Bind data in gridview like table
string str = " select filename from tblFiles ";
SqlConnection sqn = new SqlConnection(@"Data Source=MEHUL-PC\SQLEXPRESS;Initial Catalog=dbFiles;Integrated Security=True");
sqn.Open();
SqlCommand cmd = new SqlCommand(str, sqn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvUserInfo.DataSource = ds;
gvUserInfo.DataBind();