|
-
Oct 6th, 2002, 07:49 PM
#1
Thread Starter
Registered User
from datareader to array
Anyone know the most efficient way from one t'other?
-
Oct 6th, 2002, 08:55 PM
#2
A datareader only reads the line that it is currently one when it comes to it so you'd just have to loop and read into the array. I am assuming you mean array of datarows.
-
Oct 6th, 2002, 09:24 PM
#3
Thread Starter
Registered User
Yep... I wanna get all the data into an array and send it back....
But in vb6 there was a getrows method which was way faster than looping through records one by one... so I was trying to find the equivalent in .net, any ideas?
-
Oct 6th, 2002, 09:40 PM
#4
If you are going to be sending it back you should use a dataset. Or you can still use the ADODB recordsets from vb6.
-
Oct 6th, 2002, 09:41 PM
#5
Fanatic Member
I haven't worked with DataReader, but you may want to also look into putting the data into a DataSet table and then .Selecting from that, which returns rows in an array, e.g.
Dim arrRows() As DataRow = dsData.Table("Table").Select("Field = 'Foo'")
returns an array of rows where Field = Foo.
...
Doh!! Beat me again! heh.
-
Oct 6th, 2002, 09:50 PM
#6
Thread Starter
Registered User
Problem is that is slower and a less scalable solution. I like managing concurrency myself and using stored procs to do the updates / deletions... Just wondering if there was a getrows equivalent in .net?
Also because I work with sybase I am using odbc ado objects and they don't work well with web services, so I am forced to pass back arrays rather than ADO datasets/datareaders.
-
Oct 6th, 2002, 09:54 PM
#7
In that cause no I don't think there is anything like getrows in .NET, but hopefully someone will prove me wrong.
-
Dec 20th, 2006, 10:04 AM
#8
Hyperactive Member
Re: from datareader to array
 Originally Posted by Edneeis
In that cause no I don't think there is anything like getrows in .NET, but hopefully someone will prove me wrong.
Actually there is a way... look at http://www.developerfusion.co.uk/show/4566/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|