Vista File Previewers
I'm always finding myself wanting to view the contents of a file, without the need of actually opening the huge memory sapping application that runs it. A C# source file or an ASP.net markup file are good examples. I often know there are useful lines of code somewhere, but  I dont want to fire up a version of Visual Studio just to look at it.

Vista and Outlook 2007 has built-in previews that enables you to preview or view the contents of certain files without actually opening it. However, out of the box this is limited to Wod Documents, Excel files etc.

I'd previously stumbled across a PDF File previewer and then today I "Googled" for an Xml one. I still ahvent managed to find one, although I did manage to find a great post on a Blog by Tatham Oddie. He's written his own PreviewHandlerPack which will allow you to preview .cs, .aspx files etc.

See the post here... http://blog.tatham.oddie.com.au/2006/12/20/vista-and-office-2007-preview-handler-pack-released/

I also found this post on how to build your own previewers if you feel so inclined. There seems to be an interesting one for a .xaml file

http://msdn.microsoft.com/en-gb/magazine/cc163487.aspx

Enjoy...
SQL 2000 Change Object Ownership csp

A Stored Procedure to change all the ownership of objects from user a to b...

http://support.microsoft.com/kb/275312/en-us

Add Comment Filed Under [ SQL Server ]
Script Entire SQL Server 2005 Database

To script an entire databas including all objects...

  • In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance.
  • Expand Databases, right-click any database, point to Tasks, point to Generate Scripts, and then follow the steps in the Generate Scripts Wizard.

http://msdn2.microsoft.com/en-us/library/ms178078.aspx

Add Comment Filed Under [ SQL Server ]
Dynamically change your MasterPage

If you ever need to change your masterpage for a given page, based on a condition, then use the code below.

protected override void OnPreInit(EventArgs e)
{
   base.OnPreInit(e);
   if (Request.Url.Host.Contains("test.com"))
      base.MasterPageFile = Server.MapPath("test.com.master");
   else
      base.MasterPageFile = Server.MapPath("test2.com.master");
}

Enjoy...

Add Comment Filed Under [ ASP.Net ]
Office 2007 File Previewers

Want to view more than just Office 2007 Files in the preview Window...? Fed up of waiting for Microsoft...Try this for PDFs...and if you want anything else...write your own...

http://ryangregg.com/PermaLink,guid,a29ee2d7-6863-4b70-9fcb-b7db392f9a74.aspx

http://msdn.microsoft.com/msdnmag/issues/07/01/PreviewHandlers/default.aspx 

Enjoy...

One Comment Filed Under [ Microsoft Office ]
Sky Broadband...unleashed!

Just got Sky Broadband...seems Sky pre-configure all the router settings etc. meaning you can't change anything etc.

Follow this article to see how to...

http://philbridges.com/?p=42

Add Comment Filed Under [ Personal ]
ASP.Net 2.0 Maintain Scroll Position in Postback

If you want to maintain your scroll position on a webpage but need to postback for some reason then use the following @page level directive...

  • MaintainScrollPositionOnPostback="true"

Or set the following in the section of your web.config...

  • <pages maintainScrollPositionOnPostBack="true" />

Source for this article can be found at

Enjoy...

Add Comment Filed Under [ ASP.Net ]
Windows Service: Deploying with setup project

If you need to deploy a windows service, and you are using a Visual Studio 2005 Setup Project, you can add a Custom Action that will Install & Uninstall the Service by doing the following:

  • In Solution Explorer, right-click your setup porject, point to View, and then click Custom Actions.
  • Right-click Custom Actions, and then click Add Custom Action.
  • Click Application Folder, and then click OK.
  • Click Primary output from [YourServiceName(Active)], and then click OK. Notice that Primary output appears under Install, Commit, Rollback and Uninstall

Thats it...enjoy...

Shortcut to Build your current Project only

Ever want to just build the current project and hate having to move the mouse...?

Creating a shortcut for "Build.BuildSelection" could be your new best friend...

Full article is here...

http://www.sharepointblogs.com/sebastian/default.aspx

MSDN Nuggets
Useful little MSDN link for short webcasts on various .Net Topics... http://www.microsoft.com/uk/msdn/events/nuggets.aspx
Add Comment Filed Under [ General .Net ]