I don't understand why I can't add data using any of the following calls.
dc = new DataColumn("par_value");
dc.AllowDBNull = false;
dc.DataType = System.Type.GetType("System.String");
dc.Caption = "par_value";
DtParam.Columns.Add(dc);
//add a new row with datavalues
DtParam.Rows[0].BeginEdit();
DtParam.Rows[0].ItemArray.SetValue(txtOrder.Text,2);
DtParam.Rows[0].ItemArray[2] = txtOrder.Text;
DtParam.Rows[0][2] = txtOrder.Text;
DtParam.Rows[0].AcceptChanges();
DtParam.Rows[0].EndEdit();
DtParam.AcceptChanges();
I thought I should be able to change the value just by setting it without any of the beginedit or acceptchanges methods. I can't get anything to work. Is there no way to manually add data to one colunmn in a datarow that exists in a datatable? Do I have to break the datarow out of the table and then add it again?
dc = new DataColumn("par_value");
dc.AllowDBNull = false;
dc.DataType = System.Type.GetType("System.String");
dc.Caption = "par_value";
DtParam.Columns.Add(dc);
//add a new row with datavalues
DtParam.Rows[0].BeginEdit();
DtParam.Rows[0].ItemArray.SetValue(txtOrder.Text,2);
DtParam.Rows[0].ItemArray[2] = txtOrder.Text;
DtParam.Rows[0][2] = txtOrder.Text;
DtParam.Rows[0].AcceptChanges();
DtParam.Rows[0].EndEdit();
DtParam.AcceptChanges();
I thought I should be able to change the value just by setting it without any of the beginedit or acceptchanges methods. I can't get anything to work. Is there no way to manually add data to one colunmn in a datarow that exists in a datatable? Do I have to break the datarow out of the table and then add it again?