Member_2_5230414
asked on
VB.net arrays
Hi,
im currently strongting the output of my loop in a string but have been told it would be better to store it in an array
How would i store the above as an array?
im currently strongting the output of my loop in a string but have been told it would be better to store it in an array
Public Shared Function Getthestats(ByVal thedataview As DataView, ByVal hometeam As String, ByVal awayteam As String) As String
'' dataview-> dtRecords2
'need to loop through the results in datview and get all results for it
Dim hometeamscoresingle As String = ""
For Each dv2 As DataRowView In thedataview
If dv2.Row.Item("HomeTeam") = hometeam Then
hometeamscoresingle += dv2.Row.Item("FTHG") & "|"
ElseIf dv2.Row.Item("AwayTeam") = hometeam Then
hometeamscoresingle += dv2.Row.Item("FTAG") & "|"
End If
Next
Return hometeamscoresingle
End Function
How would i store the above as an array?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry codecruiser.. you typed it out faster than I did :(
It really depends on what you need to do with the data later on....
Just an aside.
Based on this and your other questions I have a horrible suspicion you do not understand databases and how to design tables and relations (or just collections of data in memory).
There are numerous things which you seem to be attempting to do (and have problems with) which ought to be really trivial if the storage of the data was well designed.
Based on this and your other questions I have a horrible suspicion you do not understand databases and how to design tables and relations (or just collections of data in memory).
There are numerous things which you seem to be attempting to do (and have problems with) which ought to be really trivial if the storage of the data was well designed.
ASKER
Without shooting me down to much to retrieve the list would be
Dim scoretest As ArrayList = Getthestats(dtRecords2, dv2.Row.Item("hometeam").Trim(), "")
ASKER
Did it 50/50 :)
Figured out my last question also.
Figured out my last question also.