private void BindColor() { string sql = "select ColorNo,ColorName from tb_ColorInfo where fisstop = 0 "; ds = dbl.GetDatasetReport(sql, "tb_ColorInfo"); List <string> listArr = new List <string>(); if (ds != null) { if (ds.Tables.Count > 0) { cmbColor.DataSource = ds.Tables[0]; cmbColor.DisplayMember = "ColorName"; cmbColor.ValueMember = "ColorNo"; if (ds.Tables[0].Rows.Count > 0) { //this.lbgoods.Visible = true; //this.lbgoods.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { listArr.Add(ds.Tables[0].Rows[i][1].ToString()); //tbmodelno.Items.Add(ds.Tables[0].Rows[i][1].ToString()); } } string[] myarr = listArr.ToArray(); //cbgoods.AutoCompleteCustomSource.AddRange(myarr); //cbgoods.AutoCompleteSource = AutoCompleteSource.CustomSource; //cbgoods.AutoCompleteMode = AutoCompleteMode.SuggestAppend; cmbColor.AutoCompleteCustomSource.AddRange(myarr); cmbColor.AutoCompleteSource = AutoCompleteSource.CustomSource; cmbColor.AutoCompleteMode = AutoCompleteMode.SuggestAppend; } } }
private void frmBorrowReport_Load(object sender, EventArgs e) { ReportDocument rd = new ReportDocument(); rd.Load("LibraryReport1.rpt"); string strSql = "SELECT CardId,BookID,BookName,Author,Publisher,Price,BorrowDate,SpilthDay FROM Borrow"; Dblink db = new Dblink(); //以SQL语句为参数,产生一个Dataset DataSet dsTemp = db.GetDatasetReport(strSql, "Borrow"); DataTable dt = new DataTable(); dt = dsTemp.Tables[0]; rd.SetDataSource(dt); crystalReportViewer1.ReportSource = rd; }
public RoleComboxControl() { DataSet ds = new DataSet(); Dblink dbl = new Dblink(); string sql = "select FBaseID,FBaseName from tb_base where FClass = 'Role' order by FBaseID"; ds = dbl.GetDatasetReport(sql, "tb_base"); if (ds != null) { if (ds.Tables.Count > 0) { DataSource = ds.Tables[0]; DisplayMember = "FBaseName"; ValueMember = "FBaseID"; } } }
public WareComboxControl() { DataSet ds = new DataSet(); Dblink dbl = new Dblink(); string sql = "select WareID,WareName from tb_WareHouse order by WareID"; ds = dbl.GetDatasetReport(sql, "tb_base"); if (ds != null) { if (ds.Tables.Count > 0) { DataSource = ds.Tables[0]; DisplayMember = "WareName"; ValueMember = "WareID"; } } }
public ColorComboxControl() { DataSet ds = new DataSet(); Dblink dbl = new Dblink(); string sql = "select ColorNo,ColorName from tb_ColorInfo where fisstop = 0 order by ColorNo"; ds = dbl.GetDatasetReport(sql, "tb_base"); if (ds != null) { if (ds.Tables.Count > 0) { DataSource = ds.Tables[0]; DisplayMember = "ColorName"; ValueMember = "ColorNo"; } } }
public BaseGroupComboxControl() { DataSet ds = new DataSet(); Dblink dbl = new Dblink(); string sql = "select Groupid,Name from BaseGroup where isstop = 0 order by Groupid"; ds = dbl.GetDatasetReport(sql, "BaseGroup"); if (ds != null) { if (ds.Tables.Count > 0) { DataSource = ds.Tables[0]; DisplayMember = "Name"; ValueMember = "Groupid"; } } }
public static void SetCombox(string _class, ComboBoxEx _control) { DataSet ds = new DataSet(); Dblink dbl = new Dblink(); string sql = "select FBaseID,FBaseName from tb_base where FClass = '" + _class + "' order by FBaseID"; ds = dbl.GetDatasetReport(sql, "tb_base"); List <string> listArr = new List <string>(); if (ds != null) { if (ds.Tables.Count > 0) { _control.DataSource = ds.Tables[0]; _control.DisplayMember = "FBaseName"; _control.ValueMember = "FBaseID"; } } }
public static void SetGrpCombox(ComboBoxEx _control) { DataSet ds = new DataSet(); Dblink dbl = new Dblink(); string sql = "select GroupId,Name from BaseGroup where isstop = 0 order by GroupId"; ds = dbl.GetDatasetReport(sql, "BaseGroup"); List <string> listArr = new List <string>(); if (ds != null) { if (ds.Tables.Count > 0) { _control.DataSource = ds.Tables[0]; _control.DisplayMember = "Name"; _control.ValueMember = "GroupId"; } } }
public static void SetCombox(ComboBoxEx _control) { DataSet ds = new DataSet(); Dblink dbl = new Dblink(); string sql = "select EmpId,EmpName from tb_empinfo where Active= 1"; ds = dbl.GetDatasetReport(sql, "tb_EmpInfo"); List <string> listArr = new List <string>(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { _control.DataSource = ds.Tables[0]; _control.DisplayMember = "EmpName"; _control.ValueMember = "EmpId"; } } }