My CTTDNUG presentation slides and source files

I have published my slides and source files on An Introduction to Configuring and Extending Umbraco CMS from my presentation to Canada’s Technology Triangle .NET User Group (CTTDNUG). The slides are also available on SlideShare.

Please contact me if you have any follow up questions.

My CTTDNUG presentation on Configuring and Extending Umbraco CMS

My presentation, An Introduction to Configuring and Extending Umbraco CMS, to Canada’s Technology Triangle .NET User Group (CTTDNUG) is just five short days away on Wednesday January 25, 2012.

The presentation will be at the Manulife Financial building in Kitchener, Ontario from 6:30 to 8:30 pm. At the end of the talk there will be raffle draws for Umbraco items as well as additional products from our group sponsors.

Umbraco is a free, open source content management system (CMS) that was launched in 2004. Since then it has grown into one of the premier CMS solutions available to ASP.NET developers. Umbraco is primarily written in C#, stores data in a number of relational databases (commonly Microsoft SQL Server) and works on Microsoft IIS.

This session will provide an overview of how easy it is to get up and running using Umbraco. Through an IIS web deploy, a developer can create a basic site in minutes. Demos in this session will extend the usability of the basic site by integrating existing ASP.NET functionality like User Controls to develop reusable components that can be used in future projects. A discussion of document types, data types, templates, XSLT Files, and stylesheets will round out what you need to get you started with Umbraco.

Please register for this event through the following link.

Note that you need to log into the CTTDNUG site to register. If you aren’t a registered member, click the Register link in the top right corner and follow the steps. Registration is FREE!

Feel free to contact me if you need additional information.

Set debug=”false” in production ASP.NET applications

I was reminded of this little axiom the other day when I deployed a site that was pretty slow. It is one of those things that I usually remember to do but once in a while forget.

In case you are not sure as to why this should be standard operating procedure (SOP), then take a look at this blog article (Don’t run production ASP.NET Applications with debug=”true” enabled) by ScottGu. He does a lot better job at explaining it than I can do.

Using Statements to wrap your database connections

In yesterday’s piece entitled Using Regular Expressions (Regex) to find all your SqlConnection strings I wrote about the fact I was trying to use  a regex string to find all my SqlConnection declarations.

In the piece I made mention of the fact that the using statement are becoming the defacto way of wrapping your connections. I first heard about this in the James Michael Hare series of articles C#/.NET Little Wonders – All The Wonders In Their Glory

The using statement is not the same as the using declarations at the top of your code behind files. Instead, they are used to wrap pieces of code so that they will call IDisposable as soon as they go out of scope.

So, instead of forgetting to call dispose on your SqlConnection instances and running the chance of having some connection pooling issues, we can use the following to instantiate our objects:

using statement

As you can see I have wrapped the code in a using block with both brackets and curly braces. I don’t have to use any try/catch statements nor do I have to explicitly dispose of my connection object. The using statement will call the Dispose() method as soon as it is out of scope – either when it completes or if it encounters an error.

So, check out using statements. They will make sure you never have to worry about closing out your connection strings and they will make your code a little bit neater.

Using Regular Expressions (Regex) to find all your SqlConnection strings

I was looking through some inherited code and there were some connection strings spread out throughout the project. Now because I try to make sure everything is closed in good order I needed a way to find where each was declared. I could change them all to using Statements but that just seems like a lot of work.

Instead, I found this nifty little piece of regex syntax that allows you to search through your connection strings:

new:Zs*(System.)*(Data.)*(SqlClient.)*SqlConnection(\([0-9a-zA-Z]*\))

In Visual Studio 2010 hit Ctrl+F and place the string in the Find what: textbox of the Find and Replace dialog box. Make sure to click the Use checkbox at the bottom and select Regular expressions. Also, make sure there are no trailing spaces after the last bracket or else it will not work. Click Find Next and voila. The nice thing about this is that it will find them if they are declared explicitly or not.

Find SQlConnection string with regex

Follow

Get every new post delivered to your Inbox.