May 2011
-
OrderBy Column Name as String using Linq C# .Net Dynamic Sorting of Anonymous Types
If you’re familiar with Linq, you have undoubtedly used the popular “OrderBy” extension method. Unfortunately, this method does not accept a string value with the column name. To resolve, you can add the following small class or just the method… Continue reading
-
Calendar Extender Highlight Current Day in C# .Net
Thanks goes to Karan from asp.net blogs. References ASP.Net (blogs), http://weblogs.asp.net/karan/archive/2010/09/20/calendar-extender-today-s-date.aspx Continue reading
-
Copy File With Update Progress in .Net
The process of copying a file in .Net is of course very simple and straightforward. If you want to copy multiple files and update the end user on the progress of a large file copy, or copy files asynchronously while… Continue reading
-
Render PDF Reports in .Net Web or Winforms
One thing to note – render is not the same as draw. This article assumes you are using purely .Net for reporting purposes. If you are using C1, Telerik, Crystal Reports or some others, these examples are not included, although… Continue reading
-
With Statement in C# .Net
If you’re stumbling across this article, chances are you may be looking for a replacement for VB .Net’s “with” statement. Sadly, there is no exact replacement, but there are alternatives which are equally helpful. Given a basic class “Robot” below:… Continue reading
-
C++ Cheat Sheet and Quick Reference Guide
The Tools To compile and test code on Windows, my recommendation would be using: Microsoft Visual Studio 2008/2010 Express Editions (ask your instructor about full versions) On an older Windows box (if it’s not quad core), you might want to… Continue reading
-
Download File with Update Progress in .Net
Next best thing to wget on Windows. 😉 VB C# (note this is autoconversion and actual project is in VB): Continue reading
-
Get Current Process ID in C# .Net
References MSDN (GetCurrentProcessID), http://msdn.microsoft.com/en-us/library/ms683180(v=vs.85).aspx MSDN (GetCurrentProcess), http://msdn.microsoft.com/en-us/library/system.diagnostics.process.getcurrentprocess.aspx Continue reading
-
AppActivate In C#
Note: This code was only tested on Windows 10. AppActivate, which many of you may recognize from VB activates a window for an application which is already running, bringing the window of that app to the foreground. In C#, there… Continue reading
-
Start a Process in the Foreground in C# .NET without AppActivate
In my particular scenario, I was using System.Diagnostics.Process to start another application, compiled separately, which communicated with the original app which launched the process and used Windows inter-process communication (IPC) to share information across applications using my own protocol. I… Continue reading