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. General Programming
  3. C#
  4. query check field which has a _

query check field which has a _

Scheduled Pinned Locked Moved C#
questiondatabase
6 Posts 3 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.
  • E Offline
    E Offline
    eyeseetee
    wrote on last edited by
    #1

    Hi How can i run a query which will check that there is _ in the field name? cheers

    I P 2 Replies Last reply
    0
    • E eyeseetee

      Hi How can i run a query which will check that there is _ in the field name? cheers

      I Offline
      I Offline
      Imran Adam
      wrote on last edited by
      #2

      You could try and use the IsPunctuation method to check for a '_'.

      Cheers :)

      P 1 Reply Last reply
      0
      • E eyeseetee

        Hi How can i run a query which will check that there is _ in the field name? cheers

        P Offline
        P Offline
        pmarfleet
        wrote on last edited by
        #3

        Read the documentation[^] under the section 'Using Wildcards as Literals'.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        E 1 Reply Last reply
        0
        • P pmarfleet

          Read the documentation[^] under the section 'Using Wildcards as Literals'.

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          E Offline
          E Offline
          eyeseetee
          wrote on last edited by
          #4

          hi i need it to work when running it in c# e.g. string test0002 = "Select room_code from room_types where room_code like '_'"; but this doesnt work it seems to only look for a field called _ not containing this character?? any suggestions? cheers

          P 1 Reply Last reply
          0
          • I Imran Adam

            You could try and use the IsPunctuation method to check for a '_'.

            Cheers :)

            P Offline
            P Offline
            pmarfleet
            wrote on last edited by
            #5

            hustler2005 wrote:

            You could try and use the IsPunctuation method to check for a '_'.

            How does that answer the question :confused: Read my response[^].

            Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

            1 Reply Last reply
            0
            • E eyeseetee

              hi i need it to work when running it in c# e.g. string test0002 = "Select room_code from room_types where room_code like '_'"; but this doesnt work it seems to only look for a field called _ not containing this character?? any suggestions? cheers

              P Offline
              P Offline
              pmarfleet
              wrote on last edited by
              #6

              Did you read the documentation under the section I mentioned?

              Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

              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