none
Unable to add a data Connection in Visual Studio RRS feed

  • Question

  • I want to add a data connection (sql server 2005) in Visual studio 2008.

     

    The steps followed were:

    1. Open database explorer

    2. right click on Data connection

    3. Click on Add Connection

    4. In Choose data source, i select Microsft Sql Server

    5. Add server name(name of my computer) and the database name( i got the database name by executing command "select db_name as DataBaseName")

    6. Click OK

     

    Following error message is displayed: " A network related or instance specific error occured while establishing a connection to sql server. The server was not found or was not accessible. Verify that the instance name is correct and that the sql server is configured to allow remote connections.(provider: Named Pipes Provider, error:40 - Could not open a connection to SQL server)

     

    I changed Local and remote connections to "using named pipes only".

     

    Is there any other pre-requisite before i add the connection?

    Tuesday, November 11, 2008 2:02 AM

Answers

  • Do you have named instance of SQL Server installed? If yes, you need to specify full name of your server in following format

     

    MyComputerName\InstanceNameHere

     

    In a case of SQL Server Express, you would need to specify it as

     

    MyComputerName\SQLEXPRESS

    Tuesday, November 11, 2008 11:37 AM
    Moderator

All replies

  • Do you have named instance of SQL Server installed? If yes, you need to specify full name of your server in following format

     

    MyComputerName\InstanceNameHere

     

    In a case of SQL Server Express, you would need to specify it as

     

    MyComputerName\SQLEXPRESS

    Tuesday, November 11, 2008 11:37 AM
    Moderator
  • I had been trying MyComputerName/InstanceName ... used a front slash instead of back slash. (I have no idea what difference it makes).

    Then i got a success message on clicking Test Connection. But, on clicking OK, i got aother error message : cannot add data connection. Could not load file or assembly. Microsoft.SqlServer.Management.SDK.sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=<key value>...............

    I tried the solution provided in -> http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vstudio.general&tid=89ee0e86-b8fc-40a7-a0e1-51ac4033302e&cat=en_US_38f7e3d1-40bd-4daf-941f-f45d2ff6ff9b&lang=en&cr=US&sloc=&p=1 and finally it worked!!!

     

    Now i am able to make the connection.

    Thanks for your help.

    Tuesday, November 11, 2008 4:16 PM
  • Thanks a lot for the post!!

    It really helped me to solve this issue

    • Proposed as answer by VinayYadav Thursday, August 20, 2009 9:22 PM
    Thursday, August 13, 2009 6:03 PM
  • Yeah. It really helped me. Thanks.

    Thursday, August 20, 2009 9:23 PM
  • Hi.. im facing the issue and getting the error as "cannot add data connection. Could not load file or assembly. Microsoft.SqlServer.Management.SDK.sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=<key value>"

     

    i tried the soultion link http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vstudio.general&tid=89ee0e86-b8fc-40a7-a0e1-51ac4033302e&cat=en_US_38f7e3d1-40bd-4daf-941f-f45d2ff6ff9b&lang=en&cr=US&sloc=&p=1

     

    But this is not available now.

     

    could anyone plz help me out to solve this?

     


    - Mohamed Yasar
    Thursday, September 16, 2010 9:18 AM
  • Hi.. im facing the issue and getting the error as "cannot add data connection. Could not load file or assembly. Microsoft.SqlServer.Management.SDK.sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=<key value>"

     

    i tried the soultion link http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vstudio.general&tid=89ee0e86-b8fc-40a7-a0e1-51ac4033302e&cat=en_US_38f7e3d1-40bd-4daf-941f-f45d2ff6ff9b&lang=en&cr=US&sloc=&p=1

     

    But this is not available now.

     

    could anyone plz help me out to solve this?

     


    - Mohamed Yasar
    Thursday, September 16, 2010 9:18 AM
  • Do you have SQL Server Management Object SDK installed on your computer? If not you can download it from

    http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en


    Val Mazur (MVP)

    http://www.xporttools.net

    Thursday, September 16, 2010 11:34 AM
    Moderator
  • Hi Can you please let me know what you did to resove the issue. I am facing the same issue.. I am trying to add data connection on Visual Studio 2010 platform. I am using SQL Server 2005 where I have my DB.

     

    Thanks for your help,

    Smitha

    Wednesday, November 10, 2010 6:57 PM
  • What kind of error do you have in your case?
    Val Mazur (MVP) http://www.xporttools.net
    Thursday, November 11, 2010 11:51 AM
    Moderator
  • HI

    I have too the same error.

    I had installed the visuall studio 2010 first. Then removed all the SQL 2008 files. and after i installed the SQL 2005.

    When i   test connection i have got the messege: "Test connection succeded". but when i click OK, i have got the error:

    "unable to add data connection. could not load file or assembly 'microsoft.sqkserver.management.sdk.sfc' verision=10.0.0, culture=netural,publickkeytoken=89845dcd8080cc91' or one of its dependenciec."

    what's the problem? and what i need to do?

    thank

    Friday, December 10, 2010 11:17 AM
  • HI

    I have too the same error.

    I had installed the visuall studio 2010 first. Then removed all the SQL 2008 files. and after i installed the SQL 2005.

    When i   test connection i have got the messege: "Test connection succeded". but when i click OK, i have got the error:

    "unable to add data connection. could not load file or assembly 'microsoft.sqkserver.management.sdk.sfc' verision=10.0.0, culture=netural,publickkeytoken=89845dcd8080cc91' or one of its dependenciec."

    what's the problem? and what i need to do?

    thank


    Hi

    I have a same kind of issue (with little diversion) for connecting to SQL Server 2005. Here is details.

    - I tried to connect to SQL Server 2005 database using Server Explorerin VS studio 2008. It was fine to get connected with the server. Then I tried to create te new Data Connection to Northwind database on SQL Server 2005 server instance using Named Pipes, SQL Server authentication, etc. Everything works fine.

    - Now, I used the same configuration to connect to the same database from VS Studio 2010. After entering/selecting appropriate login credentials for Data Connection, as soon as I clicked on OK to create the new Data connection, Visual Studio windows get disappeared. It doesn't display any error, exception......???????? It just crashes. I don't know what is wrong.

    It works fine with VS 2008 but VS2010 crashes.

    Any help will be appreciated. Thanks.

    Thursday, April 21, 2011 8:03 PM
  • I'm also facing the same problem.

    plz suggest somebody how to solve this.

     

    Thanks

    Mangat

    Thursday, May 26, 2011 6:30 AM
  • Guys I just had a similar error until I saw this post.

    I'm also quoting the full post since some of the links here seem broken.

    Make sure you install the 3 packages below. Worked like a charm for me, I had the same issue as described below.

    Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc

    Author: aghausman | Posted: 19. November 2008 02:29 133
    Another sick error of the day, When you try to create connection string from SQLDatasource or even want to bind existing connection string. You might see a Message box saying
    Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
    This error comes when you are trying to access SQL 2005 stuff from Visual Studio 2008.  So go to the link and download the following stuff
    • Microsoft SQL Server System CLR Types
    • Microsoft SQL Server 2008 Management Objects
    • Microsoft SQL Server 2008 Native Client
    Thursday, August 25, 2011 2:46 AM
  • I had this problem after installing VS2012.  

    I had to download two items from the Microsoft SQL Server 2012 Feature Pack from here:

    http://sqlbeyond.blogspot.co.uk/2012/08/vs-2012-error-could-not-load-file-or.html

    Microsoft® System CLR Types for Microsoft® SQL Server® 2012

    Microsoft® SQL Server® 2012 Shared Management Objects


    Yellowbus Developer

    Thursday, February 14, 2013 12:38 PM
  • Hi Val

    I installed the 3 files:

    • Microsoft SQL Server System CLR Types
    • Microsoft SQL Server 2008 Management Objects
    • Microsoft SQL Server 2008 Native Client

    and I still get the error message.

    Do you have any other idea?

    Elad

    Friday, May 24, 2013 8:29 AM