Re: .net 2.0 beta DetailsView question
- From: jhoge123@xxxxxxxxx
- Date: 19 May 2005 13:08:05 -0700
Brock,
Thanks for your answer. I looked at the e.Exception object and saw that
the Message property could be parsed.
I have a table with a name column that has a unique constraint on it.
Theoretically the user could enter a duplicate name, and cause an
exception. I can see two ways to hand this:
1) In the ItemInserting event handler, query the database proactively
to see if this name being entered conflicts with other records in the
database and abort the insert if there is a conflict.
2) In the ItemInserted event handler, parse the message text for the
SQL constraint which will be violated in the event of a name conflict.
I would then write a friendly error message out and flag the Exception
as handled.
Option 1 is slower, but option 2 relies on parsing the error message,
which might not be super stable. Any guess?
.
- References:
- .net 2.0 beta DetailsView question
- From: jhoge123
- Re: .net 2.0 beta DetailsView question
- From: Brock Allen
- .net 2.0 beta DetailsView question
- Prev by Date: BadImageFormatException with Microsoft.mshtml
- Next by Date: CLR Profiler
- Previous by thread: Re: .net 2.0 beta DetailsView question
- Next by thread: HttpWebRequest and HTTPS
- Index(es):
Relevant Pages
|