Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > int to numeric numeric(18,2) ?

Reply
Thread Tools

int to numeric numeric(18,2) ?

 
 
jobs
Guest
Posts: n/a
 
      07-21-2007
I have a column that is numeric(18,2) in sql server.

what type should I use in my sqldatasource parameter in asp.net?
<asparameter 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..?

 
Reply With Quote
 
 
 
 
Brandon Gano
Guest
Posts: n/a
 
      07-21-2007
Have you tried using the Decimal type in your code? For example (not
tested):

<asparameter Name="CreditLimit" Type="Decimal" />

ByVal CreditLimit As Decimal



"jobs" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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?
> <asparameter 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..?
>


 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      07-22-2007
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?
> <asparameter 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why is int a[0] not allowed, but int* a = new int[0] is? haijin.biz@gmail.com C++ 9 04-17-2007 09:01 AM
Difference between int i, j; and int i; int j; arun C Programming 8 07-31-2006 05:11 AM
int a[10]; int* p=(int*)((&a)+1); But why p isn't equal to ((&a)+1)? aling C++ 8 10-20-2005 02:42 PM
int main(int argc, char *argv[] ) vs int main(int argc, char **argv ) Hal Styli C Programming 14 01-20-2004 10:00 PM
dirty stuff: f(int,int) cast to f(struct{int,int}) Schnoffos C Programming 2 06-27-2003 03:13 AM



Advertisments