这段时间一直忙着一个收尾项目,仍然是和之前接收的项目一样,按照预先设计的方案做出来的软件,一旦客户要求增加新的功能或者更改,就有可能对之前的核心部分重新考虑,正在思考有没有好的办法可以用最少的时间来调整这部分内容。

一,windows mobile device center连接windows mobile 5.0

上次由于装了windows 7,将ActiveSync升级到了windows mobile device center,却出现了连接问题,今天尝试了一下,终于可以顺利连接上,方法如下:

1,打开仿真设备管理器,连接上windows mobile 5,按照以前的设置,现在需要改变的就是windows mobile device center的连接设置里选择DMA。

windows mobile开发循序渐进(7)windows mobile device center连接windows mobile 5.0及简单移动程序开发

windows mobile开发循序渐进(7)windows mobile device center连接windows mobile 5.0及简单移动程序开发

2,注意在仿真程序属性中选择外围设备的连接方式是”为串行端口…”

windows mobile开发循序渐进(7)windows mobile device center连接windows mobile 5.0及简单移动程序开发

windows mobile开发循序渐进(7)windows mobile device center连接windows mobile 5.0及简单移动程序开发

3,如果连接顺利现在已经可以在你的电脑中看到设备的图标了,里面有移动设备的各类文件,当然,后来我们会将数据库放进去供移动设备访问。

windows mobile开发循序渐进(7)windows mobile device center连接windows mobile 5.0及简单移动程序开发

二,简单的移动应用程序

一个简单的任务列表TaskList程序,有三个窗口,一个列表窗口,一个添加任务窗口,一个显示任务窗口。

windows mobile开发循序渐进(7)windows mobile device center连接windows mobile 5.0及简单移动程序开发

 windows mobile开发循序渐进(7)windows mobile device center连接windows mobile 5.0及简单移动程序开发

代码很简单,和winform的编程类似,SQL语句也比较类似。

 

 1 using System; 
 2 using System.Linq; 
 3 using System.Collections.Generic; 
 4 using System.Text; 
 5 using System.Data; 
 6 using System.Data.SqlServerCe; 
 7 namespace MyMobileTaskList 
 8 
 9     class DB 
10     { 
11         public static string ConString = "Data Source=MyTask.sdf"
12 
13         public static DataTable GetDataSet(string strSql) 
14         { 
15             SqlCeConnection con = new SqlCeConnection(ConString); 
16             con.Open(); 
17             SqlCeDataAdapter sda = new SqlCeDataAdapter(strSql, con); 
18             DataSet ds = new DataSet(); 
19             sda.Fill(ds); 
20             con.Close(); 
21             return ds.Tables[0];            
22         } 
23 
24         public static void InsertData(string strSql) 
25         { 
26             SqlCeConnection con = new SqlCeConnection(ConString); 
27             con.Open(); 
28             SqlCeCommand cmd = new SqlCeCommand(strSql, con); 
29             cmd.ExecuteNonQuery(); 
30             con.Close(); 
31         } 
32 
33     } 
34 }
35 

 

 

接下来准备做个像样点的程序,就是数据库的优化方面有些困惑,还有任务列表的现实方式得考虑一下了。

在网络上搜了一下,没有找到合适的Demo来练习开发,希望有这方面的例子的朋友分享一下,谢谢!

email:wengyuli@gmail.com

相关文章:

  • 2022-12-23
  • 2021-08-28
  • 2021-10-17
  • 2021-06-25
  • 2021-07-05
  • 2021-12-12
  • 2021-04-19
猜你喜欢
  • 2021-09-13
  • 2021-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-04-15
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案