stevegray
4Penny.net
Points: 61759

3/16/2026 6:51:55 AM

Adding a line to a DataTable using DataTable.ImportRow

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

When you’re working with DataTables in .NET, copying rows between tables sounds trivial—until you run into schema differences, missing defaults, or values that mysteriously refuse to come along for the ride. That’s where DataTable.ImportRow earns its keep. It provides a safe, reliable way to clone an existing DataRow—preserving its state, values, and version information—and insert it into another table with the same structure.

This article provides a quick code example of how to use ImportRow

Please follow the link at the top of the page to the .NET Development menu page and familiarize yourself with how these articles are stored by technology. That way you can find it when you need it.

4Penny.net
Version: All
Section: .NET Development
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3