Unanswered: retrieve data from db with combobox selected value
My q is, In a vb .net form i have 1combobox(EMpid),textbox1(empName), textbox2(EMpdetail) with SQL Server Db as empdetails (it contain EMpid,empName,EMpdetail) from the table i have to bind the data in combobox
with the help of code below..
dim con as new sqlconnection(...............)
dim da as new sqldataadapter
dim ds as new dataset
dim cmd as new sqlcommand
dim dt as new datatable
da= new sqldataadapter("select *from empdetails ",con)
thro the above code i will bind the empid in combobox
my q is..
If i select one particular empid value in combobox then it should display the respective empName in txtbox1 ,EMpdetail in txtbox2 if it doesnt available any data in db then i will enter new data respective txtboxes and that should be added in db with the help of button event.