title: How to use Sql connection inside another connection?
body: <p>I faced some problem about sql connection issue. The problem is I have some code like this</p>
  
  <pre><code>function1()
  {
      using (sqlconnection sc = new sqlconnection())
     {
        foo();
     }
  }
  
  foo is a function like below:
  foo()
  {
     using (sqlconnection sc = new sqlconnection())
    {
          dosomething;
    }
  }
  </code></pre>
  
  <p>It seems that the sqlconnection in foo() cannot work. I'm wondering if it is a good idea to pass the sqlconnection into foo like foo(sc), or is it a good idea to take foo outside function1, or is there anyway to allow the sqlconnection inside foo works. </p>