Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   int to numeric numeric(18,2) ? (http://www.velocityreviews.com/forums/t523801-int-to-numeric-numeric-18-2-a.html)

jobs 07-21-2007 05:11 PM

int to numeric numeric(18,2) ?
 
I have a column that is numeric(18,2) in sql server.

what type should I use in my sqldatasource parameter in asp.net?
<asp:Parameter Name="CreditLimit" Type="Int32" />


what type should I use in my vb.net method that updates this?
ByVal CreditLimit As Integer

What type should I use in my
parameters.Add("@CreditLimit", SqlDbType.Int).Value = CreditLimit

The list combinations do not work as on the way to to the database I
can't send 50.00, but if I enter 50 I do get 50.00 back.

Clearly something I've overlooked, I dont see type numeric or money..?


Brandon Gano 07-21-2007 09:28 PM

Re: int to numeric numeric(18,2) ?
 
Have you tried using the Decimal type in your code? For example (not
tested):

<asp:Parameter Name="CreditLimit" Type="Decimal" />

ByVal CreditLimit As Decimal



"jobs" <jobs@webdos.com> wrote in message
news:1185037910.897387.192190@22g2000hsm.googlegro ups.com...
>I have a column that is numeric(18,2) in sql server.
>
> what type should I use in my sqldatasource parameter in asp.net?
> <asp:Parameter Name="CreditLimit" Type="Int32" />
>
>
> what type should I use in my vb.net method that updates this?
> ByVal CreditLimit As Integer
>
> What type should I use in my
> parameters.Add("@CreditLimit", SqlDbType.Int).Value = CreditLimit
>
> The list combinations do not work as on the way to to the database I
> can't send 50.00, but if I enter 50 I do get 50.00 back.
>
> Clearly something I've overlooked, I dont see type numeric or money..?
>



=?ISO-8859-1?Q?G=F6ran_Andersson?= 07-22-2007 12:32 AM

Re: int to numeric numeric(18,2) ?
 
jobs wrote:
> I have a column that is numeric(18,2) in sql server.


The type numeric is a synonym for decimal.

> what type should I use in my sqldatasource parameter in asp.net?
> <asp:Parameter Name="CreditLimit" Type="Int32" />


Decimal

>
> what type should I use in my vb.net method that updates this?
> ByVal CreditLimit As Integer


Decimal

> What type should I use in my
> parameters.Add("@CreditLimit", SqlDbType.Int).Value = CreditLimit


SqlDbType.Decimal

> The list combinations do not work as on the way to to the database I
> can't send 50.00, but if I enter 50 I do get 50.00 back.
>
> Clearly something I've overlooked, I dont see type numeric or money..?
>



--
Göran Andersson
_____
http://www.guffa.com


All times are GMT. The time now is 01:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.