Click here to Skip to main content
16,004,901 members
Home / Discussions / Database
   

Database

 
GeneralRe: databinding textbox to a database Pin
yogesh_kumar_agarwal29-Feb-08 0:09
yogesh_kumar_agarwal29-Feb-08 0:09 
GeneralRe: databinding textbox to a database Pin
laziale29-Feb-08 0:28
laziale29-Feb-08 0:28 
GeneralRe: databinding textbox to a database Pin
yogesh_kumar_agarwal29-Feb-08 0:57
yogesh_kumar_agarwal29-Feb-08 0:57 
GeneralRe: databinding textbox to a database Pin
laziale29-Feb-08 1:20
laziale29-Feb-08 1:20 
GeneralInserting strings that contains comma Pin
Deques28-Feb-08 21:33
Deques28-Feb-08 21:33 
GeneralRe: Inserting strings that contains comma Pin
Colin Angus Mackay28-Feb-08 21:44
Colin Angus Mackay28-Feb-08 21:44 
Generalsearch the data using GSM modem Pin
ieyra20428-Feb-08 17:59
ieyra20428-Feb-08 17:59 
GeneralConcurrency violation: the DeleteCommand affected 0 of the expected 1 records. Pin
baranils28-Feb-08 8:19
baranils28-Feb-08 8:19 
Hello I have problem deleting rows

Below is the function I call when the user explicitely ask updade for it's changes

The dataset is the datasource of a datagridview

The first time the function is called it works fine

But if it is called a second time with the same datagrid view I got the error
{"Concurrency violation: the DeleteCommand affected 0 of the expected 1 records."}

But if I make another select between the two call : no error

I probabely miss something ?

    private void do_update()<br />
    {<br />
<br />
      MySqlCommandBuilder cb = new MySqlCommandBuilder(adaAddr);<br />
<br />
      DataSet ch = new DataSet();<br />
      ch = dsAddr.GetChanges(DataRowState.Deleted);<br />
      if (null != ch)<br />
      {<br />
        int del=adaAddr.Update(ch);  // at the second call error ocurs here<br />
       lbl_delcnt.Text = del.ToString();<br />
      }<br />
<br />
      ch = dsAddr.GetChanges(DataRowState.Modified);<br />
      if (ch != null)<br />
      {<br />
        int upd=adaAddr.Update(ch);<br />
        lbl_updcnt.Text = upd.ToString();<br />
      }<br />
<br />
      ch = dsAddr.GetChanges(DataRowState.Added);<br />
      if (ch != null)<br />
      {<br />
        int add=adaAddr.Update(ch);<br />
        lbl_addcnt.Text = add.ToString();<br />
      }<br />
<br />
      MySqlCommand cmd = new MySqlCommand("DELETE from tours where addrID not in ( select addrID from address );", conn);<br />
      int tourdel=cmd.ExecuteNonQuery();<br />
      lbl_deltourcnt.Text = tourdel.ToString();<br />
       <br />
      return;

GeneralDeleted Record In SQL TAble Pin
kibromg28-Feb-08 7:12
kibromg28-Feb-08 7:12 
GeneralRe: Deleted Record In SQL TAble Pin
pmarfleet28-Feb-08 19:54
pmarfleet28-Feb-08 19:54 
GeneralProblem with update statement Pin
matjame28-Feb-08 3:20
matjame28-Feb-08 3:20 
GeneralRe: Problem with update statement Pin
matjame28-Feb-08 3:21
matjame28-Feb-08 3:21 
GeneralLinked Server communication throws 'MSDTC on server is unavailable' error Pin
Steven J Jowett27-Feb-08 22:57
Steven J Jowett27-Feb-08 22:57 
GeneralDifference between SQLSERVER 2000 and SQLSERVER 2005 Pin
anujose27-Feb-08 21:52
anujose27-Feb-08 21:52 
GeneralRe: Difference between SQLSERVER 2000 and SQLSERVER 2005 Pin
Giorgi Dalakishvili27-Feb-08 22:11
mentorGiorgi Dalakishvili27-Feb-08 22:11 
GeneralRe: Difference between SQLSERVER 2000 and SQLSERVER 2005 Pin
scottgp28-Feb-08 2:40
professionalscottgp28-Feb-08 2:40 
JokeRe: Difference between SQLSERVER 2000 and SQLSERVER 2005 Pin
Xmen Real 28-Feb-08 4:35
professional Xmen Real 28-Feb-08 4:35 
Questionsqlcommandbuilder.getdeletecommand Pin
rizwan127-Feb-08 20:36
rizwan127-Feb-08 20:36 
GeneralBefore Update Triggers and changing inserted recordset Pin
Leo Smith27-Feb-08 9:17
Leo Smith27-Feb-08 9:17 
GeneralRe: Before Update Triggers and changing inserted recordset Pin
pmarfleet27-Feb-08 11:09
pmarfleet27-Feb-08 11:09 
GeneralQuery Help Pin
solutionsville27-Feb-08 4:00
solutionsville27-Feb-08 4:00 
GeneralRe: Query Help Pin
pmarfleet27-Feb-08 6:25
pmarfleet27-Feb-08 6:25 
AnswerRe: Query Help Pin
solutionsville27-Feb-08 7:40
solutionsville27-Feb-08 7:40 
GeneralRe: Query Help Pin
pmarfleet27-Feb-08 7:54
pmarfleet27-Feb-08 7:54 
AnswerRe: Query Help Pin
solutionsville27-Feb-08 8:08
solutionsville27-Feb-08 8:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.