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

x
?
Solved

passing through more than one parameter to a stored procedure.

Posted on 2007-07-27
6
Medium Priority
?
275 Views
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
0
Comment
Question by:mitesh114
  • 2
4 Comments
 
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");

Bob
0
 

Author Comment

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

Expert Comment

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

Andrew
0
 
LVL 20

Accepted Solution

by:
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");

Andrew
0

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