Visual Studio Development Bookmark and Share   
 index > Visual Studio Extensibility > Accessing Server Explorer information
 

Accessing Server Explorer information

I'm trying to access the Visual Studio 2008, Server Explorer, in an add-in so that the add-in can allow users to select a database, and perform some operation on the data.

The add-in pretty much works, but requires the user to enter the server name text and database name text manually, in order to build a connection to the database.

I really want to populate a dropdown with the connection names of each connection defined the server explorer, but cannot get at this as easily as I can with solution explorer.

It seems this is very challenging, but one solution I found looks promising, here.

If you scroll down to a post by Daniel A. Seara, you will see that he accesses the XML info that describes the users server explorer details.

Now this file exists in VS 2008, I looked at it and saw it, but it has encrypted connection strings - not human readable ones.

I'm newish to SQL Server, so if I am given an encrypted connection string, is it easy to connect to the database?

Also, is this all a waste of time, is there simpler way to do this?

Thx

Cap'n





Captain Kernel  Thursday, October 15, 2009 7:47 PM
Hello,

Search the following articles:

HOWTO: Using the Choose Data Source dialog of Visual Studio 2005 from your own code

HOWTO: Get data sources, data providers and data connections from a Visual Studio 2005 add-in

in the following page:

http://www.mztools.com/resources_vsnet_addins.aspx
MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about VS extensibility: http://msmvps.com/blogs/carlosq/
Carlos Quintero - MVP  Saturday, October 17, 2009 8:34 AM
Hello,

Search the following articles:

HOWTO: Using the Choose Data Source dialog of Visual Studio 2005 from your own code

HOWTO: Get data sources, data providers and data connections from a Visual Studio 2005 add-in

in the following page:

http://www.mztools.com/resources_vsnet_addins.aspx
MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about VS extensibility: http://msmvps.com/blogs/carlosq/
Hello Carlos

Thanks for that, it looks promising but I am having trouble with that code under VS 2008 and .Net 3.5, it seems some classes have been removed and superceded.

For example this web article on something calledActiveWriter, says this:

"It seems to work quite well. I have a fairly extensive background in DSL/'VS-SDK so this was not all that bad, however there were some non-obvious monsters lurking. For example, the IVsDataConnectionsService has gone away from what anyone can tell me and I replaced it with IVsDataExplorerConnectionManager."

So can I modify your code do you think, to get it working or might this require extensive changes?

Also do I need the DDEX SDK or does "normal" Visual Studio 2008 Team Developer, have all this already installed?

Thanks

Cap'n




Captain Kernel  Saturday, October 17, 2009 10:48 AM

You can use google to search for other answers

Custom Search

More Threads

• DSL Tools, why can't I add rules programatically?
• Can't download anything
• Is there anything like OnQueryDeleteFile ??
• Automatic Software Update Techniques
• EnvDTE/VsLangProj: Visual Studio 2008 SilverlightApplicationList Property Availability (Quick Question -- Please Look)
• Extend VSTA IDE with Managed VSPackages
• Close Visual Studio IDE using DOS
• Language Service "OnCaretMoved" not being fired.
• CTC menus in a package under Orcas
• Compile time assert related to native (VSL) package/project name length