What is the correct syntax to check which row in a dataset you are
currently looking at?
I tried this, but it doesn't work :
if (ds.Tables[0].Row == 1)
{
}
What do you mean?
Unless you are iterating through a DataSet like this
for(int i=0; i<ds.Table[0].Rows.Count; i++)
{
}
there is no concept of ordinal or cardinal values. And, if you are going
through like this, the row number only tells you where you are in the loop.
It gives you no information about the data in the row.
you are better to look at the primary key value, esp. if you are not using
derived keys *smacks hands with ruler* or some natural key than trying to
figure out what row.
Now that I am off my soapbox, why is the number important? And, more
important, what is the real problem you are trying to solve? If you only
have time to answer one of the questions, the second one is of more value.
Peace and Grace,
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************