title: Removing Local Databases and Membership provider from asp.net login control
body: <p>i have used Visual Studio Default Website to create a Application.it's working fine in local machine but when i host it on server iis.it gives the error</p>
  
  <pre><code>Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
  </code></pre>
  
  <p>in my database there is no such sp and also i don't want to use membership provider.so i tried to remove local connections from web.config but still no luck.</p>
  
  <pre><code>&lt;remove name="LocalSqlServer" /&gt;
          &lt;clear /&gt;
          &lt;add name="LocalSqlServer" connectionString="Data Source=GGT\NNY;Initial Catalog=VersionControl;User ID=sa;Password=123" providerName="System.Data.SqlClient"/&gt;
  
  
          &lt;add name="ConVersionControl" connectionString="Data Source=GGT\NNY;Initial Catalog=VersionControl;User ID=sa;Password=123" providerName="System.Data.SqlClient"/&gt;
  </code></pre>
  
  <blockquote>
    <p>ConVersionControl</p>
  </blockquote>
  
  <p>is the connection i'm using in my application</p>
  
  <p>following is the code i'm using for the loggin</p>
  
  <pre><code>protected void LoginButton_Click(object sender, EventArgs e)
      {
          try
          {
              dtUserDetails = new DataTable();
              if (UserRepositoryBL.ValidateUser(LoginUser.UserName.Trim(), LoginUser.Password.Trim(), out dtUserDetails))
              {
  
                  AuthUser au = new AuthUser();
                  if (dtUserDetails.Rows.Count &gt; 0)
                  {
                      DataRow DR = dtUserDetails.Rows[0];
                      au.UserID = Convert.ToInt32(DR["UserID"].ToString());
                      au.UserNo = DR["UserNo"].ToString();
                      au.UserName = DR["UserName"].ToString();
                      au.Password = DR["Password"].ToString();
                  }
                  string userData = au.ToString();
                  FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
  
               1,                             // Version number
  
               LoginUser.UserName.Trim(),      // Username
  
               DateTime.Now,                  // Issue date
  
               DateTime.Now.AddMinutes(60), // Expiration date
  
               false,                         // Persistent?
  
               userData                 // User data
  
           );
  
  
  
                  string eticket = FormsAuthentication.Encrypt(ticket);
  
                  HttpCookie cookie = new HttpCookie
  
                       (FormsAuthentication.FormsCookieName, eticket);
  
                  Response.Cookies.Add(cookie);
  
  
                  BasePage.ActivityLog("User Login", LoginUser.UserName.Trim(), true, Request.RawUrl);
                  string url = FormsAuthentication.GetRedirectUrl(LoginUser.UserName, false);
  
                  Response.Redirect(url);
  
  
  
              }
              else
              {
                  LoginUser.FailureText = "Your login attempt was not successful. Please try again.";
              }
  
          }
          catch (Exception ex)
          {
              throw ex;
          }
      }
  </code></pre>
  
  <blockquote>
    <p>please note that application works fine for a successful login.above
    error only appears when i try to use invalid username or a password to
    login</p>
  </blockquote>