Database all to Pot

N

Newbie!

Hey Gorup,

I keep getting this error:
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll

When trying to run the following code from a Button:
Private Sub btnPasswordListUpdate_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnPasswordListUpdate.Click
odaPasswordLists.Update(dsPasswordLists)
End Sub

Anyone have any General Ideas?

Ta
Si
 
M

Mike Bulava

Well that Exception is very generic when working with Databases. Look at
the Err.Description to get a better understanding of what's going wrong
 
N

Newbie!

Where would i find the err.description?

Ta
Si

Mike Bulava said:
Well that Exception is very generic when working with Databases. Look at
the Err.Description to get a better understanding of what's going wrong
 
M

Mike Bulava

Sorry didn't see the Name. In the Catch block of Code type
MsgBox(Err.Description) .

Err is like an exception and gets thrown with exceptions it used to be the
main way of catching errors in older VB, I still use it a lot to this day
though because the description in that is usally 10 times better then the
exception.
 
R

Ron Allen

You may have a reserved word as one of your field names in the database.
This will cause the update to fail. You don't show the Insert/delete/update
statements for the DataAdapter so it's hard to tell if this is actually the
problem. If you are using a CommandBuilder set the QuotePrefix and
QuoteSuffix properties appropriately. A field name like password will cause
this error.
Try putting a try/catch statement around your Update call and print the
message and stack trace from the trapped error to get more detail.
Ron Allen
 

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

Top