Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting access to a SUM column from the SQL
Message
De
13/06/2006 17:51:09
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Getting access to a SUM column from the SQL
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01128850
Message ID:
01128850
Vues:
76
I have a situation that I am trying to resolve. If I do this:
MessageBox.Show((25).ToString("#########0"))
It works. But, if I do this:
        Dim loDataProviderTotal As Framework.Framework.Data = New Framework.Framework.Data(oApp)
        Dim loRowTotal As DataRow

        If Not loDataProviderTotal.SQLExec("SELECT SUM(NewAccount) AS SumColumn FROM Monthly", oApp.aConnection(3)) Then
            MessageBox.Show(oApp.cError + " : " + loDataProviderTotal.cSQL + " : " + loDataProviderTotal.cConnectionString)
            Exit Sub
        End If

        loRowTotal = loDataProviderTotal.oDataView(0).Row
        MessageBox.Show(loRowTotal("SumColumn").ToString("#########0"))
I end up with an error:

Conversion from string "#########0" to type 'Integer' is not valid.

Basically, there seems to be something different in the way .NET handles a SUM column from the SQL. Anyone knows what need to be adjusted in order to apply the same formatting from the sum column?
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