rajesh kasani

rajesh kasani

  • NA
  • 31
  • 17.9k

how to update rows one after other

Mar 19 2011 4:56 PM
hi friends,

  In Ado.net how to update rows one after the other in a particular table when there is a condition for limit let me say

if(ds.Tables[0].Rows.Count==0)
{
   // Update the first row
  //after that
  // update second row.....so...on
  // this happens in a asp.net page
 can this be done like this
int rowpionter=0;
While(rowpionter<10)
{
    update tbl_name set col_name=' ',col1_name=' ' where colPK='ds.Tables[0].Rows[rowpointer].ItemArray[0].Tostring();
   rowpionter++;
}

}

this is when database is having 10 records the next record should not be inserted but updated and then next should be updated

Thanxs for u r help
Bye rajesh

Answers (3)