如何在Windows Mobile 6.0应用程序中进行Sqlce Connection

编程入门 行业动态 更新时间:2024-10-07 04:33:17
本文介绍了如何在Windows Mobile 6.0应用程序中进行Sqlce Connection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨 我正在尝试将sqlce3.5数据库连接到window moble6.0应用程序,但显示错误路径不正确", 我已经添加了System.Data.Sqlce;命名空间也可以,但仍然无法使用, 我的数据库路径是"C:\ Users \ SHAMS \ Documents \ App.sdf" 当我在连接字符串中给出此字符串时,它显示错误,表明数据库路径不是corect. 请帮助我 如果可以的话 提前致谢 您可以使用此ID与我联系 shams_afridi2002@yahoo

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

推荐答案

在移动设备应用程序开发中,该路径始终相对于移动设备"根目录(仅当您使用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

本文发布于:2023-11-23 06:58:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620529.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   如何在   Windows   Mobile   Sqlce

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!