vb.net - How to Update DataTable -


i have main dataset contains several datatables. these different datatables bound datagridview's datasource respectively.

my problem whenever modify in display area such description textbox below , click on save....

description <<< >>> modified description

the datagridview doesn't have replicated changes, seen here: datagridview results

i need way update datatable ... save button saves information. quite new datasets , datatables first time trying update datatable. doubt need reload information in datatable, there must more efficient?

updating datatable unknown indexes

for more information: how to: edit rows in datatable

in order edit existing row in datatable, need locate datarow want edit, , assign updated values desired columns.


update existing records in typed datasets (row index not known)

assign specific datarow variable using generated findby method, , use variable access columns want edit , assign new values them.

dim description string = "hello world modified"  'update datatable dim row dataset1.datatablerow row = dataset1.datatablerow.findbyprimarykey(pk) row.description = description 

update existing records in untyped datasets (row index not known)

use select method of datatable locate specific row , assign new values desired columns

dim description string = "hello world modified"  'update datatable dim row() data.datarow row = dataset1.tables("table1").select("primarykey = '10'") row(0)("description") = description 

once done, don't need refresh else - datagridview has latest information.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -