DataView edit?

  • Thread starter Thread starter Able
  • Start date Start date
A

Able

Dear friends

Two of the columns in the table tblAdressbook is the field "FirstName" and
the field "personID". The table is loaded in the dataset myDataset and is
sorted by "personID" in the dataview myDataView as this:

Dim myDataView As DataView = New DataView(myDataset.Tables("tblAdressbokk"),
"", _

"personID", DataViewRowState.CurrentRows)



So I am searching the DataView for a spesific row and retrieving the
rowindex as this:



Dim RowIndex As Short

RowIndex = MyDataView.Find(ListBox1.SelectedItem)



The field "FirstName" in this spesific row is "Frank", but how do I edit
this field to "Joe"?



Somebody knows?



Regards Able
 
Hi,

Dim drv as DataRowView = myDataView.Item(RowIndex)

drv.BeginEdit()

drv.Item("FirstName") = "Joe"

drv.EndEdit()

Ken
 
Back
Top