I have a form with a textbox and a \"add\" button.
Here is an example of adding a new row to a datatable that uses AutoIncrement on the first column:
Define the table structure:
Dim dt As New DataTable
dt.Columns.Add("ID")
dt.Columns.Add("Name")
dt.Columns(0).AutoIncrement = True
Add a New row:
Dim R As DataRow = dt.NewRow
R("Name") = txtName.Text
dt.Rows.Add(R)
DataGridView1.DataSource = dt