update db

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

    update db

    I'm adding a field with no value into table. In table I'm allowing null
    value.
    Then, I'm doing an update and I put a value into that field, but I get an
    error:

    System.Data Concurency Violation : the Update Command affected 0 records.

    Why?

    Then, when I close a program and call it again and I try to put a value into
    that empty field I don't get an error.

    Where is a problem?

    Hrcko


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: update db

    Hrvoje,

    Can you show the code you are using? A concurrency violation indicates
    that there has been a change in the table's values from the time that you
    selected the values from the table.

    Do you have a timestamp on the table? If you don't, the data adapter
    will check for concurrency by checking the value of each individual field,
    which can be problematic.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Hrvoje Voda" <hrvoje.voda@lu atech.com> wrote in message
    news:da0ram$93o $1@ss405.t-com.hr...[color=blue]
    > I'm adding a field with no value into table. In table I'm allowing null
    > value.
    > Then, I'm doing an update and I put a value into that field, but I get an
    > error:
    >
    > System.Data Concurency Violation : the Update Command affected 0 records.
    >
    > Why?
    >
    > Then, when I close a program and call it again and I try to put a value
    > into that empty field I don't get an error.
    >
    > Where is a problem?
    >
    > Hrcko
    >[/color]


    Comment

    • Hrvoje Voda

      #3
      Re: update db

      What is timestamp?
      Should I put on the table?
      How?




      "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> wrote in
      message news:eB2AfQYfFH A.272@TK2MSFTNG P15.phx.gbl...[color=blue]
      > Hrvoje,
      >
      > Can you show the code you are using? A concurrency violation indicates
      > that there has been a change in the table's values from the time that you
      > selected the values from the table.
      >
      > Do you have a timestamp on the table? If you don't, the data adapter
      > will check for concurrency by checking the value of each individual field,
      > which can be problematic.
      >
      > Hope this helps.
      >
      >
      > --
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      > "Hrvoje Voda" <hrvoje.voda@lu atech.com> wrote in message
      > news:da0ram$93o $1@ss405.t-com.hr...[color=green]
      >> I'm adding a field with no value into table. In table I'm allowing null
      >> value.
      >> Then, I'm doing an update and I put a value into that field, but I get an
      >> error:
      >>
      >> System.Data Concurency Violation : the Update Command affected 0 records.
      >>
      >> Why?
      >>
      >> Then, when I close a program and call it again and I try to put a value
      >> into that empty field I don't get an error.
      >>
      >> Where is a problem?
      >>
      >> Hrcko
      >>[/color]
      >
      >[/color]


      Comment

      Working...