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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top