For creating a Data Table you first create an instance of the Data Table class, and then add Data Column objects that define the type of data to be held and insert Data Row objects that contain the data.
The following code demonstrates the creation of a data table://Create the Data Table named "Order"Data Table order = new Data Table ("Order"); Using this code you are creating an empty data table for which the Table Name property is set to Order.
The following example shows how to enumerate through the rows and columns of a data table.
A Data Table object represents tabular data as an in-memory, tabular cache of rows, columns, and constraints. Other objects that use the Data Table include the Data Set and the Data View.The Add method is also overloaded to accept an array of objects instead of a Data Row object.The following sample demonstrates how to create and add data into the order Data Table object: Note : nothing has been permanently stored to a database.After that, you set Auto Increment Seed to the value of the first number you want and set Auto Increment Step to the value you want to increment each time a new row is added.The following example shows how to set the Auto Increment, Auto Increment Seed, and Auto Increment Step properties.