Leading zero(s) for numeric or string type variable not saved in database.

Discussion in 'Questions (Windows Mobile)' started by mozaharul, Oct 26, 2008.

  1. mozaharul

    mozaharul Active Member Licensed User

    I tried to save in database value (digit) with leading zero(s) for “numeric” and “string” type variable but I found that the zero(s) are dropped for both type of variables and only the digit part are saved. The control I use to input digits is Textbox, What is the mistake am I doing ?

  2. derez

    derez Expert Licensed User

    It all depends on what you do with the data you take from the textbox, since it is usually kept as string.
    Example - if you tell another textbox to show the content of this textbox - it will be the same (with the zeroes).
    If you do a math operation - the data will be changed to numeric.
    Example - textbox1.text + 0 will result a number without leading zeroes.
    copying to a table keeps the leading zero:
    table1.Cell("Col1",rownumber) = textbox1.Text

    So if you'll tell us what you do with it - will be able to help (maybe).
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice