I have a problem in getting data in a textbox from a query, actually its like getting Item_code from Inventory table and the corresponding Unit_Price from related table Inventory_Price
If i write a constant value of Item_Price in the query, the textbox shows the corresponding Unit_Price...
Code:
sql = "Select Unit_Price from Inventory_Price where Item_Code = '10001' AND Ending_Date is null"
da= New OleDB.OleDBDataAdapter(sql, connection)
da.fill(ds, "Inventory_Price")
Me.Txt_UnitPrice.DataBindings.Add(New Binding("Text", ds, "Inventory_Price.Unit_Price))
This code runs correctly....
But i want this....
sql = "Select Unit_Price from Inventory_Price where ITem_Code = '" & combobox.text & "' And Ending_Date is null"
da= New OleDB.OleDBDataAdapter(sql, connection)
da.fill(ds, "Inventory_Price")
Me.Txt_UnitPrice.DataBindings.Add(New Binding("Text", ds, "Inventory_Price.Unit_Price))
Combobox is bind correctly, the list of values are shown in the combobox....