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
Divers
Thread ID:
00873944
Message ID:
00874052
Vues:
9
This message has been marked as the solution to the initial question of the thread.
You are calling the Object.ToString method which has no overload with one parameter. First you must cast the object to whatever type it is, then call the ToString method.

For example, if it is a decimal, then try this:

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


>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?
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform