Here's what I came up with..
I was stuck on trying to figure out IDataParameterCollection which nobody seems to use...
List<IDbDataParameter> _SqlParameters = new List<IDbDataParameter>(); _SqlParameters.Add(CreateParameter("StorePK", tnStorePk, ParameterDirection.Input)); _SqlParameters.Add(CreateParameter("LanguageID", tnLanguageID, ParameterDirection.Input)); _SqlParameters.Add(CreateParameter("StoreMessageID", tnStoreMessageID, ParameterDirection.Input)); _SqlParameters.Add(CreateParameter("StoreMessage", DbType.String , ParameterDirection.Output)); _SqlParameters.Add(CreateParameter("bExternalFile", DbType.Boolean, ParameterDirection.Output)); int lnReturn = ExecuteStoredProcedureNonQuery("ww_GetStoreMessage", _SqlParameters.ToArray());
Now I am trying to figure out the best way (cleanest way) to get the output parameter values.
I am wondering if there is a GetParameterValue method somewhere?
Thanks!
Craig
The business object has CreateParameter method:
This assumes you're running this code from within the business object.
+++ Rick ---
Hi Rick,
I would like to use the wwBusiness method here.
public int ExecuteStoredProcedureNonQuery(string ProcedureName, params IDbDataParameter[] Parameters)
However, I do not know how to create the parameter collection to pass and can not find any examples anywhere.
I know I can do something like this below but the ExecuteStoredProcedureNonQuery creates the Command for me.
IDbCommand Command = CreateCommand("ww_GetStoreMessage");
Command.CommandType = System.Data.CommandType.StoredProcedure;
Command.Parameters.Add(CreateParameter("StorePK", tnStorePk, ParameterDirection.Input));
Command.Parameters.Add(CreateParameter("StoreMessage", ParameterDirection.Output));
How do you create a IDataParameterCollection (I guess) to pass "params IDbDataParameter[] Parameters"?
Thanks, Craig