Someone at work asked this question so I spent five minutes and banged out this code. If it helps one person, it probably will help many so here it is.... --------- Demo Removing Duplicate rows in a DataTable ---------------- using System; using System.Data; using System.Collections; namespace Demo_DataTableRemoveDupRows { class Class1 { [STAThread] static void Main(string[] args) { // create an example datatable with duplicate rows DataTable tbl = new DataTable(); tbl.Columns.Add("ColumnA"); tbl.Columns.Add("ColumnB"); ......
Someone asked me a question about coercing hex values greater than int.MaxValue into signed ints.... Basically they were wondering if there was a type suffix to mark the hex as a signed int so it would be read by the compiler as a negative number.... there isn't. The way to do this is to use the unchecked statement and cast the uint value as an int..... I wrote the below code to demonstrate, and as I haven't seen anything quite like this out there I'm posting it..... If it helps you drop me a comment ......