Thursday, 26 May 2011

Debugging IIS w3wp.exe process

When debugging  IIS and taking a while to look at your code, you may sometimes get this message

clip_image002

To fix this simply switch off the ping enabled setting in your IIS, application pool, advanced settings

clip_image004

Monday, 23 May 2011

Binding to a constant in XAML WPF

Example...

Add this to your controls namespace declarations

xmlns:MyNameSpace="clr-namespace:MyNameSpace;assembly=MyAssembly"

then use it as follows in your markup

ToolTipService.ShowDuration="{x:Static MyNameSpace:MyClass.MY_CONSTANT}"

Monday, 9 May 2011

Enabling all disabled triggers in SQL Server


select 'ALTER TABLE ' + o.name + ' ENABLE TRIGGER ' + s.name
from sys.objects o
inner join sys.triggers s on s.parent_id = o.object_id
and s.is_disabled = 1

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...