Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Casting a VFP numeric field
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01392244
Message ID:
01392248
Vues:
41
>Hi
>I have following code , in ASP.net but I get a casting error
>
> int intNumber;
> intNumber = (int)MyDs.Tables[0].Rows[0]["PAR_NUM"];
>
>If I leave out tjhe int, I get a complier error
>
>
>How do I store a VFP NUmeric field to a C# field
>

The underlying field in the row is already an int (or whatever), it's just stored as an object type (that's how the row can store all the various types). You have to cast it back to it's original type. Hover over this section in the debugger (or just paste it in the watch window) and you can see the original type. It's probably something like decimal or float instead of an int.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform