Hey Guys

i am doing a small project and i am using vb.net with MS access database.

i am facing a Concurrency issue sometimes when i try to save data in the datagried view.

i have added the datagried view by draging and drop the table from the data source.

only one user is using the form to save data at one time.

i think it works properly unless i moved from record to recored then it gives me an error. "Concurrency, 0 records updated from expected 1....."

any one know how could i solv this issue??

Recommended Answers

All 8 Replies

Could you post the rest of the Exception? Also did you click 'Generate' the Update Delete etc. When you configured the dataadapter?

Post ur code so that we can find out where u r going wrong....

i havent written any code, :), after i added the dataset i draged and droped the table from the data source to the form. so it created the datagried view with the bindingnavigator and the save button.
the save button contains

Me.Validate()
Me.TransactionsBindingSource.EndEdit()
Try
Me.TableAdapterManager.UpdateAll(Me.Mobile_Phone_SolutionDataSet)
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
i added the try catch..
i am not an expert on vb.net because i am an oracle developer.
thank you for your help

Try the following.
1 Right Click on the TableAdapter in the tray below your Form
2 Select Edit Queries In DataSet Designer
3 Right Click on The Name of the DataSet at the top of the DataSet table
4 Click Configure. You should see the select Statement
5 Then Click Advanced
6 Ensure Generate Insert, Update and Delete Statements and Use Optimistic Concurrency is checked
7 Click OK
8 Click Next
9 Make sure all three CheckBoxes are Checked
10 Click Next
11 You should see a list of what was created with checkmarks next to them
12 Click Finish

I did what you told me but an error came up
the error code was: -1
the source: microsoft.VSDesigner

any Idea??

Sorry to hear that didn't work. According to all the documentation this should have worked. When I was having trouble with Visual Studio 2008 Add New Data Source everytime I would try to add a data source I would get an error that said "Procedure Not Available". I solved it by installing Service Pack 1 for VS.Net 2008 Professional. You can download it Here--> Click Here If that is not your version There are links to the version you have.

Have you tried to create a completely new project and add your datasource and see if it would allow you to update your database?

i tried to create a new project but the same problem occurred.
i can insert and update records, but if i insert a record and go
update the other before hitting the save button and then press the save button
the error appears. Concurrency violation 0 records updated expected 1

i installed the sp1 and it worked thank man !!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.