int to numeric numeric(18,2) ?

Discussion in 'ASP .Net' started by jobs, Jul 21, 2007.

  1. jobs

    jobs Guest

    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..?
     
    jobs, Jul 21, 2007
    #1
    1. Advertising

  2. jobs

    Brandon Gano Guest

    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" <> wrote in message
    news:...
    >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, Jul 21, 2007
    #2
    1. Advertising

  3. 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
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Jul 22, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Schnoffos
    Replies:
    2
    Views:
    1,227
    Martien Verbruggen
    Jun 27, 2003
  2. Hal Styli
    Replies:
    14
    Views:
    1,657
    Old Wolf
    Jan 20, 2004
  3. arun
    Replies:
    8
    Views:
    460
    Dave Thompson
    Jul 31, 2006
  4. aling
    Replies:
    8
    Views:
    962
    Jim Langston
    Oct 20, 2005
  5. Replies:
    9
    Views:
    439
    James Kanze
    Apr 17, 2007
Loading...

Share This Page