How-to: Use Microsoft SQL Server Functions in your CodeSmith Generator Templates

CodeSmith Generator now supports Microsoft SQL Server Functions and Microsoft SQL Server CLR Functions with the release of CodeSmith Generator 5.2 . I will quickly show you how to add Microsoft SQL Server Function support to your CodeSmith Generator template. The first thing you need to do in order to use SQL Functions is to set the IncludeFunctions Property on any type that derives from SchemaObjectBase . The following property types are capable of showing functions when you add the IncludeFunctions="True" setting to the property: CommandSchema , CommandSchemaCollection and DatabaseSchema...

How-to: Build a custom UITypeEditor

Recently, I built a CodeSmith Generator sample UITypeEditor that allows a user to enter in custom data into a DropDownList. In the following article I’ll show you what you need to do in order to build your own UITypeEditor. First you need to create a public class that will hold the data of the drop down list. In this example I named my class DropDownListProperty. public class DropDownListProperty { } Next we will need to add the properties and the constructors. public class DropDownListProperty { private List _values = new List (); public DropDownListProperty() { SelectedItem = "None";...

It's the littlest of things that we do, that make CodeSmith Generator shine.

During each release of CodeSmith Generator , one thing we always do is test upgrade scenarios between each versions and check for backwards compatibility among other tests. Recently, I was amazed at how much change has taken place between CodeSmith Generator 4.x and the latest CodeSmith Generator 5.1.x release when it comes to the user interface. CodeSmith Generator has made a huge effort to make CodeSmith Generator rock solid, crazy fast, and easy to use. I’d like to give everyone a quick inside look as to how I think CodeSmith Generator has accomplished this. Our goal from the beginning...

CodeSmith Generator CSLA Templates v1.0 released!

Over a week ago we released our new CodeSmith Generator CSLA Templates . I highly recommend everyone that uses CSLA to try them out as they will save you a ton of time. Also you'll notice very quickly that it follows the CSLA best practices and has other features that you have been looking for like a working Data Access Layer (DAL). The best part is that you won't have to worry about learning something new (the generated code) if you are already familiar with the CSLA Framework . Noteable features: Working data access layer with concurrency support. Support for completely overriding the...

How-to: Debugging CodeSmith Generator on Microsoft Windows 7

We have updated the Tips & Tricks: Debugging CodeSmith Generator with the changes needed to debug CodeSmith Generator on Microsoft Windows7 . Here is the quick overview of what you need to-do to enable debugging on a Microsoft Windows 7 machine: Update the Just-In-Time debugger setting DbgJITDebugLaunchSetting . The setting is found in the registry at [ HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework ]. Set the value of DbgJITDebugLaunchSetting to 2. If you are using a 64bit operating system then you must also set the same key ( DbgJITDebugLaunchSetting ) in this folder [ HKEY_LOCAL_MACHINE...

CodeSmith Generator CSLA Templates Part 2: The Quick Start

In Part 1: The Introduction was an overview of the CodeSmith Generator CSLA templates we are developing at CodeSmith . In this post, I am going to go over how to use the CSLA quick start and the new improvements resulting from customer feedback (Keep the feedback coming!). First launch CodeSmith Generator Studio and under the Frameworks node open the CSLA Folder. There are a couple of folders in the CodeSmith.CSLA folder Folder Name Description Common Contains the supporting CSLA assemblies and the Visual Studio templates to create the project. CSharp Contains the C# templates. Source Contains...

A fix for the Microsoft .Net Framework 3.5 SP1 Fatal Execution Error (VS Silent Death Bug).

We released CodeSmith Generator 5.1 with the new requirements of the Microsoft .Net Framework 3.5 . One of our experiences in upgrading to the .Net Framework 3.5 is issues we have run into like our customers reporting Visual Studio disapearing or closing extremely quick when they try to generate code using CodeSmith's Visual Studio Integration. The following link Tools - Part 11 - Add-ins - Attempting to work around the “VS Silent Death” bug) describes this issue in detail. Since his blog content is currently offline I’ll quote his content. One very annoying and elusive problem...

How-to: Register a keyboard shortcut (hot key) in a .NET Windows Forms Application.

There may come a time when you want to implement some extra features or maybe an Easter egg into your application using keyboard shortcuts. I was recently tasked with creating an Easter egg so we could test some functionality in CodeSmith. After countless searches looking for an elegant solution (I found a few ugly solutions and some nicer ones) I came across Method #3. I’ll First touch on the one I didn’t choose to go with. Method #1 The following code block will make an unmanaged call to the user32.dll to register the hotkey. I would never go this approach, but if you were like me...

How-to: Clear cached contacts from Microsoft Outlook.

A long time ago we needed a script to remove the cached contacts in Microsoft Outlook. After some research we found that these were stored in a NK2 file in the user profile directory. To run the script please close Outlook and create a new batch file (text file with the extension of .bat), or download the file below. Please not this will create a backup of the NK2 file so everything can be reverted. @ECHO off TITLE Clear the nickname automatic completion caches in Outlook CLS ECHO Clearing the nickname automatic completion caches in OutLook... ECHO Created by Blake Niemyjski ( http://windowscoding...

Microsoft Visual Studio 2010 Beta 1 is coming to MSDN on May 18th.

So far I have been very impressed with the CTP builds of Microsoft Visual Studio 2010 . There are some really welcoming changes that are apart of Visual Studio 2010 like UI Unit tests and a completely new IDE written in WPF. The only area where I thought was lacking was the responsiveness of the application. Last night a few members of the Visual Studio team announced that one of there main goals for Beta 1 and RTM is on Performance. I am very excited to hear this. "During these last weeks we’ve made a lot of progress, I’m sure you’re going to feel the product is a lot snappier...