2011年2月23日 星期三

ODA與ITEM

/*------------------------------------------------------------------
OracleDataAdapter:SQL指令執行新增、刪除、查詢、修改物件
ds_StockTrxns:DataSet,利用OracleDataAdapter.Fill儲放資料至DataSet資料表
ds_StockTrxns.HOLDER_STOCK_EXC_ACC_ALL.Clear():清除所有資料
cmb_ExcAcc:下拉式選單
cmb_ExcAcc.DataSource:設定資料表來源
cmb_ExcAcc.DisplayMember:下拉式選單顯示欄位SelectedItem取值
cmb_ExcAcc.ValueMember:下拉式選單欄位值,可用SelectedValue取值
------------------------------------------------------------------*/
private void cmb_ExcAcc_MouseEnter(object sender, EventArgs e)
{
try
{
//20110223 jenny xxxx
if (TrxTypeCode == "xxxx" && txt_HolderNumQ.Text.Trim() != "")
{
string strExcAcc = @"SELECT EXC.* FROM STOCKSEEC.HOLDER_STOCK_EXC_ACC_ALL EXC,STOCKSEEC.HOLDERS_ALL HA WHERE EXC.STOCK_HOLDER_ID = HA.STOCK_HOLDER_ID AND HA.HOLDER_NUMBER =" + txt_HolderNumQ.Text.Trim() + " AND EXC.END_DATE IS NULL AND HA.END_DATE IS NULL";
OracleDataAdapter odaExcAcc = new OracleDataAdapter(strExcAcc, oc_Stock);
odaExcAcc.Fill(ds_StockTrxns.HOLDER_STOCK_EXC_ACC_ALL);
cmb_ExcAcc.DataSource = ds_StockTrxns.HOLDER_STOCK_EXC_ACC_ALL;
cmb_ExcAcc.DisplayMember = ds_StockTrxns.HOLDER_STOCK_EXC_ACC_ALL.Columns["STOCK_EXCHANGE_ACCOUNT_NUMBER"].ToString();
cmb_ExcAcc.ValueMember = ds_StockTrxns.HOLDER_STOCK_EXC_ACC_ALL.Columns["STOCK_EXC_ID"].ToString();
cmb_ExcAcc.Refresh();

}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

沒有留言:

張貼留言