如何在Windows Mobile 6.0应用程序中进行Sqlce Connection [英] How to Sqlce Connection in window mobile 6.0 application
问题描述
嗨
我正在尝试将sqlce3.5数据库连接到window moble6.0应用程序,但显示错误路径不正确",
我已经添加了System.Data.Sqlce;命名空间也可以,但仍然无法使用,
我的数据库路径是"C:\ Users \ SHAMS \ Documents \ App.sdf"
当我在连接字符串中给出此字符串时,它显示错误,表明数据库路径不是corect.
请帮助我
如果可以的话
提前致谢
您可以使用此ID与我联系
shams_afridi2002@yahoo.com
Hi
i am trying to make connection of sqlce3.5 database to window moble6.0 application, but it show the the Error "Path is not correct ",
i have added the System.Data.Sqlce; name space also but still not working,
my database path is " C:\Users\SHAMS\Documents\App.sdf"
when i give this in connection string then it show the error the database path is not corect.
please help me
if u can
many thanks in advance
u can contact me on this id
shams_afridi2002@yahoo.com
推荐答案
在移动设备应用程序开发中,该路径始终相对于移动设备"根目录(仅当您使用ActiveSync连接到设备或仿真器时才显示移动设备"选项)而不是C驱动器.与在运行时一样,使用模拟器或使用"\"作为根路径的设备来启动应用程序.仿真器或设备不知道什么是"C:". ;)
将您的sdf文件保存在"\"侧(也称为我的基于移动设备"),然后提供sdf的路径.
示例:如果您的sdf文件位置如下所示:
在我的电脑内部->移动设备->我的基于Windows Mobile的设备-> <您的文件夹=" name ="> \ YourSdfFile.sdf
然后在应用程序中以这种方式给出路径"\<您的文件夹名称> \ YourSdfFile.sdf"
Hi,
In mobile device application development, the path is always relative to "Mobile Device" root("Mobile Device" option appears only if you are connected to device or emulator using ActiveSync) instead of C drive. As when at runtime the application is launched using either emulator or device which use "\" as the root path. Emulator or device does not know what is "C:". ;)
Keep your sdf file in side "\" ( which is also called "My Mobile Based Device" then provide the path of sdf.
Example: If your sdf file location is like following :
Inside My Computer --> Mobile Device -->My Windows Mobile Based Device --> <your folder="" name="">\YourSdfFile.sdf
Then in application give the path this way "\<Your Folder Name>\YourSdfFile.sdf"
String sConnString = @"\MyFolder\sample.sdf"
注意:仅当您使用ActiveSync连接到设备或仿真器时,我的电脑"浏览器中才会显示移动设备"选项.
NB: In My computer explorer "Mobile Device" option appears only if you are connected to device or emulator using ActiveSync.
这篇关于如何在Windows Mobile 6.0应用程序中进行Sqlce Connection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!