VS.NET has a tight integration with SQL server. From the server explorer you can browse your databases, view or update any data in them and even do a lot of design stuff. You can see some examples in this dnj article. The only thing I haven't found in there is the administration of sql user accounts. But there is a price to be paid, I'm not exactly sure what is going on but some things are leaking. Having altered some tables and having had some app-crashes while debugging my machine slows down. Restarting VS solves that. Closing down VS form such a state is a long wait.
I found out there is a faster way to slow down VS. Take this scenario. For an app I had created a couple of components. The components open the db connection when created, close it when disposing and house a couple of dataAdapters. The pages of my app will use the component, to make them easy to use I added a couple of component properties to the app's base web form. Something like this
public class BaseForm : System.Web.UI.Page
{
private IprojektData pd;
public IprojektData Projekt
{
get
{
if (pd == null)
pd = new ProjektData.DataComponent();
return pd;
}
}
The properties have a "lazy" creator, the actual component is not created until it is actually needed. And when the component is not used on the page it will not be created at all.
The pitfall is making the properties public. When you design a page based on this base class the component properties will show up in the property window. The property value is computed and the component will be created. Leading to a lot of (failing) database activity in the web-form designer. Not needed and this really can cripple your machine very fast. The solution is pretty straightforward, just set the browsable attribute on the properties to prevent the properties showing in the property window. Like this
[Browsable(false)]
public IprojektData Projekt
{
get
{
if (pd == null)
pd = new ProjektData.DataComponent();
return pd;
}
}
Now the property won't show up in the window, the componenet is only created at run-time and VS will keep running.
Blog on,Peter