Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formatting numeric strings
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Formatting numeric strings
Divers
Thread ID:
00873944
Message ID:
00873944
Vues:
48
I am having trouble with the formatting of SQL results, my code looks something like this:

mmDataSet ds = (mmDataSet)this.GetDataSet("SELECT " +
"dollarAmt FROM myTable);

this.dollarString = ds.Tables[0].Rows[0][0].ToString();

This works fine, but if I try to change to:

this.dollarString = ds.Tables[0].Rows[0][0].ToString("C");

I get the error:

No overload for method 'ToString' takes '1' arguments

How do I format the numeric value in the DataSet to display in currency format?

Kind Regards,

Mat
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform