How to populate DataSet by creating objects programmatically in ADO.NET?
Question
You can use this example.
DataSet dset;
DataTable dtbl;
DataRow drow;
//create a new row
drow=dtbl.NewRow();
//manipulate the newly added row using an index or the column name
drow["LastName"]="Altindag";
drow[1]="Altindag";
//After data is inserted into the new row, the Add method is used
//to add the row to the DataRowCollection
dtbl.Rows.Add(drow);
//You can also call the Add method to add a new row by passing in an
//array of values, typed as Object
dtbl.Rows.Add(new object[] {1, "Altindag"});
