Split SQL Strings

If you have a need to parse a string array passed in as a variable into say a stored proc, use the following function to split it: CREATE FUNCTION dbo.fnSplit( @sInputList VARCHAR(8000) — List of delimited items , @sDelimiter VARCHAR(8000)…

How to programmatically turn on the Numlock Key

The following code will allow you to turn on the numlock key upon startup. Can’t credit anyone as i’m not sure where it came from but it does work 100% using System; using System.Runtime.InteropServices; class SetNumlockKeyOn { [StructLayout(LayoutKind.Sequential)] public struct…

Deleting elements from XML Documents

If you need to delete either a Node, Element or Attribute from your XML document, try the following code as it actually works!!! XML Document Structure <?xml version=“1.0” encoding=“utf-8” standalone=“yes“?> <!–XML Config file–> <Tests> <Test> <ID>47d272cd-877d-4d0f-ad4a-cfa31200d966</ID> <Object>Obj1</Object> <TestType>Fail Yes</TestType> <Command>fail…

The end of an era – Windows 3.x

Windows 3.x established the look of the operating system. An application has expectedly quit. Windows 3.x has come to the closing moments of its long life. On 1 November Microsoft stopped issuing licences for the software that made its debut…

Using KeyPreview to handle form shortcut keys

If you need to trap shortcut keys in your application to perform misc tasks, use the following code to set KeyPreview to true and then in the KeyDown event handle the actual clicks:  private void Form_OnLoad(object sender, EventArgs e) {…