Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Using WildCard Character

Using WildCard Character

Scheduled Pinned Locked Moved ASP.NET
databasequestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 4547220
    wrote on last edited by
    #1

    Hi, In my application i have a search criteria field in which one document name field is there. I have a document in my database with name $#%#$. Now, I want to search for document by entering only %. How i do that? I tried differnt things but its not working. If i entered % in the document name field it gives me all the document.But, I want only that document. Thanks, Umesh Tayade

    H L S 3 Replies Last reply
    0
    • U User 4547220

      Hi, In my application i have a search criteria field in which one document name field is there. I have a document in my database with name $#%#$. Now, I want to search for document by entering only %. How i do that? I tried differnt things but its not working. If i entered % in the document name field it gives me all the document.But, I want only that document. Thanks, Umesh Tayade

      H Offline
      H Offline
      Herman T Instance
      wrote on last edited by
      #2

      I can see you use the LIKE in your query. If you only enter % you do get all. If you enter #%# I guess your result will be better. (BTW I have never seen a filename with a % in it, maybe de-abstract you question)

      In Word you can only store 2 bytes. That is why I use Writer.

      1 Reply Last reply
      0
      • U User 4547220

        Hi, In my application i have a search criteria field in which one document name field is there. I have a document in my database with name $#%#$. Now, I want to search for document by entering only %. How i do that? I tried differnt things but its not working. If i entered % in the document name field it gives me all the document.But, I want only that document. Thanks, Umesh Tayade

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Escape it with a backslash (\), like this '\%'

        1 Reply Last reply
        0
        • U User 4547220

          Hi, In my application i have a search criteria field in which one document name field is there. I have a document in my database with name $#%#$. Now, I want to search for document by entering only %. How i do that? I tried differnt things but its not working. If i entered % in the document name field it gives me all the document.But, I want only that document. Thanks, Umesh Tayade

          S Offline
          S Offline
          sudeshchandram
          wrote on last edited by
          #4

          You can use either SELECT columns FROM table WHERE column LIKE '%[%]%' -- or SELECT columns FROM table WHERE column LIKE '%\%%' ESCAPE '\'

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups