3
Answers

Locking Mysql table after inserting one row using c# code.

kedar pawgi

kedar pawgi

9y
315
1
Hi 
 
I am  developing a software. In that software just consider table "COMPANY", after logging in to the software ( very first time ), user will enter his company details. Once the company details are entered and inserted into table , later user should not be able to insert new record (the table should get locked using c# code ). Also if he wish to edit the details he should be able to do that and by opening the lock of the table. Once the update is over then again table should get locked. 
 
Else is there any other solution for my problem , please let me know. I will be very thankful. 
 
 
 
Answers (3)
0
Nishant Mittal

Nishant Mittal

NA 5.8k 354.8k 9y
Hi
 
try reading this
 
http://www.dotnetperls.com/lock
 
http://www.codeproject.com/Tips/788402/Monitor-and-Lock-in-Csharp 
0
kedar pawgi

kedar pawgi

NA 105 38.3k 9y
hi sir sorry to say but i didnt understood what you wish to say. I request you to please let me know in brief what exactly you wish to say. What i understood is i should make a function in c# and directly use insert command. Is that so, plz let me know thanks in advance.
0
Nishant Mittal

Nishant Mittal

NA 5.8k 354.8k 9y
Hi
 
use
Lock(this)
{
//Insert the record in the table 
 
hope it will work 
Next Recommended Forum