Click here to Skip to main content
15,902,818 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionC# for driver level on print spooler Pin
balu1234523-Jul-08 2:09
balu1234523-Jul-08 2:09 
QuestionUser control & custom control Pin
ashwinibhalerao22-Jul-08 19:17
ashwinibhalerao22-Jul-08 19:17 
AnswerRe: User control & custom control Pin
John Ad22-Jul-08 20:48
John Ad22-Jul-08 20:48 
GeneralRe: User control & custom control Pin
ashwinibhalerao23-Jul-08 3:59
ashwinibhalerao23-Jul-08 3:59 
GeneralRe: User control & custom control Pin
Thomas Stockwell24-Jul-08 5:35
professionalThomas Stockwell24-Jul-08 5:35 
Questionaxwebbrowser to open word document Pin
Arun Ramachandran22-Jul-08 19:12
Arun Ramachandran22-Jul-08 19:12 
QuestionLocking a database record in WinForms Application Pin
aspnet2.developer22-Jul-08 18:43
aspnet2.developer22-Jul-08 18:43 
AnswerRe: Locking a database record in WinForms Application Pin
Mycroft Holmes23-Jul-08 21:07
professionalMycroft Holmes23-Jul-08 21:07 
You are not going to get any code for this as it is a philosophical question.

First thing to ask is this a real world situation, lots of business people raise this sort of ? when in reality it almost never happens.

Second, think about how your system works,
You get a set of records (no lock) that are copies of the data and not connected to the database.
Now the user begins editing, you want the UI to inform the database the records is being edited, the database must retain the identities of all the users who have a copy of the record and inform them that the record is being edited.
Now the user either cancels the edit of saves the record the UI must save back the record, first checking that this is the master copy and should be locked!
When the record is saved the adta should be pushed to the other holders of the record.

The above scenario is a nightmare of pushmepullme horrors.

Answer the first question, and then if it is still an absolute requirement then I suggest the following design.
Do not allow in grid editing. Make the user open a dialog with the 1 record to be edited. If you think this is unreasonable I have 5 major apps in production and there are precisely 2 forms with inline editing. You then lock the record as being edited when passing it to the dialog (use a flag on the record). Only when a SECOND person attempts to edit the exact record do you actually need to do anything, ie tell the second user it is a read only record! If you flag it with an ID you can tell the second use who has it locked.

Caveat - you will inevitably end up with incorrect falgs on records (incomplete edits) make sure you have a maintenance program to clear them down.




Never underestimate the power of human stupidity
RAH

GeneralRe: Locking a database record in WinForms Application Pin
Ashfield25-Jul-08 8:31
Ashfield25-Jul-08 8:31 
QuestionCreating setup project for all users of the system Pin
ngrj22-Jul-08 15:11
ngrj22-Jul-08 15:11 
AnswerRe: Creating setup project for all users of the system Pin
emimmortal22-Jul-08 15:39
emimmortal22-Jul-08 15:39 
JokeRe: Creating setup project for all users of the system Pin
Mycroft Holmes23-Jul-08 21:09
professionalMycroft Holmes23-Jul-08 21:09 
QuestionSetting exe name according to project configuration in VS.NET 2005 [modified] Pin
abcxyz8222-Jul-08 6:32
abcxyz8222-Jul-08 6:32 
AnswerRe: Setting exe name according to project configuration in VS.NET 2005 Pin
abcxyz8222-Jul-08 22:09
abcxyz8222-Jul-08 22:09 
QuestionDataGridView and Combo Boxes (my brain hurts) Pin
davebarkshire22-Jul-08 6:01
davebarkshire22-Jul-08 6:01 
AnswerRe: DataGridView and Combo Boxes (my brain hurts) Pin
bigbrownbeaver22-Jul-08 22:15
bigbrownbeaver22-Jul-08 22:15 
Questiondata binding to radio buttons Pin
bfis10813722-Jul-08 4:55
bfis10813722-Jul-08 4:55 
AnswerRe: data binding to radio buttons Pin
John_Adams22-Jul-08 21:16
John_Adams22-Jul-08 21:16 
GeneralRe: data binding to radio buttons Pin
bfis10813723-Jul-08 3:15
bfis10813723-Jul-08 3:15 
AnswerRe: data binding to radio buttons Pin
Giorgi Dalakishvili22-Jul-08 21:40
mentorGiorgi Dalakishvili22-Jul-08 21:40 
QuestionDesign message box Pin
venkat86_ece21-Jul-08 20:53
venkat86_ece21-Jul-08 20:53 
AnswerRe: Design message box Pin
Brady Kelly21-Jul-08 22:49
Brady Kelly21-Jul-08 22:49 
AnswerRe: Design message box Pin
John_Adams22-Jul-08 20:55
John_Adams22-Jul-08 20:55 
AnswerRe: Design message box Pin
Thomas Stockwell24-Jul-08 5:37
professionalThomas Stockwell24-Jul-08 5:37 
Questionopening work documents in Axwebbrowser: Pin
Arun Ramachandran21-Jul-08 17:52
Arun Ramachandran21-Jul-08 17:52 

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.