Thursday, 23 December 2010

How to determine the services running under a SVCHOST.EXE process using Task List

1. Click on the Start button and then click on the Run menu command.
2. In the Open: field type cmd and press enter.
3. You will now be presented with a console window. At the command prompt type tasklist /svc /fi "imagename eq svchost.exe" and press the enter key. You will see a list of the processes on your computer as well as the services that a SVCHOST.EXE process is managing. This can be seen in the image below.

Wednesday, 22 December 2010

The difference between '<%#' and '<%=' in ASP.NET

I have been trying to work out the difference between "<%#" and "<%=" when writing markup for an ASP.Net site. Sometimes the = sign worked, and sometimes the # sign works but switching them usually sorted out the problem but I was never really sure why.

I found a post on Dan Crevier's Blog that explained the difference very well.

To sum it up it works as follows:
  • The "<%=" expressions are evaluated at render time
  • The "<%#" expressions are evaluated at DataBind() time and are not evaluated at all if DataBind() is not called.
  • "<%#" expressions can be used as properties in server-side controls. "<%"= expressions cannot.

Monday, 13 December 2010

SQL - Saving Changes is not permitted when altering table

If you are trying to edit the data type in a table in SQL server and you get a message saying "Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created" then you will be pleased to know there is a setting for this that seems to be on as default in a new install.

If you open the settings screen from Tools > Options then go down to the 'Designers' node you should see an option called "Prevent saving changes that require table re-creation". If you remove the check mark from this option then you should be able to save as normal.

Friday, 10 December 2010

Programmer Joke

Thursday, 9 December 2010

SQL script to get databases missing a full backup within the past 24 Hours

Here is an SQL script to get databases missing a full backup within the past 24 Hours

I found this over at SQL Tips

Script to get Most recent SQL Backup date for each database

Here is a script to get the most recent backup date for each database in SQL server

I found this over at SQL Tips

How to find all database backups in the last week

Here is a useful script to find all backups done on all databases over the last 7 days. The number of days can be changed if necessary:

I found this script over at SQL Tips