Windows Form Datagridview
-
Hi Every one, now i m using window forms using C# , so my doubt is how can i bind datagridview to dataset . actually i finishes wrote code , but when i trace it ..data getting into datasource but its not displaying into datagridview ..let me Know is there any i can change into datagridview property . Please if u know scarp me. Thanks Raj
Some Thing need 2 do NEW
-
Hi Every one, now i m using window forms using C# , so my doubt is how can i bind datagridview to dataset . actually i finishes wrote code , but when i trace it ..data getting into datasource but its not displaying into datagridview ..let me Know is there any i can change into datagridview property . Please if u know scarp me. Thanks Raj
Some Thing need 2 do NEW
We cant know why? because we don't see the code.
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
We cant know why? because we don't see the code.
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
Thanks for reply bro.. I need the answers bro..i thnik its not answer..
Some Thing need 2 do NEW
-
Thanks for reply bro.. I need the answers bro..i thnik its not answer..
Some Thing need 2 do NEW
We cannot Help until we see the code where you bind the Grid
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
Thanks for reply bro.. I need the answers bro..i thnik its not answer..
Some Thing need 2 do NEW
Try this sample code
SqlCommand cmd = new SqlCommand(); cmd.Connection = sqlConnection(); cmd.CommandText ="your query"; SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); adapter.Fill(ds); datagridview1.DataSource = ds;
Regards, Karthik K...
-
We cannot Help until we see the code where you bind the Grid
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
Ok bro .. this is my code once through it let me know where i did mistake. SqlConnection cn = new SqlConnection("server=.;uid=sa;pwd=sa;database=Payroll1"); string ssql = "Select * from EmpDetails"; SqlDataAdapter da = new SqlDataAdapter(ssql, cn); DataSet ds = new DataSet(); da.Fill(ds); BindingSource bindgrd = new BindingSource(); bindgrd.DataSource = ds; this.Datagridview1.DataSource = bindgrd;
Some Thing need 2 do NEW
-
Ok bro .. this is my code once through it let me know where i did mistake. SqlConnection cn = new SqlConnection("server=.;uid=sa;pwd=sa;database=Payroll1"); string ssql = "Select * from EmpDetails"; SqlDataAdapter da = new SqlDataAdapter(ssql, cn); DataSet ds = new DataSet(); da.Fill(ds); BindingSource bindgrd = new BindingSource(); bindgrd.DataSource = ds; this.Datagridview1.DataSource = bindgrd;
Some Thing need 2 do NEW
Good Day Rajeshwar I dont use Wizards to do my database. can you do a Check for me. put your code in a try and check if there are any rows returned
SqlConnection cn = new SqlConnection("server=.;uid=sa;pwd=sa;database=Payroll1");
string ssql = "Select * from EmpDetails";
SqlDataAdapter da = new SqlDataAdapter(ssql, cn);
DataSet ds = new DataSet();try
{
cn.open();
da.Fill(ds);
BindingSource bindgrd = new BindingSource();
bindgrd.DataSource = ds;if(ds.Tables[0].Rows.count > 0)
{
this.Datagridview1.DataSource = bindgrd;
}
else
{
lblError.text = "No Rows Returned";
}
catch(SQlException ex)
{
lblError.text = ex.Message;
}
Finaly
{
cn.close();
}Tell me if you get an Error or there are any Rows Returned. I wrote this here, so the logic is correct , just correct the syntax dont do copy and paste and tell me what it does.
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/