Visual Studio - How can I automatically close server data connections on build? - visual-studio

Is there a way to automatically close the open server connections in the Server Explorer panel in Visual Studio 2010?
I'm using EF and a contextInitializer which always drops the database when building (testing stuff).
70% of the time I forget to manually close the connection which gives me a "cant delete the DB because its being used" error.
Its a small thing, i know, but its making me mad!
Thanx in advance!
Alex!

Related

Prevent Visual Studio Server Explorer from auto-populating

I am running into a frustrating issue with Visual Studio in which every time I open or refresh a solution, Visual Studio locks up for about 30 seconds and then I am met with this error
This happens about 10 times, so it takes about five minutes to get a working instance of Visual Studio.
I eventually traced this to entries in Server Explorer to which I don't have access. These seem to be auto-populated from connection string entries in various Web.config files throughout the solution. If I comment out the connection strings, the solution loads fine. But this is not an ideal solution because I don't want to commit these changes to source control.
Is there a way to stop this auto-population of Server Explorer? I don't remember this ever happening in previous version of Visual Studio, so maybe it's new in 2015?

manage sdf data in visual studio 2013

Last year, I used VS2010 to develop a Winforms application. Now, I changed to VS2013 and I faced some problems.
I couldn't find a way to manage SQL Server Compact Edition database files (.sdf) in VS2013. Although I have installed an add-in from this website
But I can only see the top 200 rows of data in the .sdf, I can't open connection in order to add more data with code.
Is there any solution for me ?
Go to Options in the addin, and you change 200 to any number
Could you clarify what you mean by: "cant open connection in order to add more data with code" ?

Why added Data Connections in Server Explorer doesn't stay in Visual Studio 2012?

I added a connection to Oracle database under Server Explorer's Data Connections inside Visual Studio Premium 2012. But after I close the solution and re-open again, the added data connection is gone. How can I keep it there?
update:
I found that the connection information is actually stored at %AppData%\Microsoft\VisualStudio\11.0\ServerExplorer\DefaultView.SEView but Server Explorer doesn't seem to read and display it.
%AppData%\Microsoft\VisualStudio\11.0\ServerExplorer\DefaultView.SEView
if you delete this file, then it is created again and it has no use.
Just delete your web.config or other config files like app.config connection strings that you don't need them again.
I test it for about half a day and deleting the unneeded connection strings from config file help me not loading again that connection string in server explorer of visual studio 2012. Wish you luck

Visual Studio 2010 expanding all database tables for no reason

so I'm working on an mvc2 project with visual studio. I have 5 or 6 data connections in my server explorer tab which is pinned. All of a sudden a strange error pops up that has nothing to do with what I'm currently doing in visual studio.
I then open the server explorer pane and all my data connections are now connected. One of the connections then has every table in the tree expanded. It's pretty annoying and I don't know what is causing it or how to make it stop.
I dont know about expanding and collapsing issue, but that error has to do with not having the Diagramming functionality set up on the Database being referenced

Connect to Team Server on launch of VS?

I deal with multiple Team Foundation Servers and collections. Is there a command line I can send to VS so I don't have to manually switch between the TFS servers every time I launch VS?
The way I do it is use the start page from Visual Studio. It lists my recent projects and you can even pin them so they do not scroll out of view when you do not use them for a while.
Activating a project from the start page will automatically connect your Visual Studio environment to the correct TFS collection, because the solution you open is bound to one of them.
Works like a charm!

Resources