Hi i want to add a datarow that im getting back from a data table to a new datatable
this is the code im using:
foreach (DataRow dr1 in dt.Rows)
{
string AptType = dr1["AppointmentType"].ToString();
if (AptType == "FreeTime")
{
dt2.ImportRow(dr1);
}
}
RadGrid2.DataSource = dt2;
reader.Close();
conn.Close();
the problem is that when i then go to run the page with the table on it im getting a datakey error and that one of the columns isnt being recognised
thanks in advance
Do the two data tables have the same schema? Those errors might be thrown if they do not match columns, datatypes, or keys.