private void FrmExportHistory_Load(object sender, EventArgs e)
        {
            string str = new IniConfigHelper().ReadIniData("已选曲线", "selectTrend", "", CommonMethods.FilePath);

            sqlArray = str.Split(',');
            if (sqlArray.Length == 1 && sqlArray[0] == "@")
            {
                return;
            }
            HeaderTextList.Add("日期时间");
            sqlString.Add("InsertTime");

            for (int i = 0; i < sqlArray.Length; i++)
            {
                HeaderTextList.Add(CommonMethods.TrendName[sqlArray[i]].Description);
                sqlString.Add((CommonMethods.TrendName[sqlArray[i]].Name));
            }



            for (int i = 0; i < HeaderTextList.Count; i++)
            {
                DataGridViewTextBoxColumn dgvc = new DataGridViewTextBoxColumn();
                dgvc.HeaderText       = HeaderTextList[i];
                dgvc.ReadOnly         = true;
                dgvc.Width            = 150;
                dgvc.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
                dgvc.DataPropertyName = sqlString[i];
                dgvc.Name             = sqlString[i];
                this.DgvExport.Columns.Add(dgvc);
            }

            //拼接SQL语句
            StringBuilder sb = new StringBuilder();

            sb.Append("select ");


            string str1 = string.Join(",", sqlString.ToArray());

            sb.Append(str1);


            sb.Append(" from TemperaTureMeasure where 1=1 and InsertTime between '{0}' and '{1}'");

            string sql = string.Format(sb.ToString(), dtpStart.Text.Trim(), dtpEnd.Text.Trim());

            DataTable dt = SQLHelper.GetDataSet(sql).Tables[0];


            //如何把DataTable赋值到DataGridView

            int index = this.DgvExport.Rows.Add();

            DgvExport.DataSource = null;
            DgvExport.DataSource = dt;
        }
        private void FrmHistoryTrend_Load(object sender, EventArgs e)
        {
            chartHistory.AxisX.MajorGridCount = 4;
            string str = new IniConfigHelper().ReadIniData("已选曲线", "selectTrend", "", CommonMethods.FilePath);

            chartHistory.DisplayPoints = Convert.ToInt32(new IniConfigHelper().ReadIniData("历史显示点数", "Points", "", CommonMethods.FilePath));

            sqlArray = str.Split(',');
            if (sqlArray.Length == 1 && sqlArray[0] == "@")
            {
                return;
            }


            for (int i = 0; i < sqlArray.Length; i++)
            {
                listParameter.Add(CommonMethods.TrendName[sqlArray[i]].Name);
            }
        }