Hi, I had a VB application that exported the values of one column -
all rows - to an array by doing:
rs.movefirst
ar = rs.getrows(, , "col2")

What is the equivalent to this in ADO.Net?
Thanks
Ali

Re: ADO.Net equivalent of the ADO rs.GetRows() method by Joyjit

Joyjit
Tue Dec 07 00:35:02 CST 2004

Hi,

If you are using a DataReader, which is readonly & forwardonly, you could
use something like

while dr.Read()
{
Get all the values
}

If you are using a Dataset, you could use indexers like

var = Ds.Tables[0].Rows[i][j]

See more on the section on ADO .NET in MSDN at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconoverviewofadonet.asp

Thanks
Joyjit

"Ali M" <alibiz@earthlink.net> wrote in message
news:6lv9r0pemi4rr69pkcs2sds07cvqu031dn@4ax.com...
> Hi, I had a VB application that exported the values of one column -
> all rows - to an array by doing:
> rs.movefirst
> ar = rs.getrows(, , "col2")
>
> What is the equivalent to this in ADO.Net?
> Thanks
> Ali
>



Re: ADO.Net equivalent of the ADO rs.GetRows() method by Cor

Cor
Tue Dec 07 05:08:13 CST 2004

Ali,

In ADONet you do not need it as Joyjit already wrote because the datatable
is already a collection (array of objects).

However there are such a lot of posibilities extra to select rows.

Have by instance a look at the datatable.select
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatatableclassselecttopic.asp

But there are much more.

I hope this helps?

Cor