Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
> operator vs. datarow column of System.Decimal type?
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00855035
Message ID:
00855085
Vues:
17
I thought that I had tried casting to Int but it told me something about not being able to convert object to int. I'll try that again.

I recall that "Typed Datasets" was the title of the next section in the book I'm reading -- guess I should have pushed a little further into it last night. :)

Thanks.

>Well, there are two ways. You could use a typed ADO.NET dataset, so when you get that column from your DataRow you would not get an object but a decimal.
>
>
>CustomDataSet ds = new CustomDataSet();
>int RowNumber = 0;
>if(ds.MyTable[RowNumber].SalesMin > 0) {
>etc..
>
>
>The other way is to cast the object to an int
>
>(int)dsQuery["SalesMin"] > 0
>
>
>You will run into problems if you are trying to cast a null object though.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform