Windows Mobile应用程序 [英] windows mobile application

查看:181
本文介绍了Windows Mobile应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经开发了Windows Mobile应用程序,已将数据插入到 .sdf 文件的表中.

我想通过我的桌面应用程序访问该 .sdf 文件中的数据.

请给我建议,如何从移动应用程序的 sdf 文件到桌面(Windows应用程序)访问数据.

hi every body,

i have developed windows mobile application , i have inserted the data into the tables of .sdf file.

i want to access the data from that .sdf file through my desktop application .

please give me suggestion how can i access the data from the sdf file of mobile application to desktop(windows application).

推荐答案

SDF文件是SQLCE数据库-您可以使用SqlCEConnector,SqlCECommand和类似的类在C#中访问它们:
SDF files are SQLCE databases - you can access them in C# using the SqlCEConnector, SqlCECommand and such like classes:
using (SqlCEConnection con = new SqlCEConnection(strConnect))
    {
    con.Open();
    using (SqlCECommand com = new SqlCECommand("SELECT iD, description FROM PurchaseTypes", con))
        {
        using (SqlCEDataReader reader = com.ExecuteReader())
            {
            while (reader.Read())
                {
                int id = (int) reader["iD"];
                string desc = (string) reader["description"];
                Console.WriteLine("ID: {0}\n    {1}", iD, desc);
                }
            }
        }
    }


这篇关于Windows Mobile应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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