Recordset in .NET 
Author Message
 Recordset in .NET

Hi,

In VB.NET as we are aware that the concept of Recordset is replaced by
Dataset,
But How do the operatioor how to retrieve the methods of Move First
,Move Next as we do in recordset.

regds,
Meenakshi



Sat, 27 Mar 2004 12:59:56 GMT  
 Recordset in .NET
Actually, the simplest way to move quickly and efficiently through a set of
data is to use the DataReader object.
After filling it using a DataAdapter object, it will be automatically
positioned at the first row, so a MoveFirst is not necessary.
The you call the READ method of your DataReader object to advance through
each row (instead of MoveNext.)


Quote:
> Hi,

> In VB.NET as we are aware that the concept of Recordset is replaced by
> Dataset,
> But How do the operatioor how to retrieve the methods of Move First
> ,Move Next as we do in recordset.

> regds,
> Meenakshi



Sat, 27 Mar 2004 16:29:23 GMT  
 Recordset in .NET
Quote:
>Actually, the simplest way to move quickly and

efficiently through a set of

Quote:
>data is to use the DataReader object.

True, but the DataReader object is forward-only. What if
there's a need for backward or relational movement through
the 'recordset'?

So far, all I could find is using the Rows collection of
the DataTable object within the DataSet. Since it's a
collection, you can use

    Dim DS As New DataSet()
    Dim R As DataRow()

    'fill DS with data

    For Each R In DS.Tables(1).Rows
        'do stuff on data
    Next

or to reference in indexed order

    For i = 0 To DS.Tables(1).Rows.Count - 1
        'do stuff on DS.Tables(1).Rows(i)
    Next i

Using this method, you can move previous by referencing
Rows(i-1) or move next with Rows(i+1).

If anyone does find equivalents
to .MoveNext, .MovePrevious, .Move, .MoveFirst,
and .MoveLast, I'd like to know as well.

- Jarod Chay



Sun, 28 Mar 2004 03:14:48 GMT  
 Recordset in .NET
I believe that ADO.NET supports only forward-only and if you need to
traverse back and forth you will have to use regular ADO which can be used
in vb.net code just like in vb6.

MS did this because they figure that the most use for reading data is
forward only specially in distributed computing.  It is a so much cheaper
too have forward only disconnected datasets than say bi-directional
pessimistic connected recordsets.

-Emad


Quote:
> >Actually, the simplest way to move quickly and
> efficiently through a set of
> >data is to use the DataReader object.

> True, but the DataReader object is forward-only. What if
> there's a need for backward or relational movement through
> the 'recordset'?

> So far, all I could find is using the Rows collection of
> the DataTable object within the DataSet. Since it's a
> collection, you can use

>     Dim DS As New DataSet()
>     Dim R As DataRow()

>     'fill DS with data

>     For Each R In DS.Tables(1).Rows
>         'do stuff on data
>     Next

> or to reference in indexed order

>     For i = 0 To DS.Tables(1).Rows.Count - 1
>         'do stuff on DS.Tables(1).Rows(i)
>     Next i

> Using this method, you can move previous by referencing
> Rows(i-1) or move next with Rows(i+1).

> If anyone does find equivalents
> to .MoveNext, .MovePrevious, .Move, .MoveFirst,
> and .MoveLast, I'd like to know as well.

> - Jarod Chay



Mon, 29 Mar 2004 22:58:21 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. using db2400 recordsets in .net

2. Disconnected Recordsets in ADO.NET?

3. VB .NET view Recordset in DataGrid

4. MSDatashape in VB.NET- access childs in recordset

5. VB.NET and ADO Recordsets

6. VB .Net / Win98 / ADO large recordsets

7. RecordSets with VB.Net

8. VB.Net counterpart to Recordset functionality

9. Does VB.NET have a problem with Recordsets?

10. Hierarchical ADO recordset -> ADO.NET Dataset Fill

11. Creating ADO recordset w/o database .Append not working correctly IIS5 win2000 Prof not .Net

12. Displaying cystalreport.net report from ADODB recordset

 

 
Powered by phpBB® Forum Software