connect to sql from visual studio

in my sql server 2008r2 I made a new database with some tables, and I want to use it in visual studio, so in the server explorer window - I clicked on "connect to database" and I can't find my new DB in the "select DB name" drop down. how can I find it there?

thank you!

  • Moved by Bob BeaucheminMVP 18 hours 33 minutes ago Moved to a more relevant forum for best results
August 15th, 2014 11:54am

Hi,

It might be an Authentication problem. You have to make sure that the user that connect have the right permitions on the database for example. The easier way is First make sure that you can connect the database throw the SSMS, and keep the connection information

Server Type: Database Engine
Server name: <IP, or domain, or dot, or machine name, etc>\<Instance name>
Authentication: Windows Authentication

Open Server Explorer 

click the button "Connect to Database"

In the windows that open write the same information that you used in the SSMS

>> Dont use the dropdown to find the information, but just write it

Use the "test Connection" to make sure that it is OK before you cl

Free Windows Admin Tool Kit Click here and download it now
August 16th, 2014 1:33am

Hi,

Please ensure your connection string is something like

	<connectionStrings>
		<add name="conn2" connectionString="Data Source=192.?.?.?\your_db_instance;Initial Catalog=your_db_schema;Integrated Security=False;User ID=your_db_login;Password=??????" providerName="System.Data.SqlClient"/>
	</connectionStrings>


within Web.config/app.config file in your project, to ensure the project will work fine with the database.

August 16th, 2014 3:36am

Hi HuaMin

I think he is not asking how to connect using code, but using the GUI since he talk about "server explorer window" :-)

Free Windows Admin Tool Kit Click here and download it now
August 16th, 2014 5:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics