bloukewer said:How do you insert a row into a table object? I need to read data from the database into a table and then add a row of custom data into the table-object. Any examples would be great!
Dim da As New SqlDataAdapter("select * from employees", cn)
Dim dt As New DataTable()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
da.Fill(dt)
DataGrid1.DataSource = dt
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dr As DataRow = dt.NewRow
dr(0) = TextBox1.Text
dt.Rows.Add(dr)
End Sub