Asp to Aspx, Response.Write Recordset.fields(1).value question

Discussion in 'ASP .Net' started by Gian Paolo Clarici, Jul 21, 2004.

  1. I'm migrating one Asp page to Aspx.
    There is a recordset and I need to Reponse.write the content of one of its
    fields .
    That field comes from a Numeric(5,2) SQL datatype
    Its content is : 90.00

    In Asp, the instruction

    Response.Write Recordset.Fields(1).value

    returns 90 (the trailing zero are automatically eliminated)


    while in Aspx

    Response.Write(Recordset.Fields(1).value)

    return 90.00 (the trailing zero are NOT automatically eliminated)


    It seems to be a problem of implicit/explicit conversion from to
    string/decimal datatypes.

    How can I obtain the same result (90) in aspx without having to force
    particular convertions?
    (for example the following will work
    Response.Write( VAL (Recordset.Fields(1).value) )

    but since I've a lot of page to convert with a lot of fields, I'm searching
    for a solution that implies
    something like a Global option to be set, without having to search for all
    the decimal fields and then convert them.
    )

    sorry for my bad english

    Thanks
    GPC
     
    Gian Paolo Clarici, Jul 21, 2004
    #1
    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. =?Utf-8?B?QWJlbCBDaGFu?=
    Replies:
    6
    Views:
    9,379
    Rahul
    May 3, 2006
  2. Nirosh
    Replies:
    0
    Views:
    643
    Nirosh
    Apr 28, 2009
  3. Hung Huynh
    Replies:
    8
    Views:
    311
    Bob Barrows
    Sep 24, 2003
  4. Fawke101

    Response.write RecordSet values

    Fawke101, Apr 21, 2004, in forum: ASP General
    Replies:
    4
    Views:
    353
    Ray at
    Apr 21, 2004
  5. Replies:
    3
    Views:
    151
    Bob Barrows [MVP]
    Jan 23, 2007
Loading...

Share This Page