private void btnStat_Click(object sender, EventArgs e) { int viewType = cboViewType.SelectedIndex; DateTime dateBegin = Convert.ToDateTime(dtpFrom.Value.ToString("yyyy-MM-dd") + " 00:00:00"); DateTime dateEnd = Convert.ToDateTime(dtpEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59"); DataSet dsData = ReportClass.GetRegisterReport(viewType, dateBegin, dateEnd); dgvList.AutoGenerateColumns = false; dgvList.DataSource = dsData.Tables["TB_A"]; plGraph.Tag = dsData.Tables["TB_B"]; ShowGraph( ); }