Hi,
Please find the code snippet for adding data to a dataset. Logic and No of columns in table/dataset can vary but the syntax remains same
DataSet ds = new DataSet();
DataTable dt = new System.Data.DataTable();
dt.Columns.Add("EmpName");
dt.Columns.Add("Dept");
DataRow dr = dt.NewRow();
dr["EmpName"] = txtName.Text;
dr["Dept"] = txtDept.Text;
dt.Rows.Add(dr);
ds.Tables.Add(dt);
DataGrid dg = new DataGrid();
dg.DataSource =dt;
gpDisplayGrid.Controls.Add(dg);
Hope it helps.
Regards, Mahe