title: SQL database connection failure in another computer through |DataDirectory|
body: <p>I have a database and a server application and everything works fine while I'm running it on my computer.</p>
  
  <pre><code>string ConnectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename='|DataDirectory|\Fabrica.mdf';Integrated Security=True;Connect Timeout=30";
  </code></pre>
  
  <p>The problem is: I have to run this application in another computer and the database must be there as well, when the server application tries to access the database it returns nothing. Is it a problem with the authentication? File path?</p>
  
  <p>@Edit: here's how I'm accessing the tables:</p>
  
  <pre><code>SqlConnection con = new SqlConnection(ConnectionString);
  SqlCommand cmd = new SqlCommand();
  cmd.Connection = con;
  cmd.CommandType = CommandType.Text;
  cmd.CommandText = String.Format("SELECT * FROM {0}", Table);
  string name;
  SqlDataReader reader;
  try
  {
      con.Open();
      reader = cmd.ExecuteReader();
      while (reader.Read())
      {
          name = reader["Name"].ToString();
      }
      con.Close();
  }
  catch (Exception e)
  {
      MessageBox.Show(e.ToString());
  }
  </code></pre>
  
  <p>@Edit: I don't know if this helps but I have SQL Server LocalDB and SQL Server Express installed in the other computer.</p>