View Single Post
  #8 (permalink)  
Old December 6th, 2014, 07:50 PM
C#Learner C#Learner is offline
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2014
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Thank you VERY MUCH to all who helped me to solve the problem!!! A few days of frustration and struggle…I would like to share my experience and might help somebody else who are in the same trap.

If you experience a problem with the program see the answer of olo-B above and concatenate the server name:

cmbServer.Items.Add(serverName +"\\" + row["InstanceName"]);
If it still does not help then,

In Microsoft Visual Studio open Database Explorer and try to add a new connection.

In a list of server names could be only the name of your computer, even if you hit the “Refresh” button.

After you type the name of the server, there is a list of databases. Chose a database which you need and test the connection (there is the button). You can receive a confirmation that test connection succeeded.

However, when you hit OK, you got an error message:
Database Explorer

Unable to add data connection. Could not load file or assembly ‘Microsoft.SqlServer, Management. Sdk.Sfc, Version=, Cuture=neutral, PublickeyToken=89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified.
It means that you need to install two missing components, which you can find in:
Microsoft® SQL Server® 2012 SP2 Feature Pack
These components are:
1) SQL System CLR types
2) SQL 2012 Shared Management Objects
[SQL 2012 Shared Management Objects] has dependency on [SQL System CLR types] component, so you have to install SQL Server System CLR Types first.

For more info go to:
My specs:
OS Windows 7 Professional
Microsoft Visual Studio Express 2013 for Windows Desktop
Microsoft SQL Server Express 2014
Microsoft Security Essentials
Microsoft Fire Wall

Good luck!