c# accessing string from method1 in method2, after method1's execution
<p>I'm working on a form with one textbox, one button, one combobox and a couple of other textboxes.</p>

<p>So, I want this winforms program to work as follows:<br>
1) you fill in a database index value in textbox1 (example: 22222)<br>
2) you click the button. This button goes to the database, looks up the value in textbox1 and eventually creates a string based on what the database returns. (example: returned value = super; string value = 5)<br>
3) After you've clicked the button, you should be able to fill in the other textboxes <strong>depending on the SelectedIndex</strong> of the combobox. The values filled in in the combobox are completely dependant on the value of the string generated by button1. (example: combobox1 selectedindex = 1: textbox2.text = S; combobox selectedIndex = 2: textbox3.text = U)</p>

<p>So, basically, button1 must first be executed before combobox1 can even begin to execute itself. Also note that there are (at least) two methods used here: a void for button1_click and a void for combobox1_selectedindexchanged.</p>

<p>The two first parts are done. What I'm having trouble with is accessing the string generated by button1, which is only accessible after its execution, and using it in combobox1's method.</p>

<p>Is this possible?</p>