title: The user instance login flag is not allowed when connecting to a user instance of SQL Server. The connection will be closed
body: <p>im working in Visual Studios 2013 and making a basic website. Im trying to make a simple sign up page with first name, last name, and id. Each time I try to connect to the database, I get this message: </p>
  
  <blockquote>
    <p>An exception of type 'System.Data.SqlClient.SqlException' occurred in<br>
    System.Data.dll but was not handled in user code </p>
  </blockquote>
  
  <p>My sql command is:<br>
  <code>string sql = "insert into mytable(fname, lname, id) values('" + fname + "','" + lname + "','" + id + "')";
  string filename = "Database.mdf";
  MyAdoHelper.DoQuery(filename, sql);
  </code></p>
  
  <p>In the <em>MyAdoHelper</em> class the fucntion <em>DoQuery</em> is this:</p>
  
  <pre><code>public static void  DoQuery(string fileName, string sql)
  
  {
  
      SqlConnection conn = ConnectToDb(fileName);
      conn.Open();
      SqlCommand com = new SqlCommand(sql, conn);
      com.ExecuteNonQuery();
      com.Dispose();
      conn.Close();
  
  }
  </code></pre>
  
  <p>Does anyone know why?</p>