Skip to content

Categories: – The top internet trends in one place combines a whole heap of the top internet trends into one location.  Check out what’s hot on the internet right now including the top YouTube videos, the top Google searches, the top eBay items and more.

Posted in Uncategorized.

Stop Outlook from formatting phone numbers

In Australia, mobile numbers are formatted like this:

0499 999 999

If you out that into an Outlook contact record, it will most likely format it in another stupid way.

You can stop Microsoft Outlook from automatically formatting phone numbers in Windows 7 by:

  1. Clicking “Start” and search for “dialing rules”
  2. Select “Set up dialing rules”
  3. Edit the entry for “My location”
  4. Set the area code to 1
  5. Click ok twice

Outlook will stop formatting phone numbers.  It’s a similar procedure on Windows Vista and XP.

Posted in Uncategorized.

Create a htaccess file in Windows

Creating a .htaccess file using Windows is easy, just put double quotes around the file name when saving.

For example, if you are using Notepad:

  1. Click File -> Save As
  2. Enter the filename as: ".htaccess" (with the double quotes)

Posted in Uncategorized.

Tagged with .

Apache: Using htaccess to restrict access to a file

As well as being able to restrict access to directories, you can restrict access to specific files using htaccess files in Apache.

For example, to protect “secret.php” using basic auth:

AuthType Basic
AuthName "Authorised users only"
AuthUserFile /path/to/user/file
AuthGroupFile /path/to/group/file
<files secret.php>
Require user xxxx

Posted in Uncategorized.

Tagged with .

OnClientClick and ASP.NET Validator controls

If you use ASP.NET validator controls and try to use OnClientClick event, you will find that the validator wornt run. The solution is to add this to your javascript code:



Posted in Uncategorized.

Tagged with , , .

Setting up WatiN with NUnit on Windows 7

  1. Copy WatiN.Core.dll and Interop.SHDocVw.dll from the WatiN installation folder to your project’s bin folder
  2. Add “using WatiN.Core” directive to the top of your code
  3. The correct threadstate needs to be set (
    1. Create a file in your bin directory which has the same name as your assembly or executable, but with “.config” at the end. Eg: FOr “myFile.exe” create “myFile.exe.config”
    2. Paste in the following:
      <?xml version="1.0" encoding="utf-8" ?>
          <sectionGroup name="NUnit">
            <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
            <!-- Valid values are STA,MTA. Others ignored. -->
            <add key="ApartmentState" value="STA" />
    3. That will let you run tests in NUnit if you load the assembly or executable directly into NUnit. If you want to create an NUnit project, you will also need to copy that config file into the directory that the NUnit project file is saved in.
  4. Add localhost, as well as any other external sites the application references to “Trusted Sites” in internet explorer. That means if you have google ads for example,. you will need to add to the trusted sites list.
  5. You need to run NUnit as Administrator

Posted in Uncategorized.

Tagged with , , .

Moving an MS SQL Server database from one server to another

This post is for:

  • Publishing an SQL Server database (including DDL and data)to another server
  • Moving / publishing a database to a shared hosting service (such as GoDaddy) when that service does not allow you to restore a database that was not backed up using their systems.

Creating the scripts

  1. Download the SQL Server Database Publishing Wizard from one of these URLs
  2. Install on the source server
  3. Run the GUI and follow the wizard.

Installing the scripts

You can either run the scripts on the target server manually, or use the Database Publising Wizard to do this for you.

Posted in Uncategorized.

Tagged with .

Restoring an SQL Express database on another computer

These instructions assume you have backed up to a file using SQL Server to do the backup.  The file will have a .bak file extension. These instructions apply to Microsoft SQL Server Management Studio Express 2005 and 2008, which are available as a free downloads from the Microsoft site.

Optional – Retaining the old database when restoring to point in time

This is an optional step that you can use if you are restoring a database back to a point in time (due to data entry error for example) and will retain the existing database in case you wish to go back to it for any reason.

  1. Using SQL Server Management studio, in the object explorer under the “Databases” node, right click your database and choose “rename”.  Give it another name.
  2. Execute the following code:
    • USE master
    • GO
    • ALTER DATABASE [YourDatabaseName]
    • GO
  3. The database will now be offline (you may need to right click the database and select “refresh” in the object explorer to see this)
  4. Right click the database select “Properties”
  5. Copy the top value under “Path”
  6. Browse to this path using Windows Explorer.  You will see the database files.
  7. Rename the database files to match the new database name you provided above.
  8. If you wish to go back to this database at any time, you may need to:
    1. Go back into properties and alter the file names under the “File Name” to match the new file names you gave to the database files
    2. Bring the database back online (you can right click and select Tasks – > Set Online

Performing the restore

  1. Copy the backup file to the target SQL server file system
  2. Using SQL Server Management studio, in the object explorer right click the “Databases” node and select “New Database…”
  3. Name the database how you like and click ok.
  4. In the object explorer, right click the database you just created and select “Properties”
  5. In the left hand side, select “Files”
  6. Copy the two values under “Path” and the two values under “File Name”. Paste into Notepad, joining the File Name to the Path.  You will need them later.
  7. In the object explorer, right click “Databases” again and choose “Restore Database…”
  8. In the “To database” field, select the database you just created.
  9. Select “From device”
  10. Now select your .bak file as the source.
  11. In the window below, your backed up database will appear.  Check the checkbox to the left of it.
  12. Select “Options” from the left.
  13. Make sure “Overwrite the existing database” is checked.
  14. For first file listed in “Restore the database files as”, paste the locations that you copied in step 6.  Make sure the log one goes into the log field and vice versa.
  15. Click OK on the Restore Database window. The restore should now happen without error.
  16. Restart any services that access the database, if applicable.

Posted in Uncategorized.

Tagged with , .

PowerShell from ASP.NET and System.Management.Automation – SOLVED!

Wow, this took a long time to figure out, but now I can tell you exactly how to get the System.Management.Automation namespace into yout web site in order to run PowerShell commands.

1. You need to download the Windows SDK.  Download it from here:

2. When installing the above SDK, be sure to follow these instructions:

3. Reboot the machine.

4. Open the web.config file in your website and add the following:

    <compilation debug=”true”>
            <add assembly=”System.Management.Automation, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>

5. On the page that you want to do PowerShell things from, put this at the top:

using System.Management.Automation.Runspaces;
using System.Management.Automation;

6. Follow this article for a demo of how to execute commands:


Posted in Uncategorized.

Tagged with , .

CREATE OR REPLACE syntax for SQL Server

I encourange everyone to go to Microsoft Connect and vote for a “CREATE OR REPLACE” syntax for T-SQL:

Under the current arrangement, you have to check if the object exists first, if it does then drop it and then re-create – LAME

Posted in Uncategorized.

Tagged with .