Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataView/DataSet/DataReader
Message
De
08/01/2007 10:33:05
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
À
08/01/2007 10:18:06
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01183234
Message ID:
01183449
Vues:
43
Sam u can also do
namt = (int)rdr["maxordamt"];
what is does is cast the object into an int

>>>C# doesn't like lnAmt = rdr["maxordamt"];.
>
>Hi Michel.
>I just panic.
>If I do this...
>
> strQuery = rdr["maxordamt"].ToString();
> namt = int.Parse(strQuery);
>
>It seems to work.
>I guess I just need to be more creative and put more thought into what I'm doing with C#.
>
>
>lnAmt = rdr["maxordamt"] gave me "Cannot implicitly convert object into string..." error message.
>
>Thanks
>
>>
>>What do you mean by "C# doesn't like"? Are you obtaining an error message? If yes, this is necessary for one to provide support. It would also help to see your SQL command. We cannot see it in here as it hasn't been provided in the code sample.
>>
>>>And I can't do lnAmt = rdr["maxordamt"].ToString();.
>>>How do I save maxordamt, which is a numeric (99999.99) into lnAmt variable so I can insert it into orderamt field in MyTarget table which is also numeric?
>>
>>Once the first situation resolved, that command should work. Note that you do not have to convert to string.
Alexandre Palma
Senior Application Architect
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform