title: Cannot access public static method
body: <p>I have this class</p>
  
  <pre><code>#pragma once
  namespace CMT{
  namespace sql=System::Data::SqlClient;
  public ref class db
  {
  public:db(void){}
  public: static sql::SqlConnection SC(){
              System::String cstring="data source=192.168.0.139\\cedfit; "+
                  "initial catalog=cedfitdb; user id=client; password=cedfit";
              sql::SqlConnection sc=new sql::SqlConnection(cstring);
              return sc;
          }
  
  };
  }
  </code></pre>
  
  <p>Now when I go to my form 1 load event I cannot access my db's SC() method why?</p>
  
  <p>I also tried to make in the form1 load event this code:</p>
  
  <pre><code>System::Data::SqlConnection mycon=db::SC();
  mycon.Open();//I also tried mycon-&gt;Open() and mycon::Open()
  </code></pre>
  
  <p>Why it doesnt work? Why can't the program recognize the "Open()"?
  Also when I put <code>#include "db.h"</code> on the CMT.cpp it says that <code>cannot covert from System::Data::Sqlclient::SqlConnection to int</code>
  I am sure I am returning an SqlConnection but why?</p>