Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In what were replaced metods from VB6 in VB.NET

Status
Not open for further replies.

miho1

Technical User
Oct 22, 2002
78
BG
Hi,

In VB6 ADO was present metods MoveFirst, MoveNext and Move. Last.
In what were replaced in VB.NET?

Thanks

Miho
 
The DataTable contains a Rows Property and this is just a Collection of objects similar to old-school VB6 collections:

Code:
Private Sub PrintRows(myDataSet As DataSet)
    ' For each table in the DataSet, print the values of each row.
    Dim thisTable As DataTable
    For Each thisTable In  myDataSet.Tables
        ' For each row, print the values of each column.
        Dim myRow As DataRow
        For Each myRow In  thisTable.Rows
            Dim myCol As DataColumn
            For Each myCol In  thisTable.Columns
                Console.WriteLine(myRow(myCol))
            Next myCol
        Next myRow
    Next thisTable
End Sub

Private Sub AddARow(ds As DataSet)
    Dim t As DataTable
    t = ds.Tables("Suppliers")
    ' Use the NewRow method to create a DataRow with the table's schema.
    Dim newRow As DataRow = t.NewRow()
    ' Set values in the columns:
    newRow("CompanyID") = "NewCompanyID"
    newRow("CompanyName") = "NewCompanyName"
    ' Add the row to the rows collection.
    t.Rows.Add(newRow)
End Sub

Bryan Wilhite
Songhay System
 
Yes it so. But I ask as I can go on the following row in DataSet or on the first.

Miho
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top