[Last Call] Learn how to a build a cloud-first strategyRegister Now


passing through more than one parameter to a stored procedure.

Posted on 2007-07-27
Medium Priority
Last Modified: 2010-04-15
how do you accept multiple stored procedure parameters at the same time? I have the following code:

SqlParameter myParm1 = myCmd.Parameters.Add("@Parameter1", System.Data.SqlDbType.VarChar, 20);
myParm1.Value = "string";

I want to be able to pass more than one value through to the stored procedure
Question by:mitesh114
  • 2
LVL 96

Expert Comment

by:Bob Learned
ID: 19581947
What version of .NET are you using?

2005 has this form:
    myCmd.Parameters.AddWithValue("@Parameter1", "string");


Author Comment

ID: 19581968
i'm not using that version. I'm using the previous one.
LVL 20

Expert Comment

ID: 19581997
myCmd.Parameters.Add("@Parameter1", "string");

LVL 20

Accepted Solution

REA_ANDREW earned 1000 total points
ID: 19582000
myCmd.Parameters.Add("@Parameter1", "string");

myCmd.Parameters.Add("@Parameter2", "string");

myCmd.Parameters.Add("@Parameter3", "string");

myCmd.Parameters.Add("@Parameter4", "string");


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month18 days, 13 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question