codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Using Select statement in ASP.Net  wakayn at 23:52 on Sunday, October 09, 2005
 

Hi,
I've a Form in page 1.asp and am accepting a 'string' variable (Name) from the user through METHOD=GET.
In page 2.asp, I use this string variable in a SQL Select statement as follows:

set rs= conn.execute ("select * from table where =" & request.QueryString("Name")

but, I get an error message: Too few parameters. Expected 1.

However, when I accept and use a 'numeric' variable I can execute this Select statement successfully.

What am I doing wrong? Pls help. Thanks.

  Re: Using Select statement in ASP.Net  javabits at 18:19 on Monday, October 10, 2005
 

shouldn't your query have something on the left hand side of the equal sign.

i.e.

set rs= conn.execute ("select * from table where name = " & request.QueryString("Name") )

semper fi...

  Re: Using Select statement in ASP.Net  wakayn at 11:24 on Tuesday, October 11, 2005
 

...oops, sorry I missed typing it here, though I had it in the original statement. Anyways, I figured it out:

set rs = conn.execute("select * from table where name = '" & request.querystring("name") & "'")

it worked. Thanks.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007