944,068 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 3823
  • ASP.NET RSS
May 23rd, 2007
0

oleDbCommand - Update

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
die nadel is offline Offline
4 posts
since May 2007
May 23rd, 2007
0

Re: oleDbCommand - Update

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

ASP.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 39
Solved Threads: 0
Light Poster
mike.mclennan is offline Offline
45 posts
since May 2007
May 24th, 2007
0

Re: oleDbCommand - Update

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
die nadel is offline Offline
4 posts
since May 2007
May 24th, 2007
0

Re: oleDbCommand - Update

put a try catch block around it and create a message box to display the incoming errors

ASP.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 39
Solved Threads: 0
Light Poster
mike.mclennan is offline Offline
45 posts
since May 2007
May 26th, 2007
0

Re: oleDbCommand - Update

Thanks man
Reputation Points: 10
Solved Threads: 0
Newbie Poster
die nadel is offline Offline
4 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: how to autogenerate date
Next Thread in ASP.NET Forum Timeline: help Web server Crashes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC