1
votes

I am trying to connect to a SQL Server 2016 database from C# in Visual Studio. I keep getting the following error:

Unable to add data connection. Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.sfc, Version=12.0.0.0, Culture=neutral, PublicKeyToken='89845dcd8080cc91' or one of it's dependencies. The System Cannot find the file specified.

I downloaded and installed (the 2016 versions) of the following:

ENU\x64\SharedManagementObjects.msi

and

DB2OLEDBV5_x64.msi 

as suggested in this thread: Could not load file or assembly Microsoft.SqlServer.management.sdk.sfc version 11.0.0.0 but I am still getting the error.

Edit: I am using Visual Studio 2015. I am trying to connect via the Server Explorer's "Connect to Database" Tab

1
How exactly are you trying to connect to MSSQL from Visual Studio? I mean, are you trying to connect through Server Explorer or SQL Server Object Explorer? Are you trying to connect to MSSQL locally or remotely? What is the version of Visual Studio? Please provide more info.kimbaudi
Thank you. I have edited the original question with the information that you asked for.Jeremy D

1 Answers

0
votes

Visual Studio 2015 needs the 2014 version of ENU\x64\SharedManagementObjects.msi Download SQL Server 2014 Feature Pack, which contains the 2014 version, and you should be good.

Microsoft® SQL Server® 2014 Feature Pack

https://www.microsoft.com/en-us/download/details.aspx?id=42295