Results 1 to 4 of 4

Thread: Permanent database entries in Server Explorer

  1. #1
    ulynen is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2015
    Posts
    22
    Reputation
    29

    Permanent database entries in Server Explorer

    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

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,090
    Reputation
    2804
    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 by JohnH; 02-25-2015 at 8:45 PM. Reason: updated info
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

  3. #3
    ulynen is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2015
    Posts
    22
    Reputation
    29
    The question then is: how do I change the setting for the database so that it does not appear in other projects?

  4. #4
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,090
    Reputation
    2804
    Quote Originally Posted by ulynen View Post
    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.
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •