Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple way to scan thru DataSet
Message
From
13/10/2003 15:33:58
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00838181
Message ID:
00838274
Views:
18
Morgan,

Yeah, foreach is another way to do it, but I'm pretty sure it's not as fast.

~~Bonnie

>>I'm looking for a simple way to scan thru a DataSet. I have the following code:
>>
>>
>>Response.Write("<UL>")
>>Dim i As Integer
>>For i = 0 To loData.Tables("Temp").Rows.Count - 1 Step i + 1
>>   Response.Write("<LI>" + loData.Tables("Temp").Rows(i)("UserGroup"))
>>Next
>>Response.Write("</UL>")
>>
>>
>>Is there a faster way to do this?
>>
>>Such as instead of using a For/Next, is there a way to use While Not Eof?
>
>You can do foreach in C#, I'm not sure if one is available in VB.NET, I don't believer there is.
>
>DataSet ds = new DataSet();
>
>string Response = "";
>foreach(DataRow row in ds.Tables["Temp"]) {
>   Response += row["UserGroup"].ToString():
>}
>
>
>
>Morgan
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform