Click here to Skip to main content
15,893,814 members
Home / Discussions / C#
   

C#

 
GeneralRe: Latest built installer for a project doesn't show up in Add/Remove Programs Pin
stingray2712-Jul-13 1:53
stingray2712-Jul-13 1:53 
QuestionRemove / delete MemoryMappedFile Pin
Member 333503211-Jul-13 1:32
Member 333503211-Jul-13 1:32 
AnswerRe: Remove / delete MemoryMappedFile Pin
Garth J Lancaster11-Jul-13 1:54
professionalGarth J Lancaster11-Jul-13 1:54 
GeneralRe: Remove / delete MemoryMappedFile Pin
Member 333503211-Jul-13 2:01
Member 333503211-Jul-13 2:01 
QuestionDesign Question Pin
Kevin Marois10-Jul-13 16:07
professionalKevin Marois10-Jul-13 16:07 
AnswerRe: Design Question Pin
Mycroft Holmes10-Jul-13 17:16
professionalMycroft Holmes10-Jul-13 17:16 
GeneralRe: Design Question Pin
Kevin Marois10-Jul-13 17:31
professionalKevin Marois10-Jul-13 17:31 
GeneralRe: Design Question Pin
Mycroft Holmes10-Jul-13 18:22
professionalMycroft Holmes10-Jul-13 18:22 
Ok a little more detail is required. you have 2 options with this scenario.

You can try and delete the record and hit the constraint and then deal with it by informing the user. This imposes an error on the DB.
You can also query the DB to see if the record can be deleted using an if EXIST query on the related table(s).

The first method is programming by error and is generally used by lazy sods who have no craftsmanship.

The second requires 2 or more round trips to the database and IMHO is a waste of effort. I write a delete procedure that does the checking before it deletes (or deletes the FK children BEFORE it tries to delete the master record). The proc returns the number of master records deleted (1) or failed (0) or if it is not deleting the children and one exists then it returns (-1). This moves the decision into the database and requires one 1 round trip and supplies the feedback to the user if there is an active constraint.
Never underestimate the power of human stupidity
RAH

GeneralRe: Design Question Pin
Kevin Marois10-Jul-13 18:58
professionalKevin Marois10-Jul-13 18:58 
GeneralRe: Design Question Pin
Mycroft Holmes10-Jul-13 19:34
professionalMycroft Holmes10-Jul-13 19:34 
GeneralRe: Design Question Pin
Kevin Marois10-Jul-13 19:57
professionalKevin Marois10-Jul-13 19:57 
GeneralRe: Design Question Pin
Freak3010-Jul-13 21:23
Freak3010-Jul-13 21:23 
GeneralRe: Design Question Pin
jschell11-Jul-13 8:47
jschell11-Jul-13 8:47 
GeneralRe: Design Question Pin
Mycroft Holmes11-Jul-13 12:50
professionalMycroft Holmes11-Jul-13 12:50 
AnswerRe: Design Question Pin
Keith Barrow10-Jul-13 22:38
professionalKeith Barrow10-Jul-13 22:38 
AnswerRe: Design Question Pin
Pete O'Hanlon10-Jul-13 23:51
mvePete O'Hanlon10-Jul-13 23:51 
GeneralRe: Design Question Pin
Keith Barrow11-Jul-13 1:45
professionalKeith Barrow11-Jul-13 1:45 
AnswerRe: Design Question Pin
Shameel11-Jul-13 1:06
professionalShameel11-Jul-13 1:06 
AnswerRe: Design Question Pin
jschell11-Jul-13 8:52
jschell11-Jul-13 8:52 
QuestionUSB drive detection for client-server in C#... Pin
Shibbi10-Jul-13 6:25
Shibbi10-Jul-13 6:25 
AnswerRe: USB drive detection for client-server in C#... PinPopular
NotPolitcallyCorrect10-Jul-13 6:43
NotPolitcallyCorrect10-Jul-13 6:43 
QuestionUSB drive detection for client-server in C# Pin
Shibbi10-Jul-13 6:23
Shibbi10-Jul-13 6:23 
Question.Net Mobile Computing Pin
sijimann10-Jul-13 0:58
sijimann10-Jul-13 0:58 
AnswerRe: .Net Mobile Computing Pin
eddieangel10-Jul-13 10:09
eddieangel10-Jul-13 10:09 
QuestionSqlCe setup issue in C# wpf Pin
McLux9-Jul-13 21:18
McLux9-Jul-13 21:18 

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.