0
votes

I tried to connect to SQL Server 2012 Express through Visual Studio 2012. It was working before until yesterday when it gave this error

Cannot connect to FRANCISPEDS\SQLEXPRESS.
ADDITIONAL INFORMATION: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. (System.Data)

Minutes later, tried to connect again, now it shows this error

Cannot connect to FRANCISPEDS\SQLEXPRESS.
ADDITIONAL INFORMATION:
The type initializer for 'Microsoft.VisualStudio.Data.Tools.SqlEditor.DataModel.SqlConnectionStrategy' threw an exception. (Microsoft.VisualStudio.Data.Tools.SqlEditor)

Index not found. (Exception from HRESULT: 0x80131124) (System.Data)

I have no idea what happened, can someone help? thanks.

1
Show the connection string and the code that calls the initialization of your connectionSteve
Can you show some code.? What is your connection string. ? Did you make any recent changes to the DB or your Express configuration.. ?user2339071
I'm still not in the code yet. This is just trying to connect to SQL Server 2012 to do some query. However even my backup application that worked before now throws an exceptionFrancis Pedro
Check your Instance Name in that case.user2339071
@user2339071 I'm pretty sure the name is right because i haven't changed anything. I remember closing vs2012 with everything working then when i re-opened it, it suddenly doesn't workFrancis Pedro

1 Answers

0
votes

Seems there is a problem with .NET 4.5. I think you have to remove non-IFS LSP installed Winsock Catalog Provider. Kindly follow the instructions given on http://support.microsoft.com/kb/2568167.