C# DbCommand in a loop
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?
C# DbCommand in a loop
===

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?