hii friends , i want your need . actually i want to create datagridview control dynamically . plz chk following code
DataSet ds = new DataSet(); string q = "Select * From MusterDb_State_Master"; MusterConnection.cmd = new System.Data.OleDb.OleDbCommand(q, MusterConnection.con); MusterConnection.adp = new System.Data.OleDb.OleDbDataAdapter(MusterConnection.cmd); MusterConnection.adp.Fill(ds); DataGridView d1 = new DataGridView();d1.DataSource = ds.Tables[0];
d1.Show();
this code didn't give me any error but does not show any control on to the form
Albertto LiePosted Feb 20, 2009, 4:43 AM
d1.DataSource = ds.Tables[0].DefaultView;
d1.DataBind();
d1.Show();
and add datagrid to your form.
Nipun TomarPosted Feb 18, 2009, 10:50 PM
d1.DataSource = ds.Tables[0];
d1.DataBind();
d1.Show();
and add datagrid to your form.