Binding Datagrid Variables

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

    #1

    Binding Datagrid Variables

    Hello All,

    I am having a problem with a winform datagrid. I am trying to update an
    oracle table, but I need the original data from the "TID" cell if a user
    decides to change that cells data. Here's what I am currently trying:

    Dim cmd As New OracleCommand(" UPDATE tablename SET TID = :TID WHERE CARD =
    '" & currcell & "' AND REASON = '" & reasoncode & "' " _
    &" AND CD_SEQ = '" & codeseq & "' AND TID = :Original_TID")

    cmd.Parameters. Add(New OracleParameter (":TID", OracleType.VarC har, 12, "TID"))
    cmd.Parameters. Add(New OracleParameter (":Original_TID ", OracleType.VarC har,
    12, "TID"))

    cmd.Connection = Conn
    da.UpdateComman d = cmd
    Conn.Open()
    da.Update(ds, "tablename" )

    I am getting a concurrency violation error.

    I am sure it's this line thats causing the problem, but I dont know how to
    fix it:
    cmd.Parameters. Add(New OracleParameter (":Original_TID ", OracleType.VarC har,
    12, "TID"))

    Any idea on how to bind both the :Original_TID and :TID without getting the
    concurrency errors?

    The code works fine if I manually put in a value for the :Original_TID in
    the Update statement and then remove the problem line above.

    Any ideas?

    Thanks in advance

    --
    Kevin
Working...