Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting access to a SUM column from the SQL
Message
From
13/06/2006 17:51:09
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Getting access to a SUM column from the SQL
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01128850
Message ID:
01128850
Views:
73
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
Next
Reply
Map
View

Click here to load this message in the networking platform