{
string selectDesc = @" SELECT [Descripion id], [Sub Collection FROM Descripion ";
DataSet dsD = new DataSet();
SqlCommand comD = new SqlCommand();
comD.Connection = con;
comD.CommandText = selectDesc;
SqlDataAdapter daD = new SqlDataAdapter();
daD.SelectCommand = comD;
SqlCommandBuilder cbD = new SqlCommandBuilder(da);
daD.Fill(dsD, "Descripion");
DataRow new_row_Desc = dsD.Tables[0].NewRow();
new_row_Desc["Descripion id"] = 58589;
new_row_Desc["Sub Collection"] = TextBox18.Text;
dsD.Tables[0].Rows.Add(new_row_Desc);
daD.Update(dsD.Tables[0]);
}
I am getting this error:
Update requires a valid InsertCommand when passed DataRow collection with new rows.
What is the problem?