469,927 Members | 1,859 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Error checking

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

May 4 '07 #1
1 1296
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
"JJ" <ab*@xyz.comwrote in message
news:et**************@TK2MSFTNGP04.phx.gbl...
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

May 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Tony | last post: by
2 posts views Thread by Keith Bottner | last post: by
3 posts views Thread by baur79 | last post: by
7 posts views Thread by zaperaj | last post: by
2 posts views Thread by akhilesh.noida | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.