Editing existing data in dataset fields

Ray S

Member
Joined
Mar 28, 2006
Messages
6
Programming Experience
1-3
I am converting a program from ADO to ADO.NET. In my preliminary experiment I have made the connection string, the data adapter, and a dataset. I can display that data in a data grid, manually edit a field, and update the database from a button routine. Now I need to be able to edit some existing fields in the database programmatically. I assume the command is some form of positioning the record pointer, setting the data in the dataset field, and then issuing the update. However I can't quite figure out how to set the field value to some new value. I assume it is some sort of command like:

dataset.table.field = XXXXX

but somehow I just can't seem to get over this hump. Any help would be appreciated.
 
Dataset.tables(Zero based table index).Rows(zero based row index).Item(zero based column index) = whatever

Or if you know the primary key of the row you are looking for you can save yourself a bit of time...

Dim Dr as datarow = datatable.rows.find(Primary key)

dr.item(columnindex) = whatever
 
Back
Top