title: how to connect directly to aspnetdb database
body: <p>I wanna connect to aspnetdb but it makes an error says "Login failed for user"
  this is the connection string in web config :</p>
  
  <pre><code>&lt;add name="UserProfiles" connectionString="Data Source=KIA;Initial Catalog=aspnetdb;Integrated Security=True;"
     providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p>and this is my code:</p>
  
  <pre><code>SqlConnection connection = new SqlConnection();
          SqlCommand ComNewCheckSum = new SqlCommand();
          connection.ConnectionString = ConfigurationManager.ConnectionStrings["UserProfiles"].ConnectionString;
          connection.Open();
  ComNewCheckSum.Connection = connection;
              ComNewCheckSum.CommandText = String.Format("select UserID from aspnet_Users where UserName = {0}", _UserName);
  
              return Convert.ToInt32(ComNewCheckSum.ExecuteScalar());
  </code></pre>
  
  <p>how can i pass through error? thank</p>