-
March 14th, 2013, 06:31 AM
#1
Handling DataError
I'm using an already existing database for my project, the data types are all set inside the access db, so I get the default DataGridView DataError every time I try to put something different in there. How do I replace the default message with something like 'Wrong data type' (that's the only exception I need to handle). If somebody could be so nice and explain it to me along with the whole 'handling a withevents variable' (I can't get that to work either).
-
March 14th, 2013, 08:26 AM
#2
-
March 20th, 2013, 12:05 PM
#3
Re: Handling DataError
I made a simple application that can add/save/delete/search records in an access database. Each of the fields in the database had data type you can input specified inside the access file, and whenever I try to input something else, it gives me this lengthy error (There was an error in the DataGridView etc etc.) and tells me to 'handle the DataError exception' to replace it with a different message. I need to replace the default message with something else. Any chance you could help me with that? That's the best I could explain my problem.
-
March 20th, 2013, 10:11 PM
#4
Re: Handling DataError
That's not how a DB is supposed to be designed, or work! Make a few different record (types or whatever) sharing a common key, and the store that as a secondary key to locate the first record.
-
March 20th, 2013, 11:51 PM
#5
Re: Handling DataError
You were given the answer as to how to handle an exception in post number 2.
Code:
Try
'some code would be here that may trigger an exception
Catch
'Some code would be here that will only execute if an exception occurs in the Try portion above
End Try
Always use [code][/code] tags when posting code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|