datagridview
-
i have a dataGrid view in my windows form and now i want bind it programatically. i write this code:: string ConnString = ""; sqlConnection conn = new SqlConnection (ConnString); string sql = ""; sqlDataAdapter da = new SqlDataAdapter(sql,conn); conn.open()l dataset ds = new dataset(); da.fill(ds); conn.close(); datagridview1.DataSource = ds; my code is right and ds hase 1 record and fill right but my grid dont show any record do u know why? has anything that i dont
-
i have a dataGrid view in my windows form and now i want bind it programatically. i write this code:: string ConnString = ""; sqlConnection conn = new SqlConnection (ConnString); string sql = ""; sqlDataAdapter da = new SqlDataAdapter(sql,conn); conn.open()l dataset ds = new dataset(); da.fill(ds); conn.close(); datagridview1.DataSource = ds; my code is right and ds hase 1 record and fill right but my grid dont show any record do u know why? has anything that i dont
your code is incomplete. Add the following line end of your code.
datagridview1.Databind();
thatraja
-
your code is incomplete. Add the following line end of your code.
datagridview1.Databind();
thatraja
-
i have a dataGrid view in my windows form and now i want bind it programatically. i write this code:: string ConnString = ""; sqlConnection conn = new SqlConnection (ConnString); string sql = ""; sqlDataAdapter da = new SqlDataAdapter(sql,conn); conn.open()l dataset ds = new dataset(); da.fill(ds); conn.close(); datagridview1.DataSource = ds; my code is right and ds hase 1 record and fill right but my grid dont show any record do u know why? has anything that i dont
-
i have a dataGrid view in my windows form and now i want bind it programatically. i write this code:: string ConnString = ""; sqlConnection conn = new SqlConnection (ConnString); string sql = ""; sqlDataAdapter da = new SqlDataAdapter(sql,conn); conn.open()l dataset ds = new dataset(); da.fill(ds); conn.close(); datagridview1.DataSource = ds; my code is right and ds hase 1 record and fill right but my grid dont show any record do u know why? has anything that i dont
datagridview1.DataSource = ds.Tables[0];
-
but my form is windows form not web form and it has no databind, what is insted of that in windows form?
ptvce wrote:
but my form is windows form not web form
Then why you posted this question in ASP.Net forum, you should have posted it in C# forum.
-
i have a dataGrid view in my windows form and now i want bind it programatically. i write this code:: string ConnString = ""; sqlConnection conn = new SqlConnection (ConnString); string sql = ""; sqlDataAdapter da = new SqlDataAdapter(sql,conn); conn.open()l dataset ds = new dataset(); da.fill(ds); conn.close(); datagridview1.DataSource = ds; my code is right and ds hase 1 record and fill right but my grid dont show any record do u know why? has anything that i dont
If ur query returns multiple tables then use
datagridview1.DataSource = ds.Tables[0];
or
datagridview1.DataSource = ds;
datagridview1.DataMember = ds.Tables[0];Tej Aj, http://opexsolution.com/forum/[^] Fan of: http://www.abtstudioz.com/[^]