Windows shutdown command line

The following article gives a detail list of command line statements that can be used with the Shutdown command. The following snippet shows how to restart a remote computer

Shutdown /m \\computername /r


HTML Codes

The following article lists all of the HTML codes that can be used in a web page to represent special characters.


C# 3.5 – Code Snippets

In the intellisense list certain options will appear that state they are code snippets, e.g. foreach. To get the snippet to actually insert press TAB twice.

See MSDN for more details


VB.Net – ControlChars

If you need special characters in your VB.Net use the ControlChars class, it has definitions for Lf, Crlf, etc.

See MSDN for more details


Forcing Data Types on literal constants

The following type characters can be used to force a literal value to be a certain data type


"a"c 'Char
#1/1/1900# 'Date
0D 'Decimal
0@ 'Decimal
0.0R 'Double
0.0# 'Double
0I 'Integer
0% 'Integer
0L 'Long
0& 'Long
0S 'Short
0.0F 'Single
0.0! 'Single

See MSDN for more details


SQL Grant Execute

Found an article that had a nice SQL script to assign execute permissions to a user in SQL2000

Here is the script

DECLARE @sql nvarchar(4000)

DECLARE @db  sysname ;
SET @db = DB_NAME()

DECLARE @u   sysname ;
SET @u = QUOTENAME('')

SET @sql ='select ''grant exec on ''
        + QUOTENAME(ROUTINE_SCHEMA) + ''.''
        + QUOTENAME(ROUTINE_NAME) + '' TO ' + @u
        + ''' FROM INFORMATION_SCHEMA.ROUTINES ' +
        'WHERE OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME),''IsMSShipped'') = 0'

EXEC master.dbo.xp_execresultset @sql,@db


TryCast – better than DirectCast?

In VB.Net Framework V2.0 a new command was introduced called TryCast It works the same as DirectCast but if the cast fails instead of throwing an exception the object is set to Nothing

Take a look at MSDN for more details.


Next Entries