I am struggling to figure out how to connect to multiple instances of SQL Server with my VB.NET application. I have SQL Server 2008 and 2012 installed on my machine. If I try to open an SQL Server 2008 database, it automatically opens it in 2012, updates it, and renders it unusable to SQL Server 2008. Is there a way to modify my connection string to open a 2008 database in SQL Server 2008, and a 2012 database in SQL Server 2012? I have found out how to differentiate the file version already.
My connection string is as follows:
Thanks
My connection string is as follows:
Code:
m_cn.ConnectionString = "Server=.\SQLEXPRESS; AttachDBFilename=" & strFileName & ";Integrated Security = True; Connect Timeout = 30;" & "User Instance = True"