Sending mail with ASP.NET and Gmail

After a server upgrade I had to setup my mail again. It seems that IIS7 has lost it’s core mail functionality, so I tried to use the SMTP service from Gmail for sending my e-mail. First thing I did is to setup a simple test page, that I would like to share with you. Front The page contains a simple web form for inserting some test data and is looking like this:           The markup code   <%@ Page Language="C#" AutoEventWireup="true" CodeFile="g... [More]

Using .NET methods in your XSLT

Not many people know that it is possible to use a .NET object as an extension object when transforming XML with XSLT. Imagine that you want to recalculate the price of a book and round the result number. Impossible to calculate within XSLT, since it’s a transformation language and not a programming language. Solution is to create a class with a method that performs the calculation. Then when transforming add this opject as an extension object to the XsltArgumentList. The C# code:   ... [More]

Two useful jQuery scripts for forms

Here are two useful jQuery scripts for online forms. The first is to prevent double submission of a form a.k.a. ‘anti-double-click’. $("form").submit(function() { $(":submit",this).attr("disabled", "disabled"); }); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem... [More]

SQL Server database table sizes

To get a good overview of the amount of data that resides in your database tables, you can use this handy T-SQL scripts. CREATE PROCEDURE [dbo].[GetDBTableSize] AS BEGIN SET NOCOUNT ON; DECLARE @cmdstr varchar(100) --Create Temporary Table CREATE TABLE #TempTable ( [Table_Name] varchar(50), Row_Count int, Table_Size varchar(50), Data_Space_Used varchar(50), Index_Space_Used varchar(50), Unused_Space varchar(50) ) --Create Stored Procedure String SELECT @cmdstr = 'sp_msforeacht... [More]

Find stored procedures, tables and functions in T-SQL

When developing a lot in database, it can be useful to search for database objects that contain (partly) a specific name. The stored procedure script below allows you to perform such a search. /* Find stored procedures / tables / functions */ CREATE procedure dbo.pr_FindIt ( @find varchar(128) ) as SELECT TABLE_SCHEMA AS OBJECT_SCHEMA, TABLE_NAME AS OBJECTNAME, TABLE_TYPE AS OBJECT_TYPE, null as CREATED, null as LAST_ALTERED, n... [More]

Testing the WLW Polaroid Plugin

WLW = Windows Live Writer Just testing the WLW Polaroid plugin, it’s easy! Features: sizing, tilt image, add caption text and add corners. Btw, for easy code pasting with syntax highlighting, I use the WLW Code Plugin. Also recommended! Best regards,

Defragmentation script for SQL Server

When you SQL server database becomes slower over time without apparent reasons, probably you’re facing a fragmentation problem. Database table fragmentation is one of the major performance killers. With the following maintenance script you defrag you tables and indexes. -- ============================================= -- Copyright by Author Sajal Dam, ISBN 1590594215 -- Description: Performs defragmentation actions -- tables and indexes in your database. -- Execute ... [More]

Keep Remote Desktop Session Alive

Terminal Services Remote Desktop automatically kills session which are not actively used for some times. This sometimes annoys me, since some connections remain open and used all day (like development server environments. It's possible to enable a keep alive setting on the server by editing the Windows registry of the server. The simple steps:   Go into the registry - HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server, Create/edit the DWORD value KeepAliveEnable. Set it to 1. Thi... [More]

Mobile and Tablet Browser market share

Interesting site with a lot of browser market share statistics. Safari is big on mobile & tablet (61%), likely caused by their Iphone and Ipad succes. Android is growing, but still not even the half of their main competitor (currently 26% marketshare). Microsoft has a lot to gain with their Windows 8 phone and tablet. See for more:   //