Convert WPF InkCanvas to Bitmap

We live in a digital age and if you are like me, paper is only used when it is absolutely unavoidable. If you have a tablet PC, signing your name to attach it to a document may be one less thing you will need a physical sheet of paper for.

The WPF ink control can be put into your XAML to collect stylus strokes as a collection of geometry points. Of course, as the stylus moves, the movements are also shown on screen.

SQL Bitwise Mask Example

.NET Binary Numbers

The following code snipit will get you all of the binary numbers from zero to fifteen:

.NET Code To Set OpenFileDialog Initial Folder With a String

This code uses a string to set the initial folder of an OpenFileDialog.

.NET Script to Find Work Week Start and End

If you need to find the Monday of a given week or a Friday of a given week, this is the solution for you:

SQL Script to Find Work Week Start and End

If you are looking for the Monday that starts a work week and/or the Friday that ends the work week, this is how you do it in SQL:

SQL Script to Find Last Day of the Month

This Microsoft SQL script figures out what the last day of the month is (28, 30, or 31) so that you don't have to recite the "30 days has September, April, May, and November..." poem or do the "knuckle trick."

Microsoft SQL Reporting Services URL Query Parameters and Commands

There are several parameters that can be passed in to the SRS Report viewer through query string parameters. Some of them are listed below:

Change the way it is rendered:
rs:Command=Render& (4 types of re:Commands)

Pass in parameter values:

Control the type of output:

Control what toolbar(s) show in the viewer:


.NET Class to Export Query Results to Microsoft Excel

This class uses an ODBC connection to create an Microsoft Excel Workbook from the results of a Microsoft SQL query.

.NET Class to Read XML Config File

There are some instances where you may need your dll to have its own .config file. Of course, the .NET framework only uses a config file for the executing assembly (exe's) and not satalite assmeblies (dll's). Here is a class that can be used to read an XML file that follows the .config file schema: