I have a collection of files, for each file I am going to call an SP using Dbcommand in a transaction.
for example:
DbCommand insert = db.GetStoredProcCommand("Insert");
db.AddInParameter(insert, "FileName", System.Data.DbType.String,
ID + ".xml");
db.ExecuteNonQuery(insert, transaction);
My question is how do I put this in a loop?
The answer below doesn't work, but thanks for the otherwise great code sample. Problem is db doesn't have a Parameters collection that you can manipulate. check...
I am declaring my database like this:
SqlDatabase db = new SqlDatabase(this.ConnectionString );