Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm using the OLEDB updatecommand. I want to update one item in table in my database.

 

Here is a part of my code:

 

 

Dim myUpdateQuery As String = "UPDATE Customer SET CustomerID = '111' "

 

customerdap = New OleDb.OleDbDataAdapter(selstr2, cn)

customerdap.Fill(myCustomertab) customerdap.UpdateCommand = New OleDb.OleDbCommand myUpdateQuery, cn)

 

customerdap.Update(myCustomertab)

 

-----------------------------------------

Somehow it doesn't work and I don't know why. Maybe I forgot something important.

 

Thank's for any help.

Posted

The Datatype of the CustomerID is integer.

 

There is only one row in the dataset.

 

Because:

selstr2 = "Select * from Customerwhere CustomerID = " & textbox1.text

dap = New OleDb.OleDbDataAdapter(selstr2, cn)

 

Then there is only one row in my DataTable.

 

Actually there was no error message, the value just didn't get into the my Database in the Customertable.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...