Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 184143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:14:25+00:00 2026-05-11T15:14:25+00:00

Using ASP.NET 2.0 SqlMembershipProvider with MSSQL 2005. To illustrate issue : 1) Create simple

  • 0

Using ASP.NET 2.0 SqlMembershipProvider with MSSQL 2005.

To illustrate issue :

1) Create simple ASP.NET app with a System.Web.UI.WebControls.Login control on a page. Change Web.config to use forms authentication and System.Web.Security.SqlMembershipProvider.

2) Run web app in browser and login. Close browser.

3) Using some SQL tool (like SQL Server Management Studio), run sp_who2 to see connections. Find SPID for connection used by the SqlMembershipProvider in step 2, and execute

kill <the found SPID> 

(Assumes connection pooling is used, which it is by default).

4) Rerun web app in browser. Try to login again. This time a SqlException like the following is raised:

[SqlException (0x80131904): A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)]    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186    System.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning() +13    System.Data.SqlClient.TdsParserStateObject.WriteSni() +682631    System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode) +265    System.Data.SqlClient.TdsParserStateObject.ExecuteFlush() +51    System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc) +4163    System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32    System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122    System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +62    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160    System.Web.UI.WebControls.Login.AttemptLogin() +105    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746 

Now, I understand why this is happening – i.e. its due to a pooled connection which has been killed, and is thus invalid when the Login control tries to reuse. The ‘kill’ session command is performed in step 3 to simulate what would happen, for example, when you need to restore a database. You would need to kill all connections to a DB before being able to restore it.

Forcing the web app to restart after the kill command also solves it, but I’m wondering if there is a relatively painless way to make the Login process more robust. It would be ideal if somehow, I could catch this exception during the authentication process, and retry the login (since ADO.NET seems to clear the connection pool after a failure like this occurs, I think the retry would work).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:14:25+00:00Added an answer on May 11, 2026 at 3:14 pm

    You could possiblly create a new Login control that inherits the asp:login control then override the ValidateUser method, much like:

    public override bool ValidateUser(string strName, string strPassword) {         bool boolReturn = false;      UserProvider oUserProvider = new UserProvider();     User oUser = oUserProvider.FindUser(strName);      if (oUser == null)         return boolReturn;      boolReturn = oUser.ValidateUsersPasswordForLogon(strPassword);      return boolReturn; }  

    Then put a try/catch around the Creation of the User class (catching an SqlException) then retrying the connection?

    I havnt done too much work with the aspnet membership classes so im not too sure

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm fairly sure that standard Flash projectors can not do… May 12, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer String computername=InetAddress.getLocalHost().getHostName(); System.out.println(computername); May 12, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer You want to look up boxing/unboxing. Boxing May 12, 2026 at 12:09 am

Related Questions

I'm designing an ASP.NET application that must support 'SubSites'. The idea is to have
I know how to create users and assign them to roles etc, but when
How can I implement single sign on across domains? I have two or more
Using ASP.net 2.0, how do I present the information to the user similar to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.