Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Stored Procedure Parameters


Message #1 by "Mike Samaras" <michaels@r...> on Thu, 20 Sep 2001 21:40:01
How can I add a parameter with just 1 line?

All the examples I see use 3 like the code below.

It gets very annoying when you have lots of parameters.



// Add Parameters to SPROC

SqlParameter parameterLastname = new SqlParameter

("@lname",SqlDbType.NVarChar, 50);

parameterLastname.Direction = ParameterDirection.Output;

myCommand.Parameters.Add(parameterLastname);



-Thanks
Message #2 by "Steven A Smith" <ssmith@a...> on Thu, 20 Sep 2001 18:36:26 -0400
See http://www.aspalliance.com/stevesmith/articles/dotnetdataaccess.asp

which has a pMaker function for one line Parameter making.



Steve



----- Original Message -----

From: "Mike Samaras" <michaels@r...>

To: "aspx_beginners" <aspx_beginners@p...>

Sent: Thursday, September 20, 2001 9:40 PM

Subject: [aspx_beginners] Stored Procedure Parameters





> How can I add a parameter with just 1 line?

> All the examples I see use 3 like the code below.

> It gets very annoying when you have lots of parameters.

>

> // Add Parameters to SPROC

> SqlParameter parameterLastname = new SqlParameter

> ("@lname",SqlDbType.NVarChar, 50);

> parameterLastname.Direction = ParameterDirection.Output;

> myCommand.Parameters.Add(parameterLastname);

>

> -Thanks

  Return to Index