Try
Dim dr As DataRow
Dim dt As New DataTable
Dim ds As New DataSet
dr = ds.Tables(0).NewRow
dr.Item("FirstName") = txtCol1.Text
dr.Item("LastName") = txtCol1.Text
ds.Tables(0).Rows.Add(dr)
Catch ex As SqlException
ex.Message.ToString()
End Try
----- William Ryan eMVP wrote: -----
DataRow dro = DataSet.Tables[Index].NewRow();
//Set the values accordingly, I'm using Strings and an Int, but you should
use values that match the columns of your datatable.
dro[0] = "FirstValue";
dro[1]= "SecondValue";
dro[2] = SomeIntValue;
DataSet.Tables[Index].Rows.Add(dro);
Obi Oberoi said:
How do you add a new row to the datagrid windows control one row at
a time
without overwriting the existing row ?