Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone explain one piece of parameter instantiation code 1

Status
Not open for further replies.

SBendBuckeye

Programmer
Joined
May 22, 2002
Messages
2,166
Location
US
Hello all,

Someone sent me this code to instantiate a parameter object.
Code:
cmd1.Parameters.Append(cmd1.CreateParameter("Project", adVarChar, adParamInput, 30, request("Project")))
I understand everything except the request() part. I assume that it returns the corresponding column name for the parm name referenced as argument 1. Can someone elaborate on this method or where I can find it? Thanks!


Have a great day!

j2consulting@yahoo.com
 
The last parameter to the 'createParameter' function is the value, and so this gey was simply putting the the value there, which was request("Project"), so he was using ASP.net and putting in a value from a form or querystring variable. A slightly different example is shown below...

cmd1.Parameters.Append(cmd1.CreateParameter("@MyParamName", adVarChar, adParamInput, 30, MyValue))
 
Request is a member of System.Web.UI.Page. It is the HttpRequest sent to the server. You are getting out a form variable posted to the server. That is the value for the parameter
 
Thanks to both of you for your timely responses!

Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top