Anyone know the most efficient way from one t'other?
Printable View
Anyone know the most efficient way from one t'other?
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.
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?
If you are going to be sending it back you should use a dataset. Or you can still use the ADODB recordsets from vb6.
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.
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.
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/Quote:
Originally Posted by Edneeis