Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Friends,

The code in my Form shows an error
SQLException was unhandled
The pointer of the error is shown to the line below

Me.TableAdapterManager.UpdateAll(Me.CustomerDataSet1)

Thanks in advance
Posted

1 solution

Start by putting a try...catch block around the code that generates the error and looking at the exception object it it returns. It (or the InnerException) should give you more information about exactly what the DB server is finding wrong.

When you know that, you can start looking for why it's complaining, but at least you will have some information to go on - unlike us...
 
Share this answer
 
Comments
olly2014 7-Sep-14 10:51am    
Outstanding Reply...Thankyou very much (OriginalGriff)
The application started working..
Highly appreciate your support..
Kind Regards Olly
OriginalGriff 7-Sep-14 10:57am    
You do realize that just adding the try...catch gets rid of the error message, but it doesn't get rid of the problem? If it's round an INSERT operation that fails, it means the row(s) weren't added to the DB...

Yes, of course *you* do - but you'd be surprised how many people think getting rid of the error message gets rid of the problem! :laugh:
olly2014 7-Sep-14 11:36am    
Appreciate your comment(OriginalGriff)
As your rightly said the error got elimanted and the application could save the contents(data) of the file. However, after closing the application and restarting it the data vanishes off. Hope, you may be having some clue. Thanks In advance
OriginalGriff 7-Sep-14 12:04pm    
As I said, getting rid of the message didn't get rid of the problem.
You need to look at the Exception object that the Catch gives you and see what it says that the DB is having a problem with: it could be an invalid column content, a bad date, or anything else at this point. Only looking at the Exception itself will tell you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900