Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing a field from current dataset
Message
De
06/03/2005 09:28:51
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00993047
Message ID:
00993098
Vues:
12
>Hi Bonnie.. thanks for that and it works fine now.<

Great! Glad I could help. =)

~~Bonnie



>
>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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform