Code to create a DataRow and add it to a DataSet

Use this code to create a DataRow from a table in a DataSet and place it in the table in a DataSet.

// Call a method to create the DataSet with a table in it.

DataSet
resultData = MakeDetailTable();
DataRow row = resultData.Tables[“Details”].NewRow();
row[
“fk_agent_id”] = userInfo.account_id;
row[
“agent_name”] = userInfo.lname + “, “ + userInfo.fname;
resultData.Tables[“Details”].Rows.Add(row);

// Use the data in the GridView.
gvReport.DataSource = resultData.Tables[
“Details”];
gvReport.DataBind();