i am getting a problem during oledbdataadapter update at runtime

my code is like this

con.open();

oledbdataadapter oda=new oledataadapter(commandtext,con)  // first dataadapter

dataset ds=new dataset();

oda.fill(ds,"labs");

for(  some condition)

{   string commandtext2="bla-bla";
    oledbdataadapter oda2=new oledataadapter(commandtext2,con)  // second dataadapter

     dataset ds2=new dataset();
     oda2.fill(ds2,"class");
     cmd.commandtext="sql statement";
     oda2.fill(ds2,"subjects");
     
     my code logic here

   oledbCommandBuilder cmdbuild=new oledbCommandBuilde(oda2);
 ***  [B] oda2.update(ds2,"class");[/B]
    oda2.update(ds2,"subjects");
}
   oledbCommandBuilder cmdbuild2=new oledbCommandBuilde(oda);
oda.update(ds,"labs");
con.close();

I'm getting an error at runtime as "concurrency conflict: updated 0 rows instead of expected 1 rows" at the line *** starred.

so pls help me

Wich are the SQL sentences you have written in the DeleteCommand, InsertCommand and UpdateCommand of your OleDbDataAdapter?

They ar not shown in your code and are required to call the Update.

Sincerely

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.