Problem in variable declaration
<p>On page load i am setting the value of String variable <code>DB</code> as follows:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
     String DB = "";
     DB = Session["db"].ToString();
    }
}
</code></pre>

<p>I want to use the variable <code>DB</code> (i want to pass this value to a method <code>getpet()</code>) in another method which is:</p>

<pre><code>protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
    if(DropDownList2.SelectedItem.Text=="0")
    {
         petres d = new petres();
         String petitioner=d.getpet();
    }
}
</code></pre>

<p>How can i use a variable declared in one method, in another method?</p>
