Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting integer from dataset without tostring conversion
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00705358
Message ID:
00705421
Vues:
9
Hi Evan,

You need to cast the DataRow value to an int like the following:
(int)dsClinserv.Tables["cresult"].Rows[0]["fk_dept"];
>How can I get an interger value out of a dataset without converting to a string and then back to an integer? I am using the following (very rundundant) code. There must be a better way.
>
>
>Convert.ToInt16(dsClinserv.Tables["cresult"].Rows[0]["fk_dept"].ToString())
>
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform