180 posts

“Setup cannot copy the file staxmem.dll” error when installing IIS on XP

When I tried to install IIS on my laptop which is running Windows XP Pro SP2, I got this error during the installtion: “Copy error Setup cannot copy the file staxmem.dl_. Ensure that the disk labeled ‘Windows XP Professional Service pack 2 CD’ is in the drive selected below, or provide the location where the file can be found.” After some search on the Internet, it turned out it is a very common error that […]

[WinForm] How to dynamically add a drop down list in datagridview control

Scenario: You need to dynamically add a drop down list in a DataGridView control in a WinForm. Requirements: The items of the drop down list are dynamically bound with data from database. Solution: 1. Connect to database and retrieve data into a datatable, i.e. dtRanks; 2. Create a DataGridViewCombBoxColumn, set necessary properties of the CombBox column, then add it to the GridView control: DataGridViewComboBoxColumn ranks = new DataGridViewComboBoxColumn(); ranks.DataPropertyName = “TestID”; ranks.Name = “TestID”; ranks.HeaderText […]

ConstraintException occurred when updating DataTable with TableAdapter

I have been using SqlDataAdapter and strong typed DataSet and DataTable in my projects in .NET 1.1 for quite some time and have not had any problems. Now, in .NET 2.0, SqlDataAdapter is replaced with TableAdapter, which is much easier than SqlDataAdapter to create a data access layer. When I played with it in one of my projects last week, I came across an exception error when updating a DataTable with TableAdapter. The error happens […]

System.ArgumentOutOfRangeException occurs when updating DataView object

I have been working on a project which involves sending out emails to our customers in the past week and came across a very interesting error with a DataView object. The application is required to send out batch emails once a day, so I created an email message queue table to store the outgoing email messages. After a message is sent, the column that stores the delivery status will be changed from 0 to1 so […]

Fedora Core 8 released

Although I am a developer on Windows platform, mainly with .NET framework, I still try to keep up with what is happening in Linux community. Among all the major Linux distributions, Fedora Core is my favorite, and Ubuntu comes next. One of the reasons that I like Fedora Core is there are many developers supporting it by building many useful applications for this distribution. Another feature of FC that attracts me is that it makes […]

From Bugzilla to OnTime

We have been using Bugzilla as our bug tracking system for quite a long time, but recently my department decided to switch to OnTime by Axosoft because it meets our needs better, for example, OnTime has the ability to separate defects from features and incidents, and to generate professional-looking reports, etc. After the decision was made, I was assigned to make the switch as smooth as possible. The biggest challenge I had was to find […]

HashTable, ListDictionary, and HybridDictionary

HashTable is ideal for creating lookup tables because it can very quickly find the value of an item from a large collection of items based on the item’s key. However, it may become an overkill if the collection is relatively small, say about 10 items or less, because of the overhead of HashTable. In this case, ListDictionary is a better choice than HashTable. ListDictionary is a simple implementation of IDictionary with a singly linked list. […]

WordPress 2.3 is out

Just before going to bed, I turned on my computer to check my emails and to check my blog stats, which is my daily routine before the day is out. I noticed that WordPress 2.3 is released. This version is named “Dexter” for the great tenor saxophonist Dexter Gordon. I am very excited about this new version, and cannot wait to upgrade my current version. Unfortunately, it’s about mid-night now, and I should be in […]

Missing hard drive space – Windows XP and 2003 Server

Here is the scenario: One day, you found your available hard drive space is very low, so you opened up Windows Explorer and selected all folders under C drive to see the total of the used hard drive space. You subtracted the total used space from the total hard drive space to see how much space you still have. Then you found a big and significant discrepancy between your calculated available space and the free […]