DataView edit?

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
 
K

Ken Tucker [MVP]

Hi,

Dim drv as DataRowView = myDataView.Item(RowIndex)

drv.BeginEdit()

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

drv.EndEdit()

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top