DynDeveloper.com

DynDeveloper.com

Sign Up Now! Log In
DavidM 3/31/2015 10:21:43 AM

Inserting a row at the top of a datatable

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

When I populate dropdownlists, I frequently want to add a new row at the top. I've figured out that you can easily add one at the bottom with DataTable.Rows.Add(), but that's... not elegant. This article is just a few lines of code that shows how to add one at the top.

Why bother blogging such a simple piece of code?

RAD.

I want to code quickly and efficiently and I can do that best if I have all the code samples that I needs at my fingertips instead of having to wade through endless blog entries. (some of which are innacurate)

Are you using the menus? Any subjects we can add? Tutorials

Version: Unknown or N/A
Section: .NET Development