Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SmallInt Cast
Message
De
12/11/2007 14:08:13
 
 
À
12/11/2007 11:44:56
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
01268522
Message ID:
01268551
Vues:
16
Are you sure that the Entity.smallIntField is defined as short and that it's also defined as short in the DataRow?

You also might get this error if the column contains a DBNull.Value (not 100% sure of the error message you'll get with the null).

~~Bonnie



>hi
>
>Whats wrong with the statement below? I get the error message "specified cast is not valid ". I have tried int and short and get the same error. the field is a smallint.
>

>this.Entity.smallIntField = (Int16)row[("smallIntField")];
><\PRE>
>
>TIA
>
>Stuart
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform