how to access errors?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In ado we get errors by an error collection, and generate customized error
messages. How can we store or reach to errors in ado.net?

Thanks...
 
If we are talking about Sql Server then you get a SqlException when error
occurs.
SqlException has Errors collection...
So does OleDbException.
 
Then how can I handle the error? For example in a login page i want to return
an error if the username does not exist, and how can i create a custom error
message according to error i get?
 
Basulasz.
Then how can I handle the error? For example in a login page i want to
return
an error if the username does not exist, and how can i create a custom
error
message according to error i get?

There are probably thousands solutions, one of them both working on webpage
and winform.

Put a label on your form wherin you place the errormessage.

I hope this helps,

Cor
 
Hi,
One of the soultion would be that validate the user id and password in the
Stored procedure and Raise error with an custom meesage if user id is not
valid. You can catch this exception and display the message.
Regards,
Sambathraj
 
Back
Top