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