Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to increment a DataRow field
Message
De
24/01/2005 17:12:09
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00980205
Message ID:
00980213
Vues:
40
You're welcome, Gerard. Don't worry, we all had to start from scratch at some point!! =)

~~Bonnie


>Hi Bonnie..
>Thanks again for your reply
>.. I will get the hang of this dor net stuff some day !!
>
>Regards,
>
>Gerard
>
>
>
>>Gerard,
>>
>>DataRow columns are objects. You need to cast it to an int before you attempt to add to it.
>>
>>dr["num_nexta"] = (int)dr["num_nexta"] + 1;
>>
>>
>>~~Bonnie
>>
>>
>>>Hi.
>>>I am trying to add 1 to a datarow field as follows:
>>>
>>>dr["num_nexta"] = dr["num_nexta"] + 1;
>>>
>>>.. it comes up with an eror : Operator + cannot be applied to operannds of type object and int
>>>
>>>however :
>>>
>>>dr["num_nexta"] = 123 is ok.
>>>
>>>Anybody know what I am doing wrong ?
>>>
>>>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