Click here to Skip to main content
15,889,456 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi i have problem
I use sql data i use table adappter to save change from grud view to sql tables
This for fill

////--TO FILL FORM AGAIN FROM SQL AFTER UPDATE
//this.wELDING_SUMMARYTableAdapter.Fill(this.qA_QCSYSTEMDataSet3.WELDING_SUMMARY);




And thus for save and refill again


gridView1.CloseEditor();
            gridView1.UpdateCurrentRow();
            wELDINGSUMMARYBindingSource.MoveNext();
            this.wELDING_SUMMARYTableAdapter.Adapter.ContinueUpdateOnError = true;
            this.wELDING_SUMMARYTableAdapter.Update(this.qA_QCSYSTEMDataSet)
            this.wELDING_SUMMARYTableAdapter.Fill(this.qA_QCSYSTEMDataSet.WELDING_SUMMARY);





I have problem if 2 users update the file if user 1 update row1 and user 2 update row 2 and user1 save change then user2 save his changes he will save his change also read changes from user 1


But problem if user1 and user2 work in same row if first user save first then user 2 save the change from user 2 not saved only he will read change from user1
I don't know why
Can any one help me.

What I have tried:

I try to save by this code
gridView1.CloseEditor();
            gridView1.UpdateCurrentRow();
            wELDINGSUMMARYBindingSource.MoveNext();
            this.wELDING_SUMMARYTableAdapter.Adapter.ContinueUpdateOnError = true;
            this.wELDING_SUMMARYTableAdapter.Update(this.qA_QCSYSTEMDataSet);


            //TO BEST FIT ALL COLUMNS
            //gridView1.BestFitColumns();
            ///------- TO FILL DATA GRIDE VEIEW BY ALL TABLE OR AS PER TEXT BOX VALUE FOR SKETCH NO OR LINE ID OR LINE NO OR TEST PACKAGE SEIRAL OR NAME-----////
            this.wELDING_SUMMARYTableAdapter.Fill(this.qA_QCSYSTEMDataSet.WELDING_SUMMARY);
Posted
Updated 17-Jul-20 22:48pm

The change from the second user triggers a concurrency violation, since the record in the database has been changed since the user started editing it.

You've told your code to ignore these errors - ContinueUpdateOnError = true - so the user's changes are discarded.

Instead, you need to handle the concurrency violation.

Optimistic Concurrency - ADO.NET | Microsoft Docs[^]
 
Share this answer
 
Thanks for your help
I use
ContinueUpdateOnError = true 

Due to if one user delete one row id
and 2nd user still
Update that row when 2nd user save he have
Error due to that tow id deleted so all
His updates discard i need to update
All instead that row which deleted
So i use that
I need like

But when 2 user update same row id i need
Together to be update they changes
If possible

Or other solution if you can help me with
Code to let if one user load in his own
Form one row id
When other users ned to edit that row
Message come that this row in edit status
By other user please wait
 
Share this answer
 
Thanks for your help
I use
<pre>ContinueUpdateOnError = true 

Due to if one user delete one row id
and 2nd user still
Update that row when 2nd user save he have
Error due to that tow id deleted so all
His updates discard i need to update
All instead that row which deleted
So i use that
I need like

But when 2 user update same row id i need
Together to be update they changes
If possible

Or other solution if you can help me with
Code to let if one user load in his own
Form one row id
When other users ned to edit that row
Message come that this row in edit status
By other user please wait
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900