Click here to Skip to main content
15,889,266 members
Home / Discussions / C#
   

C#

 
Generaledit position (cursor? carret?) of richtextbox Pin
sduhd5-Dec-07 16:05
sduhd5-Dec-07 16:05 
GeneralRe: edit position (cursor? carret?) of richtextbox Pin
Christian Graus5-Dec-07 16:12
protectorChristian Graus5-Dec-07 16:12 
GeneralSend Program Over eMail Pin
MasterSharp5-Dec-07 14:23
MasterSharp5-Dec-07 14:23 
GeneralRe: Send Program Over eMail Pin
Colin Angus Mackay5-Dec-07 14:26
Colin Angus Mackay5-Dec-07 14:26 
GeneralRe: Send Program Over eMail Pin
MasterSharp5-Dec-07 14:32
MasterSharp5-Dec-07 14:32 
GeneralRe: Send Program Over eMail Pin
Christian Graus5-Dec-07 16:13
protectorChristian Graus5-Dec-07 16:13 
GeneralRe: Send Program Over eMail Pin
MasterSharp6-Dec-07 10:39
MasterSharp6-Dec-07 10:39 
GeneralCatch Specific exception in SqlClient Pin
Skanless5-Dec-07 13:18
Skanless5-Dec-07 13:18 
I am writing an HR application to add new employees. Currently, I am having an issue where I want to send a specific message base on the exception that is received. In my database SNN is a unique key hence if an SSN is being added that already exist in the DB a Unique key violation exception is thrown. If the UserID already exist a Primary Key violation exception is thrown. I am certain this is possible but just not sure what is best practice. I can write a method which search the DB first and if the record is found thrown an error message based on whether it was the Unique key violation or the PK violation. I have also been searching MSDN to see if I can identify the C# SqlClient error ID for either scenarios and based on the exception ID, alert the user with the right error message.

Any advice will be greatly appreciated.

Skan

If you knew it would not compile why didn't you tell me?!?!?!

GeneralRe: Catch Specific exception in SqlClient Pin
Colin Angus Mackay5-Dec-07 14:23
Colin Angus Mackay5-Dec-07 14:23 
GeneralRe: Catch Specific exception in SqlClient Pin
Skanless5-Dec-07 14:44
Skanless5-Dec-07 14:44 
GeneralRe: Catch Specific exception in SqlClient Pin
Ennis Ray Lynch, Jr.5-Dec-07 16:16
Ennis Ray Lynch, Jr.5-Dec-07 16:16 
GeneralRe: Catch Specific exception in SqlClient [modified] Pin
Skanless5-Dec-07 18:03
Skanless5-Dec-07 18:03 
GeneralRe: Catch Specific exception in SqlClient Pin
Skanless5-Dec-07 22:34
Skanless5-Dec-07 22:34 
GeneralRe: Catch Specific exception in SqlClient Pin
PIEBALDconsult7-Dec-07 12:36
mvePIEBALDconsult7-Dec-07 12:36 
QuestionPerformance in PictureBox playing an animated Gif Pin
RodiGarcia5-Dec-07 12:22
RodiGarcia5-Dec-07 12:22 
GeneralRe: Performance in PictureBox playing an animated Gif Pin
Christian Graus5-Dec-07 13:08
protectorChristian Graus5-Dec-07 13:08 
Questionhow to write code to download file Pin
uowzd015-Dec-07 12:05
uowzd015-Dec-07 12:05 
GeneralRe: how to write code to download file Pin
Christian Graus5-Dec-07 12:11
protectorChristian Graus5-Dec-07 12:11 
GeneralRe: how to write code to download file Pin
uowzd015-Dec-07 13:16
uowzd015-Dec-07 13:16 
QuestionSelectionColor in RichTextBox when minimized Pin
Johan Martensson5-Dec-07 11:45
Johan Martensson5-Dec-07 11:45 
AnswerRe: SelectionColor in RichTextBox when minimized Pin
bcool6330316-Apr-09 4:46
bcool6330316-Apr-09 4:46 
GeneralDataset rowfilter Pin
Scalee5-Dec-07 10:19
Scalee5-Dec-07 10:19 
QuestionFraming JScript Exceptions in C#? Pin
kumar.bs5-Dec-07 10:02
kumar.bs5-Dec-07 10:02 
QuestionDataGridView DoubleClick Event handler fails when CTRL key is held while DoubleClicking Pin
alanteigne5-Dec-07 10:01
alanteigne5-Dec-07 10:01 
GeneralRe: DataGridView DoubleClick Event handler fails when CTRL key is held while DoubleClicking Pin
alanteigne6-Dec-07 2:07
alanteigne6-Dec-07 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.