Windows Phone 8.1 SQLITE前导零消失 [英] Windows Phone 8.1 SQLITE leading zeros disappears

查看:73
本文介绍了Windows Phone 8.1 SQLITE前导零消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows Phone 8.1应用程序。我在数据库中有一个Text type列。当我将数据插入列中,并且数据包含前导零(Fe:02343)时,db引擎将其存储为零(2343)。插入来自List< mytype>对象通过SqlLiteConnection.InsertOrReplace(object obj)方法。我查看了源列表<>它包含0个字符。我该怎么做才能存储前导零?

I have a Windows Phone 8.1 application. I have a Text type column in the database. When I insert data into the column, and the data contains a leading zero (Fe.: 02343) then db engine stores it without zero (2343). The insertation is from a List<mytype> object by SqlLiteConnection.InsertOrReplace(object obj) method. I check the source list<> it contains the 0 char. What should I do to store leading zero too?

推荐答案

如果02343是一个数字,前导零只用于显示(格式化),没有意义,因为0123是完全相同的东西123 - 在数字...所以SQL将它保存为数字和前导零将消失...如果你想在你的应用程序中显示数字前导零,你必须在右边在您的应用程序中随处格式化...
If 02343 is a number the leading zero is only for display (a formatting) and has no meaning as 0123 is the exactly same thing as 123 - in numbers...So SQL will save it as number and fo that the leading zero will be gone...If you want the numbers to be displayed wiht leading zero in your application you have to the right formatting everywhere in your application...


这篇关于Windows Phone 8.1 SQLITE前导零消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆