Monthly Archives: April 2011

C#: String Extension to Replace Accented Characters

Have you ever wanted to replace “accented” characters in a string with their equivalent English character?  Here’s a string extension that replaces these diacritics within a string for C# 2.0 and up:   public static string ReplaceDiacritics(this string source) { … Continue reading

Posted in ASP.Net, C# | 4 Comments

T-SQL: Rebuild all user table indexes dynamically

The more complex the schema, the more indexes you probably have on your tables. Here’s some T-SQL to rebuild all those indexes without having to write out the SQL for each one.   DECLARE @TABLE VARCHAR(255) DECLARE @cmd NVARCHAR(500)   … Continue reading

Posted in T-SQL | Leave a comment

IT Toolbox: TechNet Magazine April 2011

The April IT Toolbox column is up on the TechNet Magazine website. This month I covered these two tools: NetLimiter 3 Pro: Control your bandwidth DigiScope for Exchange: Useful 3rd party tool for Exchange Server Check it out and let … Continue reading

Posted in Microsoft TechNet | Leave a comment

jQuery: Global AJAX Error Handler

Here’s a quick and dirty way to handle AJAX errors globally if you are using jQuery:   $(document).ready(function () { $.ajaxSetup({ error: function (x, e) { if (x.status == 0) { alert(’Network error’); } else if (x.status == 404) { … Continue reading

Posted in JavaScript, jQuery | Leave a comment

JavaScript: Quickly Trim the Last Character from a String

When developing web applications, you undoubtedly have wanted to remove the last character from a string (such as a URL or application path)  in your JavaScript code. Here’s a quick way to get it done using the JavaScript function slice():   var … Continue reading

Posted in JavaScript | Leave a comment