1,105,380 Community Members

Problem editing data in access db

Member Avatar
Smalls
Junior Poster in Training
81 posts since Mar 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
0
 

I know i'm probably goin about this bassackwards. But,

window is loaded, binded textboxes get filled, user edits textboxes and clicks a save button

it works, all except crashing with a "vb.net 2010 Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." most of the time but the data does get updated

any ideas on how to be rid of this error will be much appreciated
thnx n adv

'form.vb code for button_click
Dim dtNewRow As DataRow
dtNewRow = dbDataSet.Table.NewRow()
dtNewRow.Item(dbDataSet.Table.Column) = Textbox.Text  '<--this line is followed by 33 more that vary on column and textbox

BindingNavigatorDeleteItem.PerformClick()
dbDataSet.Table.Rows.Add(dtNewRow)
Me.TableAdapter.Update(dbDataSet.table)
Me.dbDataSet.Table.AcceptChanges()

Close()


'dbDataSet.designer.vb erroneous section
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
         Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _
         Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
        Public Overridable Overloads Function Update(ByVal dataTable As dbDataSet.TableDataTable) As Integer
            Return Me.Adapter.Update(dataTable)  '<--the UpdateCommand affected 0 of the expected 1 records.
        End Function

vb.net 2010
access 2010 db file .accdb

Member Avatar
Smalls
Junior Poster in Training
81 posts since Mar 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
0
 

any ideas???

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: