zoukankan      html  css  js  c++  java
  • C#数据上传方法

         /// <summary>
            /// 连接成功后开始调用数据上传程序
            /// </summary>
            public void CallDataUpload()
            {
                //指定上传日期后,只上传指定日期的数据
                //取指定的上传日期
                string defineScrq = GetDefineScrq();
                if (defineScrq != "")
                {
                    scrq = Convert.ToDateTime(defineScrq);
                    CreateUploadFile();
                    return;
                }
    
                //取本地的上传站点
                DBhelper.connectionString = GetconnectionString("OracleConn");
                string sczd = GetSczd();
                //设置连接串
                DBhelper.connectionString = GetconnectionString("DestinationConn");//ConfigurationManager.AppSettings["DestinationConn"];
                string count = "select count(*) from T90_UPLOADREGISTER where SCZD='" + sczd + "'";
                if (DBhelper.GetScalar(count) == "0") //上传当天的数据
                {
                    CreateUploadFile();
                }
                else //上传以前的数据
                {
                    DBhelper.connectionString = GetconnectionString("DestinationConn");//ConfigurationManager.AppSettings["DestinationConn"];
                    string sql = "select to_char(max(SCSJ),'yyyy-mm-dd') from T90_UPLOADREGISTER where SCZD='" + sczd + "'";
                    lastTime = DBhelper.GetScalar(sql);//上次上传时间
                    string thisTime = scrq.ToString("yyyy-MM-dd");//本次上传时间
                    sql = "select to_date('" + thisTime + "','yyyy-mm-dd') - to_date('" + lastTime + "','yyyy-mm-dd') from dual";
                    int ts = Convert.ToInt32(DBhelper.GetScalar(sql));//间隔天数
                    scrq = Convert.ToDateTime(lastTime + " " + scrq.ToLongTimeString());
                    for (int i = 0; i < ts; i++)
                    {
                        scrq = scrq.AddDays(1);
                        CreateUploadFile();
                    }
                }
            }
  • 相关阅读:
    重写gallery 的 BaseAdapter
    excel数据导入DB
    更换 字体
    Android Activity跳转 Intent
    mpax5.0比mapx4.51多了些什么功能?
    [转载]INET控件的几点使用
    [转载]GIS基本概念集锦
    [转载]Microsoft.XMLHTTP对象
    等值线的绘制
    [转载]关于webbrowser,innet,xmlhttp获取网页源码的比较!
  • 原文地址:https://www.cnblogs.com/siyunianhua/p/5328764.html
Copyright © 2011-2022 走看看