passsing large number of parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Everyone,

What will be the best way of passing large number of paramers from one
method to another so that I can insert them in the Database.

Thanks.
 
Not sure how much is "large", but when I need to pass to a stored proc all
IDs user selected in a list, I usually construct a comma separated string and
pass it into a stored proc, and then split them inside the proc.

If you can provide more info, I will try to be more specific
 
Vinki said:
What will be the best way of passing large number of paramers from one
method to another so that I can insert them in the Database.

Encapsulate the parameters into a separate type - then there's just one
object to pass around, and it's a lot easier to understand parameters
when they're accessed by name via properties than positionally.
 
If you mean inside of .Net (rather than .Net -> SQL) I'd probably
define the data in an entity class... the meaning of everything is
clear and you only need pass one object (or an array of like-typed
objects) around.

Marc
 
Can you give me any example of encapsulating the parameters into a seperate
type.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top