Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing a field from current dataset
Message
 
À
05/03/2005 18:18:41
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00993047
Message ID:
00993087
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform