This post originated from an RSS feed registered with .NET Buzz
by Steve Hebert.
Original Post: Tracking down a rogue Data Connection in Server Explorer
Feed Title: Steve Hebert's Development Blog
Feed URL: /error.htm?aspxerrorpath=/blogs/steve.hebert/rss.aspx
Feed Description: .Steve's .Blog - Including .Net, SQL Server, .Math and everything in between
I've had an annoying problem with a data connection appearing under the "Data Connections" node in Server Explorer under VS2003. Everytime I load up my project, I get prompted for a Sql Server Login to a particular database. Worse yet, this popup kills the progress of my daily build process.
Every time I deleted the connection, it would reappear on reload of my project. Doing mass searches inside and outside of the IDE turned up nothing. I figured this must be a project level issue, so I popped open the database project file (.dbp) and there lives the DBRefFolder section and looks like this...
Begin DBRefFolder = "Database References" Begin DBRefNode = "servername.databasename" ConnectStr = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=username;Initial Catalog=myDB;Data Source=servername;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=mongo;Use Encryption for Data=False;Tag with column collation when possible=False" Colorizer = 5 End End
So here is how this undocumented monstrocity works... upon loading of the project file, the contents of the DBRefFolder are loaded into the DataConnections node under Server Explorer.
This is extremely annoying and somewhat maddening considering I haven't been able to find any documentation about it on MSDN (is that really surprising?) and only two references to DBRefFolder on Google. In the bigger picture, the "Database Project" under VS.NET (2002 and 2003) has been treated like an ugly stepchild - there is very little documentation and no support whatsoever within the Visual Studio control API. It's really an ugly project type that ignores the XML formatting of new projects and looks and feels like an old VB5 or VB6 project file.