Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SmallInt Cast
Message
From
12/11/2007 14:08:13
 
 
To
12/11/2007 11:44:56
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Miscellaneous
Thread ID:
01268522
Message ID:
01268551
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform