private void button4_Click(object sender, EventArgs e) { gk018 frmgk018 = new gk018(); frmgk018.FormBorderStyle = FormBorderStyle.FixedSingle; //固定窗体大小不变 frmgk018.StartPosition = FormStartPosition.CenterScreen; //窗体居中 frmgk018.ShowDialog(); }
private void button3_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow == null) { MessageBox.Show("请点击行头选择数据!"); return; } DataGridViewRow dgvr = dataGridView1.CurrentRow; //获取项目名称值 string strXmmc = dgvr.Cells["所属复垦项目名称"].Value.ToString(); string strJx = dgvr.Cells["建新文件名称"].Value.ToString(); sqlQuery.Clear(); sqlQuery.Append("SELECT XMSZ AS 项目所在省,"); sqlQuery.Append(" XMSZS AS 项目所在市,"); sqlQuery.Append(" XMSZX AS 项目所在县,"); sqlQuery.Append(" XMMC AS 所属复垦项目名称,"); sqlQuery.Append(" PZWH AS 批准文号,"); sqlQuery.Append(" JXWJMC AS 建新文件名称,"); sqlQuery.Append(" FHGH AS 符合土地利用规划,"); sqlQuery.Append(" PZSJ AS 实际批准建新规模批准时间,"); sqlQuery.Append(" PZGM AS 实际批准建新规模,"); sqlQuery.Append(" JXZYGDMJ AS 建新占用耕地面积,"); sqlQuery.Append(" ZSZMJ AS 征收总面积,"); sqlQuery.Append(" ZSZFY AS 征收总费用,"); sqlQuery.Append(" AZZRK AS 安置总人口,"); sqlQuery.Append(" LDLRK AS 劳动力人口,"); sqlQuery.Append(" ZYZMJ AS 占用总面积,"); sqlQuery.Append(" ZYGDMJ AS 占用耕地面积,"); sqlQuery.Append(" ZYGDZL AS 占用耕地质量,"); sqlQuery.Append(" NCAZZF AS 农村安置住房,"); sqlQuery.Append(" FNYFZYD AS 非农业发展用地,"); sqlQuery.Append(" PTSS AS 农村占地,"); sqlQuery.Append(" QTJSYDNC AS 其他建设用地农村,"); sqlQuery.Append(" SFYD AS 商服用地,"); sqlQuery.Append(" GKCC AS 工矿仓储,"); sqlQuery.Append(" ZZYD AS 住宅用地,"); sqlQuery.Append(" QTJSYDCZ AS 其他建设用地城镇,"); sqlQuery.Append(" PCH AS 批次号,"); sqlQuery.Append(" INSERT_TIME AS 记录插入时间 "); sqlQuery.Append("FROM JXXM "); sqlQuery.Append("WHERE XMMC='" + strXmmc + "'"); sqlQuery.Append(" AND JXWJMC='" + strJx + "'"); gkfqd.Common.DbUse.GetOleDbconnection().Close(); gkfqd.Common.DbUse.GetOleDbconnection().Open(); dataSet6.Clear(); OleDbDataAdapter MyAdapter = new OleDbDataAdapter(sqlQuery.ToString(), gkfqd.Common.DbUse.GetOleDbconnection()); MyAdapter.Fill(dataSet6); gkfqd.Common.DbUse.GetOleDbconnection().Close(); //dataSet5.Tables[0].Rows[0]["药物名"].ToString(); gk018 frmgk018 = new gk018(dataSet6.Tables[0]); frmgk018.FormBorderStyle = FormBorderStyle.FixedSingle; //固定窗体大小不变 frmgk018.StartPosition = FormStartPosition.CenterScreen; //窗体居中 frmgk018.ShowDialog(); }