Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
> operator vs. datarow column of System.Decimal type?
Message
 
To
02/12/2003 14:41:14
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00855035
Message ID:
00855164
Views:
15
Good thought, thanks. I actually had tried that earlier with similar failure as trying to cast to int. However, based on your suggestion, I did find something that works. The reason that it didn't work for me before (the commented line below) was that "inline" casting apparently doesn't allow access to the methods of the casted type (I'm just guessing here, but Intellisense wouldn't pop up the list of Decimal members and at runtime I was told that CompareTo was not a member of the object).
//if ((decimal)drQuery["SalesMin"].CompareTo( (decimal)0 ) > 0)
decimal SalesMin = (decimal)drQuery["SalesMin"];
if (SalesMin.CompareTo( (decimal)0 ) > 0)
Thanks to everyone for the suggestions.
Kelly

>From your original post, you said the data column was decimal, so I assume you want to cast it to decimal, not int. I bet that will work just fine.
>
>~~Bonnie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform