Re: .net 2.0 beta DetailsView question



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?

.



Relevant Pages

  • Re: IRQ BSOD
    ... You receive a "Stop 0x0000000A" error message in Windows XP ... could be a faulty memory problem or a driver conflict problem. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Random restarts
    ... >recovered from a serious error message and says its a driver conflict yet I ... >checked and thier is no conflict. ... Click on the Settings button in the Startup and Recovery ... Automatically restart to clear it. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: WebClient client = new WebClient(); Problem bei Fileupload auf einen IIS6
    ... Verursacht folgende Exception: ... System.Net.WebException: The remote server returned an error: ... Conflict. ... Ich hatte das Gestern schon ausprobiert. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Error Code-12
    ... In the same properties page where the error message occurs, ... Resources tab. ... Windows 2000 attempts to flag the associated device that is ... Either disable or remove the device that is in conflict to see if the ...
    (microsoft.public.win2000.setup_deployment)
  • Re: IP address conflict
    ... I am using windows ce 5.0 device. ... I am able to see when there is an ip address conflict CE system is ... posting one error message. ... Same way to disable the Windows CE error message. ...
    (microsoft.public.windowsce.platbuilder)