Question Permanent database entries in Server Explorer

ulynen

Member
Joined
Feb 18, 2015
Messages
22
Programming Experience
5-10
I posted an earlier question about queries etc. This issue appears to be resolved by using the connect to database in the tools menu. after going through that process I have a strange situation. Azure, data connections, and servers are now permanent entries in the IDE even when starting a new project. Under the data connections the name of the .mdb file that I connected to appears with a red x beside it. How can I get rid of these? A different project won't need these and I don't know why AZURE suddenly appeared.
HELP
UWE
 
The x means connection to this database is closed. Expand or Refresh it and Server Explorer will connect to it and icon changes to a 'connected' like marker.

Azure is MS cloud platform, that is a separate node in Server Explorer, just like Data Connections and Servers. Don't know why you didn't see it before.
using the connect to database in the tools menu
This will show the same "Add Connection" dialog that you get to when going through the Data Source Configuration Wizard.

When you start by "Add New Data Source", after adding the connection the wizard will ask you if you want to add the database to your project, if you answer yes the database is copied to project and the connection will be project specific and not be shown in other projects. If you answer no, the connection will point to original database location and the Server Explorer item will persist and show also in other projects.

If you go the other way, by first adding a database connection in Server Explorer, and then "Add New Data Source" and select the existing external connection, the wizard will still ask (sometimes?) if you want to include database in project, if you answer yes connection item in Server Explorer will also be project specific.

There are consequenses for choosing "remote"/"local" database when it comes to deployment, and also debugging, but in functionality these will otherwise be identical for designers and ADO.Net data access.

When you explore these options you can see the difference in Server Explorer in the connection string, shown in Properties window. The path will be either a project path or the path where database file was originally. The project path is expanded though, in project connection string (in project settings) the path for a local database will use the |DataDirectory| alias.

As for the connection remaining in Server Explorer, after you have added a data source, even if you answered no to adding it to project, you can delete the Server Explorer item if you wish, the project will use its own connection defined by connection string in project settings from there on.
 
Last edited:
The question then is: how do I change the setting for the database so that it does not appear in other projects?
I had to update my post due to some inaccuracies, I answered that in last added sentence. I may add that for projects that has local databases, a connection for these will show up dynamically in Server Explorer.
 
Back
Top