Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Passing SQL Parameters to Stored Procedure

$
0
0
Passing SQL Parameters to Stored Procedure
.NET Development
Passing SQL Parameters to Stored Procedure
12/08/2011
03:25:30 PM
3DN0X1CH0 Show this entire thread in new window
From:
To:
All
Attachments:
None
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




Viewing all articles
Browse latest Browse all 10393

Trending Articles