Professional Web Applications Themes

adding a search capability - ASP.NET General

I have a sql server (2000) and I want to add a search capability to my asp.net page. It will search an Articles table - in particular the 'Article' field (ntext). I started with the following statement: sql = "Select * from [articles] where article like '%" & tbquery.text & "%' " order by dateposted desc, title" and the results are fine if I only enter one word into the textbox - how can I make it more functional (using and, or and such) bj daniels org...

  1. #1

    Default adding a search capability

    I have a sql server (2000) and I want to add a search capability to my
    asp.net page. It will search an Articles table - in particular the
    'Article' field (ntext).

    I started with the following statement:
    sql = "Select * from [articles] where article like '%" & tbquery.text & "%'
    " order by dateposted desc, title"

    and the results are fine if I only enter one word into the textbox - how can
    I make it more functional (using and, or and such)



    bj daniels

    org






    bj Guest

  2. #2

    Default Re: adding a search capability

    bj,

    I've taken a different direction. As a matter of fact I'm getting ready to
    place the code for a search project I built out on my web site. Instead of
    going to the database with a search I'm getting back a datatable of all
    records and searching those. The method's I've built return a dataview.

    So far it functions pretty quickly. I've tested it on up to 10,000 records
    in the database of the on of the websites where I work, www.collect.com. (I
    know 10,000 records isn't a lot) But in this case it's more than it seems
    because this is our content database. And each article can be up to four or
    five pages of text long.

    It's pretty speedy so far.

    I'll put the project out on my site by tomorrow.

    If you want to test it I'm using it for my code library at
    www.aboutfortunate.com.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "bj daniels" <org> wrote in message
    news:phx.gbl... 
    "%' 
    can 


    S. Guest

  3. #3

    Default Re: adding a search capability

    bj,

    If you are interested in the search component I wrote it's on my web site in
    the code library now. Just go to the code library and click the "Search"
    button in the list of components on the left.

    You'll have an option to download the entire project's source files and also
    a help file that contains information for all the assemblies I've written.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "bj daniels" <org> wrote in message
    news:phx.gbl... 
    "%' 
    can 


    S. Guest

  4. #4

    Default Re: adding a search capability

    Can I use a validation control to only accept letters and numbers? How
    would you recommend I do this?

    bj daniels
    org



    "John Saunders" <com> wrote in message
    news:%phx.gbl... 
    > "%' 
    >
    > BJ, what happens when the user enters into tbquery something like "--
    > <cr><lf>DELETE * FROM [ARTICLES]<cr><lf>"?
    > --
    > John Saunders
    > Internet Engineer
    > com
    >
    >[/ref]


    bj Guest

  5. #5

    Default Re: adding a search capability

    thanks - I'll check that out!


    "S. Justin Gengo" <com> wrote in message
    news:phx.gbl... 
    in 
    also 
    > "%' 
    > can 
    >
    >[/ref]


    bj Guest

Similar Threads

  1. Disabling search capability within Reader
    By Paul_Clements@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 2
    Last Post: November 27th, 02:45 PM
  2. Adding a Search Function to Dreamweaver Pages
    By dreamer spiderwoman1 in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 2
    Last Post: August 28th, 04:27 PM
  3. Does Flex has the capability to do this
    By lordali in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 23rd, 08:50 AM
  4. Best practices for adding search engine to site
    By Eric Veltman in forum PHP Development
    Replies: 4
    Last Post: October 13th, 08:37 PM
  5. I need advice on adding and html search
    By panama webforumsuser@macromedia.com in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: October 10th, 01:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139