G
Guest
What is the diffeence bewtween a dataAdapter.InsertCommand and
dataAdapter.SelectCommand (and dataAdapter.UpdateCommand for that matter)?
Dim da As SqlDataAdapter
conn.Open
da.SelectCommand = New SqlCommand
da.SelectCommand.Connectoin = conn
da.SelectCommand.CommandType = Command.Text
da.SelectCommand.CommandText = "insert Into tbl1 Select * from tbl2"
da.SelectCommand.ExecuteNonQuery
Or
Dim da As SqlDataAdapter
conn.Open
da.InsertCommand = New SqlCommand
da.InsertCommand.Connectoin = conn
da.InsertCommand.CommandType = Command.Text
da.InsertCommand.CommandText = "insert Into tbl1 Select * from tbl2"
da.InsertCommand.ExecuteNonQuery
Is there any differece between these 2 dataAdapters? It looks to me like
they both perform the same operation.
Thanks,
Rich
dataAdapter.SelectCommand (and dataAdapter.UpdateCommand for that matter)?
Dim da As SqlDataAdapter
conn.Open
da.SelectCommand = New SqlCommand
da.SelectCommand.Connectoin = conn
da.SelectCommand.CommandType = Command.Text
da.SelectCommand.CommandText = "insert Into tbl1 Select * from tbl2"
da.SelectCommand.ExecuteNonQuery
Or
Dim da As SqlDataAdapter
conn.Open
da.InsertCommand = New SqlCommand
da.InsertCommand.Connectoin = conn
da.InsertCommand.CommandType = Command.Text
da.InsertCommand.CommandText = "insert Into tbl1 Select * from tbl2"
da.InsertCommand.ExecuteNonQuery
Is there any differece between these 2 dataAdapters? It looks to me like
they both perform the same operation.
Thanks,
Rich