jdy0803
Well-known member
In case of VB6.0's ADO, I can update record after find record like this.
rs.Find("patient_id = 2")
rs("NOTES") = "AAAAA"
rs.Update()
But I don't know how to do in VB.NET.
I can find recording using DataView like this.
Sql = "SELECT * FROM patient"
adapter = New OleDbDataAdapter(Sql, cn)
commandBuilder = New OleDbCommandBuilder(adapter)
ds = New DataSet()
adapter.Fill(ds, "patient")
dv = New DataView(ds.Tables("patient"))
dv.Sort = "patient_id"
Dim index As Integer = dv.Find(2)
But, how to update the "first_name" field of the patient table?
I tried like this.
dv(index)("first_name") = "Thomas"
But data does'n be updated.
Can anybody give me advice?
rs.Find("patient_id = 2")
rs("NOTES") = "AAAAA"
rs.Update()
But I don't know how to do in VB.NET.
I can find recording using DataView like this.
Sql = "SELECT * FROM patient"
adapter = New OleDbDataAdapter(Sql, cn)
commandBuilder = New OleDbCommandBuilder(adapter)
ds = New DataSet()
adapter.Fill(ds, "patient")
dv = New DataView(ds.Tables("patient"))
dv.Sort = "patient_id"
Dim index As Integer = dv.Find(2)
But, how to update the "first_name" field of the patient table?
I tried like this.
dv(index)("first_name") = "Thomas"
But data does'n be updated.
Can anybody give me advice?