How to handle exception of concurrency violation RRS feed

  • Question

  • Our application is based on the many datasets.
    All these datasets are created by visual drag and drop grafical interface such as designer and wizard of vs2013?
    All forms in this our large desktop applications are based on the binding DataGridView and the binding TextBoxes.

    How to handle exception of concurrency violation e.g. in this code section.

        Private Sub ButtonUloz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUloz.Click
            If KontrolaDat() = True Then
                FormCiselnikDruhovZranitelnosti.Upravovany = OznacenieDruhuTextBox.Text
                Dim changes As DataTable = Me.DataSetDruhyZranitelnosti.DruhyZranitelnosti.GetChanges
                If Not changes Is Nothing Then
                    If PopisDruhuTextBox.Text = "" Then
                        changes.Rows(0).Item("Popis") = Nothing
                    End If
                    Dim cnt As Integer = Me.DruhyZranitelnostiTableAdapter.Update(changes)
                End If
                OznacenieDruhuTextBox.BackColor = PovodnaFarbaTextBoxu
            End If
        End Sub

    Can you please verify my account?

    Many thanks, 'cause I can't insert the picture with information about exception which arises here in.


            <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
             Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", ""),  _
             Global.System.ComponentModel.Design.HelpKeywordAttribute("")>  _
            Public Overloads Overridable Function Update(ByVal dataTable As DataSetKindOfVulnerability.KindOfVulnerabilityDataTable) As Integer
                Return Me.Adapter.Update(dataTable)
            End Function
    Exception arises exactly here in this row of designer code.
     Return Me.Adapter.Update(dataTable)

    • Edited by Vyvoj DS Wednesday, December 17, 2014 9:31 AM
    • Moved by Alex Bulankou Wednesday, December 17, 2014 3:22 PM ADO.NET question
    Tuesday, December 16, 2014 11:40 AM


  • Take first a look at your other question and the description link I've sent you in that.


    • Marked as answer by Vyvoj DS Friday, January 2, 2015 9:29 AM
    Wednesday, December 17, 2014 6:18 PM