title: Error trying to execute sql from inside SQL CLR
body: <p>I have the following code:</p>
  
  <pre><code>[SqlFunction(DataAccess = DataAccessKind.Read, SystemDataAccess = SystemDataAccessKind.Read)]
      public static int GetInt()
      {
          int retValue = 0;
          using (SqlConnection conn = new SqlConnection("context connection = true"))
          {
              conn.Open();
              SqlCommand cmd = conn.CreateCommand();
              cmd.CommandText = "select MyInt from SomeTable";
              object timeOut = cmd.ExecuteReader(); // &lt;- error happen here
  
          }
          return retValue;
  
      }
  </code></pre>
  
  <p>I get the following exception in </p>
  
  <pre><code>cmd.ExecuteReader();
  </code></pre>
  
  <blockquote>
    <p>{"This statement has attempted to access data whose access is restricted by the assembly."}</p>
  </blockquote>