Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

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

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-26-2008, 10:16 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 159
Default Leading zero(s) for numeric or string type variable not saved in database.

Hi,
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 ?


Regards,
Reply With Quote
  #2 (permalink)  
Old 10-26-2008, 05:18 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

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).
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Numeric Data Input Mask? david Questions (Windows Mobile) 3 11-03-2007 04:04 PM
How to get saved date and time value or other properties of a file? Rioven Questions (Windows Mobile) 1 08-30-2007 07:10 AM
Assign value (numeric) to combox's items? kyto Questions (Windows Mobile) 17 08-17-2007 09:57 PM
How to convert an Access database to a sqlite database Peter Code Samples & Tips 5 07-24-2007 04:20 PM
Numeric conversion limitation? agraham Bug Reports 5 07-06-2007 06:08 PM


All times are GMT. The time now is 05:36 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0