In my windows form i have two combobox and one text box when a jobecode is selected from cmbjobecode it will load cmbquotationcode with corresponding quotations and fills a textbox txtamount with amount of selected quotation
all is fine except i cannot get the textbox filled with the amount can anyone help in sorting mistake
private void cmbjobcode_SelectedIndexChanged(object sender, EventArgs e)
{
comboQuotationboxload();
}
public void comboQuotationboxload()
{
OleDbConnection oleDbConnection1 = new System.Data.OleDb.OleDbConnection(connString);
oleDbConnection1.Open();
OleDbCommand oleDbCommand1 = new System.Data.OleDb.OleDbCommand("Select quotationpk ,quotationcode , amount from quotationmastertable where jobpk = " + cmbjobcode.SelectedValue + "", oleDbConnection1);
OleDbDataReader reader = oleDbCommand1.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("quotationpk", typeof(int));
dt.Columns.Add("quotationcode", typeof(string));
dt.Columns.Add("amount", typeof(int));
dt.Load(reader);
cmbQuotationcode.ValueMember = "quotationpk";
cmbQuotationcode.DisplayMember = "quotationcode";
cmbQuotationcode.DataSource = dt.DefaultView;
txtamount.text= "amount";
oleDbConnection1.Close();
}
create dt at class scope
DataTable dt = new DataTable();
/// Add columns to Table at Form_Load()
//Then do fill operation
//filter data and display in the text box