How do I update a record in the table using ADO.Net dataset?
Once you have the UpdateCommand prepared in the data adapter, you can update individual records simply by updating the field values in the data table’s rows. The above code demonstrate how we can update the ‘lines’ field of the third record of the table ‘Article’
C# Version
DataTable dt = ds.Tables["Article"];
dt.Rows[2]["lines"] = 600;
da.Update(ds, "Article");
ds.AcceptChanges();
VB.Net Version
Dim dt = ds.Tables("Article")
dt.Rows(2)("lines") = 700
da.Update(ds, "Article")
ds.AcceptChanges()
Back