Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting a dataset
Message
De
18/07/2013 10:21:24
 
 
À
18/07/2013 10:18:23
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01578641
Message ID:
01578748
Vues:
37
>>I was referring to the code in the second (SQL) example (comparing working to non-working versions)
>
>For that part, the code should have been like this for the Data class:
>
>
>                Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1))
>                     oCommand.Connection = loSQLConnection
>                     oDataAdapter.Fill(oDataSet)
>                End Using
>
>                ' Adjust to our default name
>                oDataSet.Tables("Table").TableName = "Temp"
>
>                ' Record count
>                nCount = oDataSet.Tables("Temp").Rows.Count
>
>                oDataView = New DataView
>
>                ' If we have no record
>                If nCount = 0 Then
>                    oRows = Nothing
>                Else
>                    oDataView = oDataSet.Tables("Temp").DefaultView
>                    oRows = oDataSet.Tables("Temp").Rows()
>                End If
>
>
>And, then, from our application, where oData is the object to the data class:
>
>
>                ' Sort the dataset into the primary key
>                oData.oDataView.Sort = "AI"
> 
>                ' For each record
>                For lnCounter = 0 To oData.nCount - 1
>                    loRow = oData.oRows(lnCounter)
>
>                Next
>
So, as mentioned, you are NOT looping thru the sorted DataView (oDataView) but thru oData
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform