developer155
Programmer
Ji I have a situation in the data layer that requires an update stored proc to be executed against db many times in a loop liek this:
for (int c= 0; c< users.People.Rows.Count; c++)
{ DBCommandWrapper cw = _db.GetStoredProc("dbo.AddPersonToPeople");
database.ExecuteNonQuery(cw);}
So the proc will be executed mutiple times, sometimes hundreds. Is there a way to batch all the statements either on ASP.NET side or SQL server side(i.e. stored proc that accepts parameters array, etc.)? Whats the best approach. I definately want to run this once
thanks!
for (int c= 0; c< users.People.Rows.Count; c++)
{ DBCommandWrapper cw = _db.GetStoredProc("dbo.AddPersonToPeople");
database.ExecuteNonQuery(cw);}
So the proc will be executed mutiple times, sometimes hundreds. Is there a way to batch all the statements either on ASP.NET side or SQL server side(i.e. stored proc that accepts parameters array, etc.)? Whats the best approach. I definately want to run this once
thanks!