Wildcards
-
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
-
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
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.
-
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
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
-
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
-
Is the a specific reason you 1 voted me for helping you *again*... prick.
modified on Thursday, January 15, 2009 9:20 AM
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) -
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)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.
-
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.
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) -
Is the a specific reason you 1 voted me for helping you *again*... prick.
modified on Thursday, January 15, 2009 9:20 AM
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