Module Module1 Sub Main()'Datatable is the collection of rows and columns. Dim dt As DataTable Dim col As DataColumn Dim row As DataRow dt = New DataTable col = New DataColumn'Caption indicates the heading of the column col.Caption = "ID"'Autoincrement will increase the value whenever row is added in the table. col.AutoIncrement = True'AutoIncrementSeed means starting value of the column col.AutoIncrementSeed = 1'AutoIncrementStep means increasing value if starting is 1 and step is 2 then it will increase as 1,3,5 and so on. col.AutoIncrementStep = 1'Columns.add(col) will add the column inside the datatable. dt.Columns.Add(col)'After adding the col in datatable dispose will the delete the column and free the memory. col.Dispose() col = Nothing col = New DataColumn col.Caption = "Name"'Datatype will set the datatype for the particular column col.DataType = System.Type.GetType("System.String") dt.Columns.Add(col) col.Dispose() col = Nothing col = New DataColumn col.Caption = "Address" col.DataType = System.Type.GetType("System.String") dt.Columns.Add(col) col.Dispose() col = Nothing 'To show headings of the columns Dim i As Integer For i = 1 To dt.Columns.Count - 1 System.Console.Write(dt.Columns.Item(i).Caption)' ControlChars.Tab will give the gap of one tab. System.Console.Write(ControlChars.Tab) Next System.Console.WriteLine() 'To insert data in the virtual table For i = 1 To 10 row = dt.NewRow row.Item(1) = "ABC" & i row.Item(2) = "XYZ" & i dt.Rows.Add(row) Next Dim j As Integer'Outer loop is used for the rows. For i = 0 To dt.Rows.Count - 1'Innser loop is used for the columns. For j = 0 To dt.Columns.Count - 1 System.Console.Write(dt.Rows(i).Item(j)) System.Console.Write(ControlChars.Tab) Next System.Console.WriteLine() Next End SubEnd Module