Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting a dataset
Message
De
18/07/2013 11:30:35
 
 
À
18/07/2013 11:19:01
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:
01578771
Vues:
40
>Shouldn't this:
>   ' 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
be:
oData.oDataView.Sort = "AI"
> 
>                ' For each record
>                For lnCounter = 0 To oData.oDataView.Count - 1
>                    loRow = oData.oDataView.Item(lnCounter)
>                Next
(Haven't checked the exact syntax). Once again: you are looping through the table in the first case - the DataView may as well not exist.

The Data class always exposes the oDataView once a SQL select has been done.

The oData.nCount is the same as oData.oDataView.Count as this is also initialized from the Data class once a SQL select command is executed.

Now, as far as scanning the rows and assigning them to loRow, oRows is initialized like this at the Data class level:
                ' If we have no record
                If nCount = 0 Then
                    oRows = Nothing
                Else
                    oDataView = oDataSet.Tables("Temp").DefaultView
                    oRows = oDataSet.Tables("Temp").Rows()
                End If
So, the way oRows is initialized here, is it the same thing as oData.oDataView.Item?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform