Ejemplo n.º 1
0
        public SaveDataToDb()
        {
            DataAccess = new DataAcc();
            DataAccess.ConnectionString = InitConfig.DbConnectionString;
            DataAccess.ProviderName = InitConfig.DbProvideName;

            DataAnalyAccess = new Tcs.Libary.DataAccess();
            DataAnalyAccess.ConnectionString = InitConfig.AnsyDbConnectionString;
            dtsPath = InitConfig.DtsPath;
            CoalSavaItems= new string[150, 2];
        }
Ejemplo n.º 2
0
        public UpLoadState()
        {
            MessageState.TimeToBeReceived = new TimeSpan(0, 0, 10);//接受目标消息队列所需的最长时间10秒
            MessageState.TimeToReachQueue = new TimeSpan(0, 0, 10);//消息到达队列所需的最长时间10秒
            MessageState.Formatter = new System.Messaging.BinaryMessageFormatter();//消息队列格式:二进制

            mcoper = new MqClientOperation();
            //初始化消息队列
            mcoper.InitServerQueue(InitConfig.RealStateServerIP, InitConfig.RealStateQueueName, false);
            dataAcc = new DataAcc();
            dataAcc.ConnectionString = InitConfig.AnsyDbConnectionString;
        }
Ejemplo n.º 3
0
        public SaveDataToDb(string WsDownvalue, string WsUpvalue, string CODownvalue, string COUpvalue,bool checkUserGB)
        {
            this.WsDownvalue = WsDownvalue;
            this.WsUpvalue = WsUpvalue;
            this.CODownvalue = CODownvalue;
            this.COUpvalue = COUpvalue;
            this.userGB = checkUserGB;
            DataAccess = new DataAcc();
            DataAccess.ConnectionString = InitConfig.DbConnectionString;
            DataAccess.ProviderName = InitConfig.DbProvideName;

            DataAnalyAccess = new Tcs.Libary.DataAccess();
            DataAnalyAccess.ConnectionString = InitConfig.AnsyDbConnectionString;
            dtsPath = InitConfig.DtsPath;
            CoalSavaItems = new string[150, 2];
        }
Ejemplo n.º 4
0
 private DataAcc GetDataAccess()
 {
     string SQL_TRUST = "Server=(ip);Integrated Security=SSPI;database=db;";
     string SQL_NOTRUST = "Data Source=ip;Initial Catalog=db; User ID=uid;Password=pwd;";
     string uid = this.txtUid.Text;
     string pwd = this.txtPwd.Text;
     string dbName = cboxDBName.SelectedItem != null ? cboxDBName.SelectedItem.ToString() : string.Empty;
     string server = txtServerIP.Text;
     Tcs.Libary.DataAccess da = new Tcs.Libary.DataAccess();
     if (dbName.Length == 0)
         dbName = "master";
     if (cboxTrust.Checked)
         da.ConnectionString = SQL_TRUST.Replace("ip", server).Replace("db", dbName);
     else
         da.ConnectionString = SQL_NOTRUST.Replace("ip", server).Replace("db", dbName).Replace("uid", uid).Replace("pwd", pwd);
     return da;
 }