I'm using C# in Visual Studio 2008 to loop through MDF Files on my PC and extract data from within them. I'm using a Table Adapter to point to the local MDF file.
Recently one of my PC's refuses to let me attach any new Data Source as it says
System.Data.SqlClient.SqlException: Unable to create/attach any new database because the number of existing databases has reached the maximum number allowed: 32766
Even if I start a fresh Windows application and try to add an MDF file (on my desktop) to it as a Data Source, I get the above error.
Can anyone tell me how to remove/delete the existing connections ?
My code works fine on another PC and I've re-installed Visual Studio on my PC but still get this error.
C# Table adapter code:
tmTableAdapter.Connection.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename='" + pathofmdffile + "';Integrated Security=True;Connect Timeout=30;User Instance=True";
tmTableAdapter.Connection.Open();