Archive for '.NET Programming' Category
How To Convert from a .NET Int32 to EBCDIC Signed Integer
Many of us have had to write data exports from our PC based management systems that are in some strange formats. Signed Integers (which smells of COBOL and EBCDIC on a main frame) are no exception. Now I know all you Computer and Mini Computer (mid range) guys out there are like ‘strange format’? YOUR [...]
Creating a ASP.NET Rounded Panel
These days using a Rounded Panel on your web site is almost a given. Here is an example to creating a Rounded Panel that inherits from System.Web.Ui.Panel, in a WebControls class library. First thing I did was fire up Jasc Paintshop Pro and created some rounded rectangles (with a 4px radius) … then I cut [...]
ADO.NET Entity Framework
I just started reading Programming Entity Framework The subjects include: Data Binding with WPF, LINQ to Entities Queries, Utilizing the ASP.NET EntityDataSource Control, Using Entity Objects with Web and WCF Services, Using the Entity Framework with n-Tier Windows Forms or WPF Applications, a bit on Data Transfer Objects (DTO), Customizing Entities, Using the Entity Framework [...]
LINQ, SqlMetal, Nesting The Generated Code File
LINQ is really cool, SqlMetal has been my code generator of choice (for a book on LINQ, SqlMetal and all of the cool new features)… I like to keep my class file names the same as the class contained in the file. Since SqlMetal generates partial classes, and we don’t want to modify the generated [...]
Excel ODBC Driver for Windows Server 2008 (64 Bit)
So I’m running Windows Server 2008 as a development workstation. I ran into some trouble with a custom .NET application that imports data from Excel files using the ODBC driver. Error Message in .NET ERROR [IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified We are using this ODBC [...]
HowTo Filter System.IO.Directory.GetFiles with Linq
Here we are going to see an easy way to enumerate files in a directory, filter the files with Linq, then bind the results to a ASP.NET repeater control. We will show you the old .NET 1x way of doing this, then the new and improved Linq way of doing this. I had a method [...]
.NET 2.0 Generic Collections to 1.0 and 1.1 Collections
I am always looking around for the Generic equivalents for the non-generic collections. Especially when converting 1.1 code over to 2.0 .comptable td { border-bottom: 1px solid #008000; background-color: #ebf7ff; } .comptable .name { background-color: #a8cece; } Table of Generic Collections to Non-Generic Collections Non-Generic (1.x) Generic Replacements (2.0+) ArrayList List<T> CollectionBase Collection<T> Comparer Comparer<T> [...]
HOWTO obtain the ClickOnce Version at runtime
This article will show you how to get the ClickOnce Version at runtime of you .NET application. My examples are in VB.NET and C# but the same technique would work for any other .NET Assembly. First you need to add a project reference to System.Deployment Next import the namespace into your class VB.NET Imports System.Deployment [...]
Publishing a .NET ClickOnce Application to a linux Apache Server
You might think that you can only publish a ClickOnce application to a IIS server. This is in fact not the case, you CAN publish a ClickOnce application to a apache web server either running on Linux or Windows. In fact its pretty simple. Configure your apache publish directory for ClickOnce applications At the root [...]
Getting the First and Last day of the month with .NET C#
Ok so now you know how to get the last day of the month with SQL, but how can you get the first day or the last day of the month given a specific date? That problem is so simple with dot net and csharp! There is a convenience constructor for the DateTime object that [...]