oleDbCommand - Update

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2007
Posts: 4
Reputation: die nadel is an unknown quantity at this point 
Solved Threads: 0
die nadel die nadel is offline Offline
Newbie Poster

oleDbCommand - Update

 
0
  #1
May 23rd, 2007
Dim cb As New OleDb.OleDbCommandBuilder(da)

ds.Tables("me").Rows(inc).Item(2) = txtFirstName.Text
ds.Tables("me").Rows(inc).Item(3) = txtLastName.Text

da.Update(ds, "me")

Im getting a hard time on updating the database, What should I do to update or even add to the database.
The code above is what I use but still it gives me an error.
Please help. Im just new in using VB.net.
Thanks.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 45
Reputation: mike.mclennan is an unknown quantity at this point 
Solved Threads: 0
mike.mclennan's Avatar
mike.mclennan mike.mclennan is offline Offline
Light Poster

Re: oleDbCommand - Update

 
0
  #2
May 23rd, 2007
obviously this is an ASP.NET message board if i am not mistaken. But it seem that you are sending the Update Method a string ("me"), if you set your update command as default it should except strings, integers, bool as default values for each item in the table. maybe you should be doing something more like

  1. da.Update(txtFirstName.text, txtLastName.Text)

Anyways when you open the method, opening it would be putting the "(" after the method name, it should display a tool tip with what the method needs sent it. It should look like (string FirstName,string LastName) and you have to match each item with what value you want sent it..... just take a look.

Hope that helps in some way.
- mike mclennan
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4
Reputation: die nadel is an unknown quantity at this point 
Solved Threads: 0
die nadel die nadel is offline Offline
Newbie Poster

Re: oleDbCommand - Update

 
0
  #3
May 24th, 2007
Still have error An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll eventhough I follow the tool tip you are referring to.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 45
Reputation: mike.mclennan is an unknown quantity at this point 
Solved Threads: 0
mike.mclennan's Avatar
mike.mclennan mike.mclennan is offline Offline
Light Poster

Re: oleDbCommand - Update

 
0
  #4
May 24th, 2007
put a try catch block around it and create a message box to display the incoming errors

  1. MessageBoc.Show(e.Message)

and then run through it with break points. use the F9 key to create a break point and then run through the program with the debugger. The debugger is the most powerful tool in your arsenal. use it as often as you can.
- mike mclennan
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4
Reputation: die nadel is an unknown quantity at this point 
Solved Threads: 0
die nadel die nadel is offline Offline
Newbie Poster

Re: oleDbCommand - Update

 
0
  #5
May 26th, 2007
Thanks man
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC