score:3

Accepted answer

the executecommand and executequery methods of the datacontext class take a simple parameter (params object[]) array. there are a few gotchas when it comes to those, but for the most part they work fine and are less code to write than populating the parameters of a sqlcommand.

context.executecommand("exec usp_updateproductname {0}, {1}",
    productid, productname);

that's all there really is to it.

score:1

you could have your sp take in an xml data type parameter and you could loop through and dynamically create the value of that parameter. then the stored proc would know what to expect in the xml parameter....that is a way to pass in a variable length parameter into the database.


Related Query

More Query from same tag