//Load BankName private void LoadBankName() { SqlConnection con; SqlCommand cmd; string sqlQuery = null; oTransactionDAL = new TransactionDAL(); DataTable dt = new DataTable(); Condition = ""; if (getValue == "Branch Admin" && division == "Branch Admin") { sqlQuery = "SELECT TOP 1 0 BANK_ID, 'All Item' BANK_NAME FROM ISS_BANK_INFO ORDER BY BANK_NAME"; con = oConnectionDatabase.DatabaseConnection(); cmd = new SqlCommand(sqlQuery, con); cmd.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(cmd); try { da.Fill(dt); } catch { } con.Close(); } else { dt = oTransactionDAL.Bank_Name(Condition); } drpBankName.DataSource = dt; drpBankName.DataTextField = "BANK_NAME"; drpBankName.DataValueField = "BANK_ID"; drpBankName.DataBind(); }
//Load BankName private void LoadBankName() { oTransactionDAL = new TransactionDAL(); Condition = ""; DataTable dt = oTransactionDAL.Bank_Name(Condition); drpBankName.DataSource = dt; drpBankName.DataTextField = "BANK_NAME"; drpBankName.DataValueField = "BANK_ID"; drpBankName.DataBind(); }