title: Connect local database mdf Visual Studio
body: <p>I have created a mdf database from visual studio 2013 and stored some informations in the table.</p>
  
  <p>My problem is I can`t connect to my local database and select informations from table.
  This is my code for connect:</p>
  
  <pre><code>string con = "Data Source=intrebari.mdf;Integrated Security=True;";
  
  string queryString = "Select * FROM dbo.intrebari"; //update as you feel fit of course for insert/update etc
  
  using (SqlConnection connection = new SqlConnection(con))
  {
      connection.Open();
      SqlDataAdapter adapter = new SqlDataAdapter();
      SqlCommand command = new SqlCommand(queryString, connection);
  
      command.ExecuteNonQuery();
  
      data = new DataSet();
      adapter.Fill(data);
      MessageBox.Show(data.ToString());
  
      connection.Close();
  }
  </code></pre>
  
  <p>And the error: </p>
  
  <blockquote>
    <p>A network-related or instance-specific error occurred while establishing a connection to SQL Server.</p>
  </blockquote>
  
  <p>I already unblocked 1433 port with firewall but no succes. Here is a print to my visual studio work.</p>
  
  <p><a href="http://imgur.com/CwfrWwo" rel="nofollow">http://imgur.com/CwfrWwo</a></p>