DataRow row = myDataTable.Rows[0]; row.BeginEdit(); row["Column1"] = "New Value"; row.EndEdit();
DataTable table = new DataTable(); DataRow newRow = table.NewRow(); newRow["Column1"] = "Value 1"; newRow["Column2"] = "Value 2"; table.Rows.Add(newRow); newRow.EndEdit();In this example, we create a new DataRow for a DataTable object and add it to the table. We then use the EndEdit method to indicate that we have finished making changes to the new row. Package library: System.Data.