public void BinData(string strWhere) { try { DATA0035BLL bll = new DATA0035BLL(Frm.DBConnection); string s_SQL; DataTable tb_GridView1; tb_GridView1 = new DataTable(); tb_GridView1.Columns.Add("rkey"); tb_GridView1.Columns.Add("指令代码"); tb_GridView1.Columns.Add("指令1"); tb_GridView1.Columns.Add("指令2"); tb_GridView1.Columns.Add("指令3"); tb_GridView1.Columns.Add("指令4"); s_SQL = @" select Data0036.RKEY as rkey, Data0036.INST_CODE as 指令代码, Data0036.PROD_ROUT_INST_1 as 指令1, Data0036.PROD_ROUT_INST_2 as 指令2, Data0036.PROD_ROUT_INST_3 as 指令3, Data0036.PROD_ROUT_INST_4 as 指令4 from data0036 with (nolock) where (1=1) AND (" + strWhere + @") order by Data0036.INST_CODE "; tb_GridView1 = bll.getDataSet(s_SQL); tb_GridView1 = tb_GridView1.DefaultView.ToTable(); //dataGridView1.Columns.Clear(); Frm.dataGridView1.DataSource = tb_GridView1; Frm.dataGridView1.Columns[0].Visible = false; Frm.dataGridView1.Columns[1].Width = 100; Frm.dataGridView1.Columns[1].ReadOnly = true; Frm.dataGridView1.Columns[2].Width = 200; Frm.dataGridView1.Columns[2].ReadOnly = true; Frm.dataGridView1.Columns[3].Width = 200; Frm.dataGridView1.Columns[3].ReadOnly = true; Frm.dataGridView1.Columns[4].Width = 200; Frm.dataGridView1.Columns[4].ReadOnly = true; Frm.dataGridView1.Columns[5].Width = 200; Frm.dataGridView1.Columns[5].ReadOnly = true; } catch (Exception e1) { log.PrintInfo(e1); return; } }
public void BinData(string strWhere) { try { DATA0035BLL bll = new DATA0035BLL(Frm.DBConnection); string s_SQL; DataTable tb_GridView1; tb_GridView1 = new DataTable(); tb_GridView1.Columns.Add("rkey"); tb_GridView1.Columns.Add("参数代码"); tb_GridView1.Columns.Add("参数名称"); tb_GridView1.Columns.Add("PARAMETER_VALUE"); s_SQL = @" select Data0469.RKEY as rkey, rtrim(Data0469.PARAMETER_CODE) as 参数代码, rtrim(Data0469.PARAMETER_DESC) as 参数名称, rtrim(Data0469.PARAMETER_VALUE) as PARAMETER_VALUE from Data0469 with (nolock) where (Data0469.ACTIVE_FLAG = 0 OR Data0469.ACTIVE_FLAG IS NULL) AND (" + strWhere + @") order by Data0469.PARAMETER_CODE "; tb_GridView1 = bll.getDataSet(s_SQL); tb_GridView1 = tb_GridView1.DefaultView.ToTable(); //dataGridView1.Columns.Clear(); Frm.dataGridView1.DataSource = tb_GridView1; Frm.dataGridView1.Columns[0].Visible = false; Frm.dataGridView1.Columns[1].Width = 100; Frm.dataGridView1.Columns[1].ReadOnly = true; Frm.dataGridView1.Columns[2].Width = 200; Frm.dataGridView1.Columns[2].ReadOnly = true; Frm.dataGridView1.Columns[3].Visible = false; } catch (Exception e1) { log.PrintInfo(e1); return; } }
public void BinData(string strWhere) { try { DATA0035BLL bll = new DATA0035BLL(Frm.DBConnection); string s_SQL; DataTable tb_GridView1; tb_GridView1 = new DataTable(); tb_GridView1.Columns.Add("rkey"); tb_GridView1.Columns.Add("参数代码"); s_SQL = @" select rkey, rtrim(PRODUCTION_PARAMETER) as 参数代码 from data0035 with (nolock) where (1=1) AND (" + strWhere + @") order by data0035.rkey "; tb_GridView1 = bll.getDataSet(s_SQL); tb_GridView1 = tb_GridView1.DefaultView.ToTable(); //dataGridView1.Columns.Clear(); Frm.dataGridView1.DataSource = tb_GridView1; Frm.dataGridView1.Columns[0].Visible = false; Frm.dataGridView1.Columns[1].Width = 270; Frm.dataGridView1.Columns[1].ReadOnly = true; } catch (Exception e1) { log.PrintInfo(e1); return; } }