Click here to Skip to main content
15,911,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: giving error message according to Sql data Pin
Not Active8-Dec-10 9:41
mentorNot Active8-Dec-10 9:41 
GeneralRe: giving error message according to Sql data Pin
Nish Nishant8-Dec-10 9:43
sitebuilderNish Nishant8-Dec-10 9:43 
GeneralRe: giving error message according to Sql data Pin
Eddy Vluggen8-Dec-10 9:53
professionalEddy Vluggen8-Dec-10 9:53 
GeneralRe: giving error message according to Sql data Pin
Nish Nishant8-Dec-10 9:57
sitebuilderNish Nishant8-Dec-10 9:57 
GeneralRe: giving error message according to Sql data Pin
PIEBALDconsult8-Dec-10 14:30
mvePIEBALDconsult8-Dec-10 14:30 
GeneralRe: giving error message according to Sql data Pin
Mycroft Holmes8-Dec-10 12:00
professionalMycroft Holmes8-Dec-10 12:00 
JokeRe: giving error message according to Sql data Pin
Keith Barrow8-Dec-10 10:32
professionalKeith Barrow8-Dec-10 10:32 
AnswerRe: giving error message according to Sql data Pin
Pete O'Hanlon8-Dec-10 11:02
mvePete O'Hanlon8-Dec-10 11:02 
Well, this has certainly been an interesting debate. What nobody has seemed to point out so far is that you actually should combine the two techniques. This is for a simple reason - while you should certainly attempt to detect the unique key violation explicitly, there is no guarantee that this alone will work. The reason for this is simple, presumably your application is going to be multi-user; well, between the time you check the uniqueness and the actual insert occurs, another user could have inputted the same values. So, you have two checks in there - one to cope with the initial check, and a try/catch to cope with the database race condition.

Simple. Job done.Thumbs Up | :thumbsup:

I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Onyx


GeneralRe: giving error message according to Sql data Pin
Not Active8-Dec-10 11:46
mentorNot Active8-Dec-10 11:46 
GeneralRe: giving error message according to Sql data Pin
AspDotNetDev8-Dec-10 11:51
protectorAspDotNetDev8-Dec-10 11:51 
GeneralRe: giving error message according to Sql data Pin
Not Active8-Dec-10 12:10
mentorNot Active8-Dec-10 12:10 
GeneralRe: giving error message according to Sql data Pin
Pete O'Hanlon8-Dec-10 12:30
mvePete O'Hanlon8-Dec-10 12:30 
GeneralRe: giving error message according to Sql data Pin
AspDotNetDev8-Dec-10 11:50
protectorAspDotNetDev8-Dec-10 11:50 
GeneralRe: giving error message according to Sql data Pin
Pete O'Hanlon8-Dec-10 11:53
mvePete O'Hanlon8-Dec-10 11:53 
GeneralRe: giving error message according to Sql data Pin
AspDotNetDev8-Dec-10 12:01
protectorAspDotNetDev8-Dec-10 12:01 
GeneralRe: giving error message according to Sql data Pin
PIEBALDconsult8-Dec-10 14:24
mvePIEBALDconsult8-Dec-10 14:24 
AnswerRe: giving error message according to Sql data Pin
Mycroft Holmes8-Dec-10 12:04
professionalMycroft Holmes8-Dec-10 12:04 
GeneralRe: giving error message according to Sql data Pin
PIEBALDconsult8-Dec-10 14:23
mvePIEBALDconsult8-Dec-10 14:23 
GeneralRe: giving error message according to Sql data Pin
_Maxxx_8-Dec-10 15:25
professional_Maxxx_8-Dec-10 15:25 
GeneralRe: giving error message according to Sql data Pin
Mycroft Holmes8-Dec-10 15:35
professionalMycroft Holmes8-Dec-10 15:35 
GeneralRe: giving error message according to Sql data Pin
_Maxxx_8-Dec-10 19:36
professional_Maxxx_8-Dec-10 19:36 
GeneralRe: giving error message according to Sql data Pin
Mycroft Holmes8-Dec-10 20:08
professionalMycroft Holmes8-Dec-10 20:08 
AnswerRe: giving error message according to Sql data Pin
PIEBALDconsult8-Dec-10 14:30
mvePIEBALDconsult8-Dec-10 14:30 
GeneralRe: giving error message according to Sql data [modified] Pin
Erdinc278-Dec-10 22:05
Erdinc278-Dec-10 22:05 
GeneralRe: giving error message according to Sql data Pin
Pete O'Hanlon9-Dec-10 23:57
mvePete O'Hanlon9-Dec-10 23:57 

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.