0

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    Show the connection string and the code that calls the initialization of your connection – Steve Aug 18 '13 at 07:58
  • Can you show some code.? What is your connection string. ? Did you make any recent changes to the DB or your Express configuration.. ? – user2339071 Aug 18 '13 at 07:59
  • 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 exception – Francis Pedro Aug 18 '13 at 08:01
  • Check your Instance Name in that case. – user2339071 Aug 18 '13 at 08:59
  • @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 work – Francis Pedro Aug 18 '13 at 09:09
  • In general, there are scenarios that even bad solution works fine for some time by accident, so I guess it would still be better if you provided the code. Beside of that, it is easier to answer a question knowing the full context. – BartoszKP Aug 18 '13 at 09:39
  • @FrancisPedro : Are you using .NET 4.5 ? – user2339071 Aug 18 '13 at 11:52

1 Answers1

0

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.

user2339071
  • 4,254
  • 1
  • 27
  • 46