Link to home
Start Free TrialLog in
Avatar of zaceverett
zaceverett

asked on

Find & Edit a row in a datatable

I am trying to find and edit a row in a datatable.

I set up a new datarow dr.

dr = catalogues.CatalogueTypes.Rows.Find(oldCatalogueIDCode)

Great this gets me the datarow to edit, then i

dr.BeginEdit()
dr(catalogues.CatalogueTypes.CatalogueIDColumn.ColumnName) = newCatalogueIDCode

This gives the new datarow dr a new catalogueid in the catalogueidcolumn

I then try and accept the changes

dr.AcceptChanges()
catalogues.CatalogueTypes.AcceptChanges()

BUT the dataset doesn't get updated or changed just the datarow dr.
If i specify directly the datarow eg.

dr = catalogues.CatalogueTypes.Rows(2)

This works no problems.

So, how do i find a row given a value and then edit it in the datatable and acceptchanges.

Thank you for any help.

Zac
ASKER CERTIFIED SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial