Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Most efficient way to run several SQL statements
  2. using(SqlCommand cmd = conn.CreateCommand())
  3. {
  4.     cmd.CommandType = CommandType.Text;
  5.     cmd.CommandText = @"
  6. exec YourProcedure @param1;
  7. exec YourProcedure @param2;
  8. exec YourProcedure @param3;";
  9.  
  10.     cmd.ExecuteNonQuery();
  11. }