Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing a field from current dataset
Message
 
To
05/03/2005 18:18:41
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00993047
Message ID:
00993087
Views:
14
Hi Bonnie.. thanks for that and it works fine now.

Regards,
Gerard

>Gerard,
>
>A column in a DataRow or DataRowView is treated as an object, which has to be explicitly cast:
>
>MyPK = (int)drView["MyField"];
>
>
>~~Bonnie
>
>
>>I am trying to get a valus foma column in a dataset, but
>>its giving an error on third line below
>>..cannot implicitly convert type Object to Int
>>
>>int MyPK;
>>DataRowView drView = (DataRowView)this.BindingContext[ds,"MYTABLE"].Current;
>>MyPK = drView["MyField"];
>>
>>Any ideas on whats causing this.
>>Regards,
>>Gerard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform