验证中...
Languages: C#
Categories: 桌面应用界面
Latest update 2019-06-24 10:41
ComboBox 的赋值 -c#-sql
Raw Copy
private void AssetCodePrint_Load(object sender, EventArgs e)
{
//this._dtRq1.Text = DateTime.Now.ToString("yyyy-01-01");
dataGridView1.AutoGenerateColumns = false;
LoadCmb(this._cmb资产群组, SqlDb.ExecuteDt(string.Format("SELECT GroupCode,Description FROM Erp.FAGroup WHERE Company='{0}' ORDER BY Description collate Chinese_PRC_CI_AS", MyData.Session.CompanyID)), "GroupCode", "Description");
LoadCmb(this._cmb资产分类, SqlDb.ExecuteDt(string.Format("SELECT JCDept,Description FROM JCDept WHERE Company='{0}' ORDER BY Description collate Chinese_PRC_CI_AS", MyData.Session.CompanyID)), "JCDept", "Description");
if (strAssetNum.Trim() != "")
{
this._txt资产编号.Text = strAssetNum;
btnFind_Click(null, null);
this.chkAll.Checked = true;
btnPrint_Click(null, null);
}
this.Icon = new Icon(Application.StartupPath + @"\epicor.ico", 16, 16);
}
private void LoadCmb(ComboBox combo, DataTable CmbData, string ValueMember, string DisplayMember)
{
combo.DataSource = CmbData;
combo.ValueMember = ValueMember;
combo.DisplayMember = DisplayMember;
combo.SelectedIndex = -1;
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search