Dim myconn As New SqlConnection("Data Source = localhost\\SQLEXPRESS;
Initial Catalog = test2Forms; Integrated Security = SSPI;")
Dim myTable As New DataTable()
Dim myCmd As New SqlCommand()
WithActivityLog3TableAdapter.Fill(_dbo_withActivityLog3DataSet.withActivityLog3)
myCmd.CommandText = "SELECT * FROM dbo.withActivityLog3 WHERE ID = @ID"
myCmd.Connection = myconn
Dim myAdapater As New SqlDataAdapter(myCmd)
SqlDataAdapter1.Fill(myTable)
DataGridView2.DataSource = myTable
Do you not see an issue with this:
Dim myAdapater As New SqlDataAdapter(myCmd)
SqlDataAdapter1.Fill(myTable)
You set the CommandText
of myAdapter
and then call Fill
on SqlDataAdapter1
.