Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting datarows 2

Status
Not open for further replies.

daveonion

Programmer
Aug 21, 2002
359
GB
Hi I have a datarow array created and populated as such

Dim over_Comp() As DataRow
over_Comp = Ds.Tables("table").Select("Expected completion <='" & Date.Today & "'")

I was wondering what the easiest way is to work out how many records are in the array
thanks in advance
 
Unless I have totally misunderstood this question, I can't see how .GetUpperBound can possibly give the correct answer.


Arrays in VB.NET are 0 based and therefore 1 needs to be added to .GetUpperBound to return tne number of records, whereas

[tt]over_Comp.Length[/tt]

will return the correct answer without any additional modification or calculation.


Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top