Kevin,
Just use add parameters with range. In your other thread I posted code that does exactly that - receives parameters collection.
>This is a bit long but....
>
>I have a stand-alone SQLDataAccess class which contains generic methods for calling into MS Sql. It is generic enough so that I can use it in most of my apps.
>
>In my app have an AppDataAccess class for handling data access within my app. It is simply a wrapper for calls to the SQLDataAccess and contains specific methods for the stored procedures I will be calling.
>
>My SQLDataAccess has a method called 'ExecuteQueryProc' which takes as a parameter a collection class which holds instances of a Params class I wrote which simply mirror SqlParameters.
>
>So in AppDataAccess I create as many Param classes as I need, set their parameters, then add them to the Params collection class, which I then pass this to ExecuteQueryProc in SQLDataAccess :
>
>
>
>// SQLDataAccess. ExecuteQueryProc
>public DataSet ExecuteQueryProc(ProcedureParams oParams)
>{
>DataSet oDataSet = new DataSet();
>
>SqlConnection oConn = GetConnection(true);
>
>if (oConn != null)
>{
> SqlCommand oCommand = new SqlCommand(oParams.sProcedureName, oConn);
> oCommand.CommandType = CommandType.StoredProcedure;
>
> foreach (Param oColParam in oParams.Params)
> {
> SqlParameter oParam = new SqlParameter();
>
> oParam.DbType = DbType.Int32;
> oParam.Direction = ParameterDirection.Input;
> oParam.ParameterName = oColParam.sParameterName;
> oParam.SourceColumn = oColParam.sSrcColName;
> oParam.SqlDbType = SqlDbType.Int;
> oParam.Value = oColParam.Value;
>
> oCommand.Parameters.Add(oParam);
>
> oParam = null;
> }
>
> SqlDataAdapter oAdapter = new SqlDataAdapter();
> oAdapter.SelectCommand = oCommand;
> oAdapter.Fill(oDataSet);
>
> return oDataSet;
>}
>return oDataSet;
>
>
>Ok, here's the problem. If I code each param individually using native ADO code, I get a data set back. If I use this code above, I get no records. I have walked it through a few times and I cannot see what the problem is. The data being set on the oParam object all appear to be ok.
>
>Anyone wanna take a stab it this?
If it's not broken, fix it until it is.
My Blog