Geeks With Blogs
Andy Johns' Blog Andy's twisted brain.... June 2004 Entries
How to remove duplicate rows from a DataTable....
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"); ......

Posted On Thursday, June 24, 2004 10:52 AM

Unchecked and Signed/Unsigned Ints
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 ......

Posted On Monday, June 7, 2004 9:02 PM

Copyright © Andy Johns | Powered by: GeeksWithBlogs.net