I have a number of rows to update/insert to a SQL Server database using TableAdapter
s. Is there a way to batch them together, so that while it's still a list of UPDATE
statements, at least it's only one remote call to the database?
If I was writing SQL manually, it would be a single SqlCommand
object with a CommandText
that looks something like this:
update mytable set col = val where id = 1
update mytable set col = val where id = 2
update mytable set col = val where id = 3
...
update mytable set col = val where id = 432
Then I would just call SqlCommand.ExecuteNonQuery();