position of new row in Rows Collection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

can i be assured that the following ("lastrowadded") will always refer to the last row that was added to the collection? or are there exceptions?

int c= dataSet1.tbl1.Rows.Count;
DataRow lastrowadded=dataSet1.tbl1[c-1];

thanks
 
Hi,

When you add row you add it to the collection. In this case you always add
it to the end of the collection. It should be enough to use index, but to be
sure you could set reference to the added row and it will work anyway
 
Back
Top