You can take advantage of the fact that SQL Server 2008 now supports table types. You can determine the type of table and the construction of the .net a side DataTableand pass this as a parameter to your stored procedure. On the SP side, this parameter is of the type [any type of table you made] Here is an example.
TotalPositions = [Some List]
DataTable Positions = new DataTable();
Positions.Columns.Add("PositionID", typeof(int));
foreach (string sPos in TotalPositions.Split(','))
Positions.Rows.Add(int.Parse(sPos));
SqlParameter Param = new SqlParameter();
Param.Value = Positions
Param.SqlDbType = SqlDbType.Structured;
Param.ParameterName = @Positions
command.Parameters.Add(Param);
CREATE TYPE [dbo].[Positions] AS TABLE(
[Position] int NULL,
)
GO
@MyPositions Positions Readonly
@MyPositions .