We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,099 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Concurency

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??

3
Contributors
8
Replies
1 Week
Discussion Span
10 Months Ago
Last Updated
9
Views
Question
Answered
Commando123
Newbie Poster
23 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

kRod
Junior Poster in Training
71 posts since May 2012
Reputation Points: 18
Solved Threads: 24
Skill Endorsements: 0

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

poojavb
Posting Pro
524 posts since Nov 2011
Reputation Points: 39
Solved Threads: 77
Skill Endorsements: 5

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

Commando123
Newbie Poster
23 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

kRod
Junior Poster in Training
71 posts since May 2012
Reputation Points: 18
Solved Threads: 24
Skill Endorsements: 0

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

any Idea??

Commando123
Newbie Poster
23 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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?

kRod
Junior Poster in Training
71 posts since May 2012
Reputation Points: 18
Solved Threads: 24
Skill Endorsements: 0

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

Commando123
Newbie Poster
23 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 10 Months Ago by kRod and poojavb

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

Commando123
Newbie Poster
23 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0614 seconds using 2.46MB