Is this even possible with the command object? I need to change this piece or code to run a proc (sp_insertRecord) multiple times for the set of Parameters (created from the Records List object) in the same connection based. Right now it creates comma separated insert script and executes all at once. Team Leader suggested call the stored procedure and parameters with semicolon separating them at once. How do I do this as the Leader adviced instead of calling everything in the loop that executes for each set of the Records object. Thats the only way I can think.
sql.Append(first.GetSqlInsertStatment());
Records.ForEach(a => sql.Append(CreateInsertValuesCommaSeperated()));
sql.Length -= 2;
using (var connection = GetDbConnection())
using (var cmd = connection.CreateCommand())
{
cmd.Connection.ChangeDatabase(schema);
cmd.CommandText = sql.ToString();
cmd.ExecuteNonQuery();
}