.NET Blog

Tony Cavaliere

 
My Favourite Albums
  And the Grappa wins.
E-mail me Send mail
Add to Technorati Favorites AddThis Feed Button

Subscribe to Cynot Why Not


Recent posts

Disclaimer

Hey unlike other bloggers I stand by what I say but just in case. The opinions expressed herein are my own except on Tuesday when the second card is not turned up otherwise it ain't worth squat.

© Copyright 2010

Why I like Windows Server 2008 R2

Windows Server 2008 R2 was recently released on October 22, 2009. I have already used Windows Server 2008 and enjoyed many of it’s new features but this latest release has got me excited and all for one new feature, Remote Desktop multi-monitor support.

Currently I am remoting  to a Windows Server 2008 computer, my local computer runs Windows 7. Remote Desktop Connection available on Windows 7 has support for multiple monitors however the computer you are remoting must also supports multiple monitors remotely. Both Windows 7 and Windows Server 2008 R2 have this build-in capability. All you need to do is enable it from your local machine and remote to the destination computer and sit back and enjoy. I’ve tried it (Windows 7 local and Windows Server 2008 R2 remote) and it work without any issues.

So all you remote users out there rejoice and celebrate your productivity has just increased.

 

image

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by cynotwhynot on Saturday, October 24, 2009 10:19 AM
Permalink | Comments (14) | Post RSSRSS comment feed

Where’s the MDF?

I’ve always wondered why the ASP.NET folks have always had (or at least since VS2005) the ability to add a detached SQL Express file, or commonly referred to as an MDF file, whereas, project types like console application and windows forms do not.

When you add a new item to an ASP.NET application you will see the following dialog.

image

Notice the SQL Server Database option. Selecting this will cause an MDF file to be added to the ASP.NET application. Very convenient. However, no such option exists for either the console or windows forms project types.

I have seen developers add MDF files by starting SQL Server Management Studio, creating a database, detaching it and then coping the file to the project. I have also seen developers create an ASP.NET project, add a MDF file and then copy the MDF to the desired project. Neither are optimal.

One great way to automate this, is to create an Item Template. To do this create an ASP.NET project and then add an MDF file by selecting Add New Item menu option and selecting SQL Server Database. This will add a detached SQLExpress database file to the project. The next step is to delete the LDF (log) file from the project.

Now we are ready to create the Item Template. Select the File->Export Template menu. This causes the Export Template Wizard to appear,a s shown below.

image  

Select the Item template radio button and click the Next > button. The Select Item To Export dialog appears from which you select the MDF file.

image

The next dialog to appear after selecting the Next > button is the Select Item References dialog. In this situation there is no need to include any references so just click the Next > button. The Select Template Options dialog appears from which you specific the name of the template. When done select Finish and that’s it you have created a item template that can be used just about everywhere.

Try it out, create a console application and then select the Add->New Item menu item. If all goes well you should see the Add New Item dialog and under the My Templates you should see the new Item Template. Selecting this Item Template will add a SQLExpress MDF file to the project.

image

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by cynotwhynot on Wednesday, October 07, 2009 4:36 PM
Permalink | Comments (21) | Post RSSRSS comment feed