Re: sql connection errors as usage increases
From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 08/24/04
- Next message: Michael D. Long: "Re: ASP.Net bug when inserting Blobs?"
- Previous message: William \(Bill\) Vaughn: "Re: ADO - Copy Data from one data source to another via VB6"
- In reply to: kkres: "sql connection errors as usage increases"
- Next in thread: Doug Stoltz: "Re: sql connection errors as usage increases"
- Reply: Doug Stoltz: "Re: sql connection errors as usage increases"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Aug 2004 14:37:37 -0700
I suspect that you have a hole in your logic that permits a connection to be
opened but not closed as you suspect.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"kkres" <kkres@discussions.microsoft.com> wrote in message
news:9F344E8F-A6E8-46D1-BEDF-B33A97590C47@microsoft.com...
>I own an ASP .NET application that uses ADO.NET to manage SQLConnections to
>a
> SQL Srvr 2000 database. Until recently the app has been working fine
> (with a very small number of users). But in recent weeks number of users
> has
> dramatically increased, and now the site is reporting this frequent error:
>
> System.InvalidOperationException: Not allowed to change the
> 'ConnectionString'
> property while the connection (state=Open). at
> System.Data.SqlClient.SqlConnection.set_ConnectionString(Stringvalue)
> at ... in ...basApplication.vb:line 89
>
> It occurs as the user login and the app is creating 2 connections strings
> for use during the user's session. The code in question is essentially:
>
> Public gobjConn As New
> SqlClient.SqlConnection(ConfigurationSettings.AppSettings("dsn"))
> Public gobjConn2 As New
> SqlClient.SqlConnection(ConfigurationSettings.AppSettings("dsn"))
> -
> -
> gobjConn.Close()
> gobjConn2.Close()
> -
> -
> gobjConn.ConnectionString = strDataSource & strDataBase & "UID=fred;" &
> "PWD=xyz;"
> gobjConn2.ConnectionString = strDataSource & strDataBase & "UID=fred;"
> &
> "PWD=xyz;" (line 89)
>
> gobjConn.Open()
> gobjConn2.Open()
>
> The connection strings are identical (same server and db) and exactly the
> same (same login and pw) for all users.
>
> I had thought that the Close operations before the Opens would always
> assure
> that no connection would ever be left open.
>
> This site has been able to live with the problem by regularly restarting
> IIS.
>
> What am I missing?
>
> Thanks,
> --
> kkres
- Next message: Michael D. Long: "Re: ASP.Net bug when inserting Blobs?"
- Previous message: William \(Bill\) Vaughn: "Re: ADO - Copy Data from one data source to another via VB6"
- In reply to: kkres: "sql connection errors as usage increases"
- Next in thread: Doug Stoltz: "Re: sql connection errors as usage increases"
- Reply: Doug Stoltz: "Re: sql connection errors as usage increases"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|