Showing posts with label console. Show all posts
Showing posts with label console. Show all posts

Sunday, March 25, 2012

Connection pools constantly grow

I've got a little console app that basically pulls back a recordset from our SQL Server 2005, goes through each row in the dataset and may/may not insert a record into a different table in the database. We use sproc's for every transaction and I close every connection in the application. However, when the application ends, I still show connection pools open in the performance monitor. Same with websites that I know have no traffic or that have been stopped by me in IIS.

Last night I showed a total of 6000+ "Current # pooled and nonpooled connections". Should I be worried about what seems to be unending growth in the connection pools? If so, how can I look to manage this better?

Check the following article:

http://www.15seconds.com/Issue/040830.htm

Regards

|||

I actually read that article yesterday.

Perhaps I'm dealing with a connection leak. If so, I don't know how. All my transactions are either handled via:

Try SqlConnection.Open() SqlCommand.ExecuteNonQuery()Finally SqlConnection.Close()End Try

Or

Try SqlDataAdapter.Fill(DataSet,"Results")
Finally
If SqlConnection.State = ConnectionState.OpenThen SqlConnection.Close()End If
End Try

My program uses two databases, which means that there are two connections strings. That accounts for the reason the program creates 2 connection pools when it runs, but why aren't those pools closed when the program finishes? Next time the program runs, it's increased by 2 again.

sqlsql

Monday, March 19, 2012

Connection issue with Management Console

When i try to connect to Integration Services on a SQL 2005 Machine, it Gives me a Class not registeed.

But i can connect to SQL 2008 Integration Services without a issue.

I tried Restarting the 2008 machine and Also Reinstalling the SSIS Piece and also Reinstalled SQL 2008, but nothing seems to Help.

Could you provide more details? Do you have SQL 2005 and SQL 2008 installed on the same machine?

Thanks,

Bob

|||

No, I dont

I Just Have SQL 2008 July CTP installed on a Windows Xp SP2 MAchine and I try to connect to another SQL Server 2005 Server (Integration Services)

I am Even Having Trouble opening the Maintenance Plan in SQL 2008.

|||

Hi there,

In the July CTP you can not connect to a 2005 SSIS service through 2008 Management Studio. To manage a 2005 SSIS service, you'll need to use the 2005 version of SSMS.

We're currently investigating ways to resolve this issue, but it's unclear whether we'll be able to solve this for the 2008 release.

~Matt

Tuesday, February 14, 2012

Connecting To SQLExpress From a VB Console Application

I've been reading through the forums and I have seen that I am not the only person to have trouble simply trying to connect to a database from VB.

Firstly I have created a console application, and from within that application I have created a simple 1 table database and added two rows of data. So I now the database is there and working.

Problem is I keep getting the following error which trying to apply a connection string to an SQLConnection object:

Message: "ExecuteReader requires an open and available Connection. The connection's current state is closed."

The code I am using is as follows:

strSQLConnection = "Data Source=.\SQLEXPRESS;AttachDbFilename=" + Chr(34) + _
My.Computer.FileSystem.CurrentDirectory.ToString() + "\MusicManager.mdf" + Chr(34) + _
";Integrated Security=True;User Instance=True"

Try
conn.ConnectionString = strSQLConnection
...
...

I know the file exists and is in the right location. Why won't SQL Express open the database?

I have successfully created Windows Applications that can connect to a database. What am I doing wrong?

Cheers,

Roy

Did you call Open() on the connection object before trying to execute a command against it?

Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.|||Do I feel stupid or what...

That was it. Thanks.

How I missed that I do not know...

Roy|||I can't count the number of times I've forgotten to Open the DB connection or tell the DataReader to Read.

Uriel