how to access errors?

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...
 
M

Miha Markic [MVP C#]

If we are talking about Sql Server then you get a SqlException when error
occurs.
SqlException has Errors collection...
So does OleDbException.
 
G

Guest

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?
 
C

Cor Ligthert

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
 
S

Sambathraj

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
 

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