SQL Query Parameters

Last post 08-29-2008 6:42 PM by cndnbcn. 20 replies.

Sort Posts:

  • Re: SQL Query Parameters

    08-28-2008, 11:15 AM
    • All-Star
      31,259 point All-Star
    • Naom
    • Member since 12-31-2007, 2:08 PM
    • Wisconsin
    • Posts 6,915

     

    How exactly this page is being called?

    It should be called like this

    mypage.ASPX?item=myItem&cat1=MyCat 

     

    Looking for a job opportunity.

    Beware of bugs in the above code; I have only proved it correct, not tried it.
    (Donald Knuth)

    Visit my blog

    PluralSight Learning Library
  • Re: SQL Query Parameters

    08-28-2008, 11:40 AM
    • Contributor
      4,008 point Contributor
    • Matt-dot-net
    • Member since 06-09-2007, 4:00 PM
    • Kentucky
    • Posts 772

    I saw cat2 above, but now you have cat1 in your parameters.  Just compare your query to your parameters one more time.

  • Re: SQL Query Parameters

    08-28-2008, 2:40 PM
    • Member
      4 point Member
    • cndnbcn
    • Member since 07-13-2008, 10:36 AM
    • Posts 12

    Wow. If it's because I have cat1 LIKE cat2 in the statement that's on the server, that's a little embarrassing haha

     But the line that comes up in the URL is searchresults.aspx?item=whatever&cat1=whatever&search=Search, so at least that's right. But later I'll have to check what the source actually is and hopefully it's just a typo that's the problem.
     

  • Re: SQL Query Parameters

    08-28-2008, 9:04 PM
    • Member
      4 point Member
    • cndnbcn
    • Member since 07-13-2008, 10:36 AM
    • Posts 12

     I fixed that little typo, but now it's saying the input string must be exactly one character long (http://testsite.melvinsmagicshop.com/shop/)... so a search for nothing returns nothing, and a search for a letter turns up nothing. Regardless of that fact, shouldn't a search for say, S, show all results at least starting with S?

    This is becoming a pain haha, anyone know of any good tutorials for a search parameter thing that uses code behinds and all? I might as well just do that.

  • Re: SQL Query Parameters

    08-29-2008, 9:59 AM
    Answer
    • All-Star
      31,259 point All-Star
    • Naom
    • Member since 12-31-2007, 2:08 PM
    • Wisconsin
    • Posts 6,915

    I think we were wrong and you need to use String as a type. See http://forums.asp.net/t/1312616.aspx

    Looking for a job opportunity.

    Beware of bugs in the above code; I have only proved it correct, not tried it.
    (Donald Knuth)

    Visit my blog

    PluralSight Learning Library
  • Re: SQL Query Parameters

    08-29-2008, 6:42 PM
    Answer
    • Member
      4 point Member
    • cndnbcn
    • Member since 07-13-2008, 10:36 AM
    • Posts 12

     Success!

     

    But hey, now I know that Char only does one character, so that's a plus? I had an issue with using wildcards, but, I figured that one out on my own.

     

    Thanks everyone!

Page 2 of 2 (21 items) < Previous 1 2