Click here to Skip to main content
15,912,329 members
Home / Discussions / C#
   

C#

 
GeneralRe: mdiChild Form Pin
zeeShan anSari6-Jul-08 1:54
zeeShan anSari6-Jul-08 1:54 
QuestionHow to lock record when inserting Pin
dabuskol5-Jul-08 23:33
dabuskol5-Jul-08 23:33 
Hi,

I have more than 10 users inserting records at the same in one table throughout the day and most of the time I have problem mixing data. I have a header/detail entry form web page.

My insert occurs when the users click the Submit button, it will SELECT the next available number from DB and use it as my Primary key to insert record (header/detail).
Most of the time 2 users get the primary key at the same time.

If you could redirect me to the site with has the solution in locking or help me in my problem
My Solution but sometimes it failed.
bool blnExist = false;
while (!blnExist)
{
  string sKdey = PopulateDraftNumber();
  if (IfKeyExists(sKdey))
  {
    blnExist = false; //found record, reselect another key
  }
  else
   {
    blnExist = true; //found no record insert into table
    lblRequestNo.Text = sKdey;
    INSERT RECORD INTO TABLE
   }
}


Dabsukol

AnswerRe: How to lock record when inserting Pin
Nader Elshehabi6-Jul-08 0:29
Nader Elshehabi6-Jul-08 0:29 
GeneralRe: How to lock record when inserting Pin
dabuskol6-Jul-08 1:01
dabuskol6-Jul-08 1:01 
GeneralRe: How to lock record when inserting Pin
Nader Elshehabi6-Jul-08 1:13
Nader Elshehabi6-Jul-08 1:13 
AnswerRe: How to lock record when inserting Pin
Pete O'Hanlon6-Jul-08 11:09
mvePete O'Hanlon6-Jul-08 11:09 
QuestionQuestion about running threads in C# Pin
Yanshof5-Jul-08 21:46
Yanshof5-Jul-08 21:46 
AnswerRe: Question about running threads in C# Pin
Nader Elshehabi6-Jul-08 0:50
Nader Elshehabi6-Jul-08 0:50 
QuestionEditing DataGridViewImageCell? Pin
anton-095-Jul-08 19:34
anton-095-Jul-08 19:34 
AnswerRe: Editing DataGridViewImageCell? Pin
Nader Elshehabi6-Jul-08 0:54
Nader Elshehabi6-Jul-08 0:54 
QuestionVS2005 whether there are similar delphi in the control Notebook Pin
ChinaTJBoy5-Jul-08 17:54
ChinaTJBoy5-Jul-08 17:54 
AnswerRe: VS2005 whether there are similar delphi in the control Notebook Pin
Nader Elshehabi6-Jul-08 0:20
Nader Elshehabi6-Jul-08 0:20 
Questionhow to change DataGridView Event calling sequence Pin
Xmen Real 5-Jul-08 17:49
professional Xmen Real 5-Jul-08 17:49 
AnswerRe: how to change DataGridView Event calling sequence Pin
Nader Elshehabi6-Jul-08 0:18
Nader Elshehabi6-Jul-08 0:18 
GeneralRe: how to change DataGridView Event calling sequence Pin
Xmen Real 6-Jul-08 0:23
professional Xmen Real 6-Jul-08 0:23 
GeneralRe: how to change DataGridView Event calling sequence Pin
Nader Elshehabi6-Jul-08 1:03
Nader Elshehabi6-Jul-08 1:03 
GeneralRe: how to change DataGridView Event calling sequence Pin
Xmen Real 6-Jul-08 2:26
professional Xmen Real 6-Jul-08 2:26 
GeneralRe: how to change DataGridView Event calling sequence Pin
Nader Elshehabi6-Jul-08 2:52
Nader Elshehabi6-Jul-08 2:52 
GeneralRe: how to change DataGridView Event calling sequence Pin
Xmen Real 6-Jul-08 2:55
professional Xmen Real 6-Jul-08 2:55 
GeneralRe: how to change DataGridView Event calling sequence Pin
Xmen Real 6-Jul-08 5:39
professional Xmen Real 6-Jul-08 5:39 
QuestionWhat are your suggestions ? Pin
Mohammad Dayyan5-Jul-08 14:24
Mohammad Dayyan5-Jul-08 14:24 
AnswerRe: What are your suggestions ? Pin
Christian Graus5-Jul-08 15:40
protectorChristian Graus5-Jul-08 15:40 
GeneralRe: What are your suggestions ? Pin
Mohammad Dayyan5-Jul-08 16:21
Mohammad Dayyan5-Jul-08 16:21 
GeneralRe: What are your suggestions ? Pin
Christian Graus5-Jul-08 16:22
protectorChristian Graus5-Jul-08 16:22 
GeneralRe: What are your suggestions ? Pin
Mohammad Dayyan5-Jul-08 16:34
Mohammad Dayyan5-Jul-08 16:34 

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.