DbConcurrency - Design Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Agnes

    DbConcurrency - Design Problem

    I had solve the DbConcurrency problem by using Try and catch , and compare
    the Original & Currenct Record.
    For the single table, I can use the above approcah sucesfully.
    However, for one-to-many relationship,. I don't know how to do it.
    For, example, Invoice (Two tables involved, invoice_info & Invoice_chg) ,
    If two users amend one item's description in Invoice , I don't know how to
    check the sub-item.
    **I only know how to pass one table with one primary key to check the
    DBconcurrency


    _daBase.Fill(_d sBase_ver, _dtTable)
    Dim _col() As DataColumn =
    {_dsBase_ver.Ta bles(_dtTable). Columns(_colnam e)}
    _dsBase_ver.Tab les(_dtTable).P rimaryKey = _col
    rowInDB = _dsBase_ver.Tab les(_dtTable).R ows.Find(_searc hkey)

    ' Loop through the column values.
    Dim i As Integer
    Dim strData_o, strData_c As String
    For i = 0 To dbcx.Row.ItemAr ray.Length - 1
    strData_o = dbcx.Row(i, DataRowVersion. Original).ToStr ing
    strData_c = rowInDB(i, DataRowVersion. Current).ToStri ng
    If strData_o <> strData_c Then

    strOriginal &= dbcx.Row(i, DataRowVersion. Original) &
    ControlChars.Ta b
    strCurrent &= rowInDB(i, DataRowVersion. Current) &
    ControlChars.Ta b
    strYour &= dbcx.Row(i, DataRowVersion. Current) &
    ControlChars.Ta b
    End If
    Next


Working...