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. Wildcards

Wildcards

Scheduled Pinned Locked Moved C#
databasecsharptutorialquestion
8 Posts 5 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.
  • B Offline
    B Offline
    boiDev
    wrote on last edited by
    #1

    I wish for my c# program to search, through a list of Addresses, for particular Address. The user will enter a couple of letters in a textbox and then the program will go out and search a Sql database for that Address.Can some on give me some ideas on how to do this or maybe some samples ? Thanks in advance.. :-D

    S L 2 Replies Last reply
    0
    • B boiDev

      I wish for my c# program to search, through a list of Addresses, for particular Address. The user will enter a couple of letters in a textbox and then the program will go out and search a Sql database for that Address.Can some on give me some ideas on how to do this or maybe some samples ? Thanks in advance.. :-D

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi, sql supports wildcard search by using the word 'like'. Have a look at http://www.sql-tutorial.net/SQL-LIKE.asp[^]. All you have to do is build a GUI (ASP.NET or Windows Forms) and connect your database with the GUI. Regards Sebastian

      It's not a bug, it's a feature! Me in Softwareland.

      1 Reply Last reply
      0
      • B boiDev

        I wish for my c# program to search, through a list of Addresses, for particular Address. The user will enter a couple of letters in a textbox and then the program will go out and search a Sql database for that Address.Can some on give me some ideas on how to do this or maybe some samples ? Thanks in advance.. :-D

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

        You asked this before almost a week ago, you recieved all the help to get this done. Which part are you stuck on now? You *know* the SQL wildcard char is %, you said you understood that. Where is the problem?? If in postal code textbox (we will call it txtPostalCode) they enter 92 then you do SQL= "select * from db.table where postal_code like %" & ToInt32(txtPostalCode.Text) & "%"; That will catch all results with *92*; it would catch 92010 or 08920 etc Should be sufficient to complete your project. ToInt32 will catch common exceptions....

        modified on Thursday, January 15, 2009 8:58 AM

        L 1 Reply Last reply
        0
        • L Lost User

          You asked this before almost a week ago, you recieved all the help to get this done. Which part are you stuck on now? You *know* the SQL wildcard char is %, you said you understood that. Where is the problem?? If in postal code textbox (we will call it txtPostalCode) they enter 92 then you do SQL= "select * from db.table where postal_code like %" & ToInt32(txtPostalCode.Text) & "%"; That will catch all results with *92*; it would catch 92010 or 08920 etc Should be sufficient to complete your project. ToInt32 will catch common exceptions....

          modified on Thursday, January 15, 2009 8:58 AM

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

          Is the a specific reason you 1 voted me for helping you *again*... prick.

          modified on Thursday, January 15, 2009 9:20 AM

          D P 2 Replies Last reply
          0
          • L Lost User

            Is the a specific reason you 1 voted me for helping you *again*... prick.

            modified on Thursday, January 15, 2009 9:20 AM

            D Offline
            D Offline
            DaveyM69
            wrote on last edited by
            #5

            Balanced :-D

            Dave
            BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
            Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

            L 1 Reply Last reply
            0
            • D DaveyM69

              Balanced :-D

              Dave
              BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
              Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

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

              It's extremely upsetting. He posted the same question here,[^] received the same help he is going to get here. In fact I took it one step further and mapped out his SQL statement (without fear of SQL injection, clearly it is a homework project) and he has the balls to be so ungrateful. Sometimes it's discouraging, you know? Edit: Thanks, it's not so much I care about it, just the fact that it's done for no reason, when he actually * received* help.

              D 1 Reply Last reply
              0
              • L Lost User

                It's extremely upsetting. He posted the same question here,[^] received the same help he is going to get here. In fact I took it one step further and mapped out his SQL statement (without fear of SQL injection, clearly it is a homework project) and he has the balls to be so ungrateful. Sometimes it's discouraging, you know? Edit: Thanks, it's not so much I care about it, just the fact that it's done for no reason, when he actually * received* help.

                D Offline
                D Offline
                DaveyM69
                wrote on last edited by
                #7

                Yeah - that's why I balanced his vote. Just rise above it! There are far too many of these types on the interweb to let them get to you. Just take pleasure in helping those that deserve and appreciate your assistance.

                Dave
                BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

                1 Reply Last reply
                0
                • L Lost User

                  Is the a specific reason you 1 voted me for helping you *again*... prick.

                  modified on Thursday, January 15, 2009 9:20 AM

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  Why did you reply to yourself? He won't receive the message, and I doubt he's a regular on the boards. The ungrateful little oik will have had an email with your answer, and that'll be it until he needs help finding his backside again.

                  "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                  My blog | My articles | MoXAML PowerToys

                  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