Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper way to sort a dataset
Message
De
17/05/2006 16:53:34
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Proper way to sort a dataset
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01123003
Message ID:
01123003
Vues:
64
To sort a dataset, I am doing presently this:
    ' Sort the dataset
    ' expC1 Field
    Public Function Sort(ByVal tcField As String) As Boolean
        oDataView = oDataSet.Tables(0).DefaultView
        oDataView.Sort = tcField
        Return True
    End Function
Then, I am using this to loop through the data view:
        For Each loRowDataView In loFileDirectory.oDataView
            cHtml = cHtml + loRowDataView("Name")
        Next
It works but I was wondering if there could be another way by simply always using the dataset. Because, originally, I had this when I was working on the dataset without any sort:
        For Each loRow In loDataProvider.oDataSet.Tables(0).Rows
            cHtml = cHtml + loRow("Name")
        Next
So, I am wondering if I can still use the dataset direct access to get my data once the dataset has been sorted? Because, the only way I have found so far was to use the view functionality of the dataset to get my data.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform