none
How to handle exception of concurrency violation RRS feed

  • Question

  • Our vb.net 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 vb.net 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
                Me.DruhyZranitelnostiBindingSource.EndEdit()
                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
                Me.DataSetDruhyZranitelnosti.AcceptChanges()
                Me.DruhyZranitelnostiTableAdapter.Fill(Me.DataSetDruhyZranitelnosti.DruhyZranitelnosti)
                FormCiselnikDruhovZranitelnosti.DruhyZranitelnostiTableAdapter.Fill(FormCiselnikDruhovZranitelnosti.DataSetDruhyZranitelnosti.DruhyZranitelnosti)
                OznacenieDruhuTextBox.BackColor = PovodnaFarbaTextBoxu
                Me.Close()
            Else
            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.

    DataSetKindOfVulnerability.Designer.vb

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

Answers

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


    Success
    Cor

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