Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Graceful way to validate user login to SQL Server 2000 and 2005

Back to Forum: Tech Off
  • User profile image

      Trying to open a SqlConnection in a try..catch block and capturing the SqlException if the login fails is a way to validate sql login. The problem with this method that we're running into is that the SqlConnection object is pooled. That is, if I change password for a sql login then we've run into a scenario where the both the old and the new password allow us to connect to the database. This is bad.

    Is there a more graceful method of validating login on both sql 2000/2005?


  • User profile image

    ADO.NET has pooling turned on by default... You have to disable this feature.

    SO in essence you have your connection being pooled so your old login is still there in a sense.

    Check on Connection Pooling on MSDN.

  • User profile image

        Yes, after I set the Pooling = false on the connection string, the problem was resolved. Thanks!

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.