Help updatecommand not updating

  • Thread starter Thread starter Fendi Baba
  • Start date Start date
F

Fendi Baba

I wrote to his of code to update a staus field ina table. Somehow
nothing happens though no error was thrown eitheie. Where did I go
wrong?

Please help. Thanks in advance.


Dim note As String
Dim ds As DataSet = New DataSet()
Dim query As StringBuilder = New StringBuilder()
Dim query1 As StringBuilder = New StringBuilder()
query.Append("Update ApptInfo Set ApptCompleted='True'")
query.Append(" where ApptID='" + id + "'")
Dim myConnection As OleDbConnection = New
OleDbConnection(Me.GetConnectionString())
Dim ad As OleDbDataAdapter = New OleDbDataAdapter()
ad.UpdateCommand = New OleDbCommand(query.ToString(),
myConnection)
Return ds
 
I am not familiar with your code, but maybe...

If ApptID is type "Number," then you don't need
to wrap "id" in single quotes...

query.Append(" where ApptID=" + id )
 

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

Back
Top