zoukankan      html  css  js  c++  java
  • C# wince 如何将数据上传至远程webservice服务器的sql server中

    我在局域网内建了个WEB SERVICE,SQL SERVER数据库与其在同一台机器上,在WINCE 里用SQLITE数据库, 通过WEBSERVICE将sql server里的相关信息下传至SQLITE中,在对wince 的SQLITE进行相关修改后,要通过什么方式再上传到WEBSERVICE 的SQL SERVER里,请给个建议,谢谢!我用的是VS2008!

    webservice 端 代码:
    public void strLD(string _billid,string _hname,string _wcode,string num)
            {
                  
                     string FeeWare = "FeeWare_" +Year();
                     //string FeeWare = "FeeWare_2013";
                     int order = FeeOrder(_billid);
                     string date =accountD();//取本地的相关值
                     string billid =_billid;//由客户端的参数传过来的账单序号
                     int feeorder = order + 1;
                     string housename = _hname;//由客户端的参数传过来的房间名称
                     string warecode =_wcode ;
                     double salenum =Convert.ToDouble(num);
    string SQLstr = " insert into " + FeeWare + "(feeorder,accountdate,accountbillid,warecode,warename,wareclass,salenum,saleprice,salemoney,feemode,unit,parentcode,parentname,feewarestate,discountrate,accountstate,discountmoney,printnums,rootcode,rootname,ifbillx) select " + feeorder + " ,'" + date + "'," + _billid + ",warecode,warename,wareclass," + salenum + ",saleprice," + salenum + "*saleprice,0,unit,parentcode,parentname,'PDA点单',1,1,0,0,rootcode,rootname,0 from  wares where warecode=" + warecode + "";
                     Db.getObjectExeNonQuery(SQLstr);   
                  }
     public static int FeeOrder(string billid)
            {
                string FeeWare = "feeware_" + Year();
                string SQLstr = "select  top 1 feeorder from " + FeeWare + " where accountbillid=" + billid + " order by  feeorder desc";
                int order = Db.getExecuteScalar(SQLstr);
                //
                if (order == -1)
                {
                    return order = 0;
                }
                else
                {
                    return order;
                }
            }
     public static string Year()
            {
                string y = accountD().Substring(0, 4);
                return y;
                   
            }
    public static string accountD()
            {
                string SQLstr = "select  accountdate from account_para where ifendaccount='false'and ifaccountdate='true'";
                string d =Convert.ToString( Db.objExecuteScalar(SQLstr));
                return d;
            }

  • 相关阅读:
    Linux 第一个脚本程序
    Linux 8开启FTP功能服务
    PPT 倒计时时钟,用 GIF 动画实现,可直接使用 -- 附 Python 实现代码
    python flask 虚拟环境迁移
    GOLANG学习之路之二
    Golang学习之路之一
    vscode 调试flask项目 解决(socket.gaierror: [Errno 11001] getaddrinfo failed)
    windows下部署 flask (win10+flask+nginx)
    git入门
    配置maven的国内镜像
  • 原文地址:https://www.cnblogs.com/liujicai/p/3584634.html
Copyright © 2011-2022 走看看