using System.Data; using System.Linq; DataTable dt = ds.Tables[0]; DataView dv = new DataView(dt); string cols = string.Empty; foreach (DataColumn col in dt.Columns) { if (!string.IsNullOrEmpty(cols)) cols += ","; cols += col.ColumnName; } dt = dv.ToTable(true, cols.Split(',')); ds.Tables.RemoveAt(0); ds.Tables.Add(dt);
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language.
Wednesday, June 20, 2012
Remove duplicates from a datatable..
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment