To create a DataTable programmatically you have to initialize a new To add rows to a DataTable, you must first use the NewRow method to Net · Jquery to Get Read DatakeyNames value of GridView Selected Rows in Asp.Net C# VB.