Just to let everyone know, Ravi emailed me offlist and said he found the solution. He had left connection pooling enabled in the connection string and so although he had finished with the connection, it wasn't actually closed, just returned to the pool.
Adding Pooling=false to the string resolved his problem. Regards Richard Blewett DevelopMentor -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Ferguson Sent: 17 June 2003 14:06 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] command object What is the exact text of the exception that you catch when you execute the delete operation? Peer code review time: > connectionString = "Provider=SQLOLEDB;Data > Source=Ravi;Initial Catalog=Master;" + > "Integrated Security=SSPI;"; > } > > OleDbConnection connection = new OleDbConnection > (connectionString); If your code will always be executing against SQL Server, and only SQL Server, then consider using the SQL Server Managed Provider classes (SqlCommand, SqlConnection, et al) for better performance. > String StrCreateDb = "Create Database > ["+textBox1.Text+"]"; Consider using StringBuilder to concatenate strings for better performance: System.Text.StringBuilder createDB = new System.Text.StringBuilder(); createDB.AppendFormat("CREATE DATABASE [{0}]", textBox1.Text); string StrCreateDb = createDB.ToString(); > for(int x=0; x<=200000;x++) > { > } Huh? --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.489 / Virus Database: 288 - Release Date: 10/06/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.489 / Virus Database: 288 - Release Date: 10/06/2003