Error checking

J

JJ

What's best practise in this situation:

Upon submitting data input on a detailsview (bound to an objectdatasource),
I need to check for a duplicate email address (in an sql database) and
present the error message (if the email already exists) on the detailsview.

The data is strored in the sql table via a stored procedure which returns a
negative number without adding the record, in case of duplicate entries.

The question is:

How do I get the objectdatasource to tell me that the insert/update action
returned a negative value?
Can I display the error message and keep the inputted data in the
detailsview fields?

Is this the best way for me to inhibit duplicate entries?


Thanks,

JJ
 
J

JJ

I've managed to collect the returned negative value from the
objectdatasource using the OnInserted event.
My question no is how do I keep the values in the DetailsView to allow the
user to correct them?

When I refresh the page with the error message, the details view clears its
data.



JJ
 

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

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top