c# - Omit named parameters from OleDbCommand -


i have simple stored procedure takes 6 paramters. lets @a, @b, @c, @d, @e, @f , optional default value of null.

i need know how call stored procedure only some of these parameters. know general steps:

  1. define connection , open it.

  2. define command object

  3. add parameters command object.

  4. execute command.

right each of @a, @b, @c, @d, @e, @f use parameters.add() add parameter.

question is: if want call stored procedure @a , @f, need add() other parameters also? or if add 2 parameters how stored procedure know parameters supplied?

question :what if want call stored procedure @a , @f,

as long other optional sp executed without errors.

in case need add other parameters (b,c,d,e) anyway?

no, don't.

if add 2 parameters how stored procedure knows order?

order not important here. parameter name is. has match 1 sp declaration.


Comments