hello, i'd need a little help with filling GridViews
i browsed over like 10 search pages, but couldnt find any which would solve my problem.
so in my ajax project i made a testing page pulled a gridview (GridView1) on it with a fhew buttons and textboxes.
i need to fill the gv from code so my websie.asp.cs looks like this
1 protected void Page_Load(object sender, EventArgs e)
2 {
3
4
5 string connstr = "Data Source=.;database=teszt;user id=user;password=pass";
6 SqlConnection conn = new SqlConnection(connstr);
7 SqlCommand comm = new SqlCommand("select * from users", conn);
8 conn.Open();
9 SqlDataReader reader;
10 reader = comm.ExecuteReader();
11 if (reader.HasRows)
12 {
13 GridView1.DataSource = reader;
14 GridView1.DataBind();
15 }
16 reader.Close();
17 conn.Close();
18 comm.Dispose();
19 }
so i load the page and there's no gridview on the page at all, nor an error msg, the connection and the database/table is fine.
any suggestions on what am i doing wrong? and i also like to know if there would be any problem with using this on a tabcontrol/tab
thankyou