I think I misunderstood the question a little.
If you want to add a row to a data table you can do like this.
DataSet ds;
DataTable dt = ds.Tables[0];
or
DataTable dt = ds.Tables["MyTable"];
dt.Rows.Add(1, "Harry Hacker", "DOB", "Programmer", "123456789", "harry.hacker@codeville.com", "$1");
or
DataRow dr = dt.Rows.New();
dr["Id"] = 1;
dr["Name"] = "Harry Hacker";
dr["DOB"] = "What ever this means";
dr["Designation"] = "Programmer";
dr["Mobile"] = "123456789";
dr["Mail"] = "harry.hacker@codeville.com";
dr["Salary"] = "$1";
dt.Rows.Add(dr);
If you have a
DataGridView
called
dgView
you can add the
DataSet
as the data source.
dgView.DataSource = ds;
dgView.DataMember = "MyTable";
My first answer, not maybe on target.
foreach (DataRow dr in dt.Rows)
{
dr["Id"] = some_value;
dr["Name"] = some_other_value;
etc.
}