使用 Web Service 作为中介访问数据,在PDA中可以直接访问安装在访问器上的Web Service,通过Web Service就可以访问远程数据库了.了解Web Service这种方法应该很简单.使用Web Service可以在速度上会稍显得有点慢.
第二种:
直接访问数据库
如果你使用得Sl Server 2000或Sl Server 2005都可以直接访问,如果你使用得Access数据库那就只能用上一种方法了.听PDA公司的人说SL Server 2000要升级到SP4,但好像我没有升级数据库也可以访问到.大家可以试试看. 如果你是在Vs 2005里开发,就先添加System.Data.SlClient引用,如下面的一段代码(其实和桌面系统一样访问):
SlConnection conn = new SlConnection(&uot;Server=10.116.192.7;DataBase=smcgz;User ID=salesmng;Password=j6f7j7g2;Persist Security Info=True;&uot;); try
{
SlCommand cmd = new SlCommand();
https://www.sodocs.net/doc/d210195723.html,mandText = &uot;select Count(*) from Inventory&uot;;
cmd.Connection = conn;
conn.Open()