V
VB Programmer
Need help. Here's my example updating a db using an edited dataset. But,
for some reason the db is NOT being updated!
Private Sub UpdateData()
cnnTechNames.Open()
With daNetworkNames
.SelectCommand.CommandText = "SELECT * FROM NetworkNames WHERE
FullName = 'John Smith';"
.Fill(dsNetworkNames)
End With
With dsNetworkNames.Tables(0)
.Rows(0).BeginEdit()
' Increment privilege field by 1
.Rows(0)("Privilege") = CType(.Rows(0)("Privilege"), Short) + 1
.Rows(0).EndEdit()
.Rows(0).AcceptChanges()
End With
daNetworkNames.Update(dsNetworkNames)
cnnTechNames.Close()
End Sub
Please help! Also, I want to know the simplest way to update data in the
database.
Thanks.
for some reason the db is NOT being updated!
Private Sub UpdateData()
cnnTechNames.Open()
With daNetworkNames
.SelectCommand.CommandText = "SELECT * FROM NetworkNames WHERE
FullName = 'John Smith';"
.Fill(dsNetworkNames)
End With
With dsNetworkNames.Tables(0)
.Rows(0).BeginEdit()
' Increment privilege field by 1
.Rows(0)("Privilege") = CType(.Rows(0)("Privilege"), Short) + 1
.Rows(0).EndEdit()
.Rows(0).AcceptChanges()
End With
daNetworkNames.Update(dsNetworkNames)
cnnTechNames.Close()
End Sub
Please help! Also, I want to know the simplest way to update data in the
database.
Thanks.