Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataView/DataSet/DataReader
Message
From
08/01/2007 12:33:43
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
To
08/01/2007 12:30:01
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01183234
Message ID:
01183493
Views:
38
>>No Michel the sam prb was that he wasn't casting the datarow to the int, in c# you always need to cast to the specific type like you do in VB.NET when you have option strict on, I always use option strict on and recomend to anyone one using vb.net to do the same since it can help you find prbs on your app while your developing.
>
>This is nice as it allows strong typing down below. For example, in my case, if I wish to extract the month portion of a date, I cannot do it like that:
>
>
>   lnMonth = loRow("Date").Month
>
>
>but only like this
>
>
>Dim ldDate AS Date = Date.Now
>ldDate = loRow("Date")
>lnMonth = ldDate.Month
>
>
>I need to force the proper data type first into ldDate. Then, I can have it to lnMonth without having the compiler to complain.
>
>Thanks for the additional information

Yes Michel but with option strict on you can do the following, you don't need all that code, you can just do
lnMonth = CDATE(loRow("Date")).Month
Alexandre Palma
Senior Application Architect
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform