DataTable and DataView do not include MoveFirst, MoveLast, MoveNext, and MovePrevious navigation methods (310372)
The information in this article applies to:
- Microsoft ADO.NET (included with the .NET Framework) 1.0
- Microsoft ADO.NET (included with the .NET Framework 1.1)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual Basic .NET (2003)
This article was previously published under Q310372
This article refers to the following Microsoft .NET Framework Class Library namespace:
SYMPTOMS
In Microsoft ActiveX Data Objects (ADO), you can use the MoveFirst, the MoveLast, the MoveNext, and the MovePrevious methods to navigate through your recordset. However, ADO.NET does not include these navigation methods.
CAUSE
Because a DataTable object is always in memory, ADO.NET does not require cursor access. ADO.NET uses array access instead.
RESOLUTION
To access a row in a DataTable, use one of the following methods:
- Reference the row number directly.
- If you use data binding, use the CurrencyManager class.
- Use the For Each...Next Microsoft Visual Basic .NET statement or the foreach Microsoft Visual C# .NET statement to enumerate the rows.
STATUSThis behavior is by design.REFERENCES
For more information about the CurrencyManager class, refer to the following MSDN Web site:
Modification Type: | Minor | Last Reviewed: | 3/9/2006 |
---|
Keywords: | kbprb kbSqlClient kbSystemData KB310372 kbAudDeveloper |
---|
|