c# - when i press the button combobox value is not displaying -


Using C # and so on; Mysql

I have combobox & amp; The button in my webpage, if I select a value from combobox, then I will click the refresh button on the page, the combobox value is changing.

For example

  Cabbox value: 1, 2, 3, 4 ..... If I select 2, then I will press the button, the webpage is refreshed , Combobox value: 1, 2, 3, 4 is displayed .... Cambodia should display 2 combo box while displaying a selected value when I press the button  
< P> Table name: User

  Username 1 Ravi 2 Ram 3 Kumar 4 ...,  

Click on the button Event Code

  cmd1 = New ODBC Commands ("Choose username where username = '" + combobox 1. item [combobox 1. selected index]. Text + "'", DBCN); Dr1 = cmd1.ExecuteReader (); While (dr1. Read ()) {textbox1.Text = dr1.GetString (0); } Dr1.Close (); Code above is working, but if I select value 2 from the combobox, then I would like to display Ravi by pressing the press button, but the text box is displaying the King. , And Cambodia is also refreshing, is not displaying 1 instead of combobox 2. 

How to solve this problem.

C # code need help

can be a useful read. Generally, you need to store any values ​​entered and restore them to page loads.

Given the fact that the button is reloading the entire page, will not it be more efficient to reload only one part of it instead?


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -