title: sql server compact sdf file within c# project - problems with SQLException
body: <p>This question is related to this previous <a href="https://stackoverflow.com/questions/10961348/very-simple-c-sharp-program-generates-a-nullreferenceexception-was-unhandled-e#comment14310238_10961348">SO question</a></p>
  
  <p>I have fixed the string used in the program so it now runs that line of code.</p>
  
  <p>Why does the following fail on the line <code>myAdapt.Fill(mySet, "AvailableValues");</code> with a error <code>SQLException was Unhandled; A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections</code></p>
  
  <p>The database is part of the project so why should there be difficulties connecting? </p>
  
  <ul>
  <li>I've tried running the sql string in a sql file and it runs ok. </li>
  <li><p>I've tried deleting all columns from the DGV.</p>
  
  <pre><code>void PopulateGridView()
  {
      SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseDGVexperiments.Properties.Settings.DatabaseDGVexperimentsConnStg"].ConnectionString);
      SqlDataAdapter myAdapt = new SqlDataAdapter("SELECT refText FROM helloworld", conn);
      DataSet mySet = new DataSet();
      myAdapt.Fill(mySet, "AvailableValues");
      DataTable myTable = mySet.Tables["AvailableValues"];
      this.uxExperimentDGV.DataSource = myTable;
  }
  </code></pre></li>
  </ul>