Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

String Search in .Net C#

I am needing to ask experts if familiar with being able to add several words into a text box and do a search in .NET with SQL Server backend.  

Is there any info on.  ARe there examples?  How does it work?

in a
Text box:
enter example
 Name phone pet name  

Results would bring back Name phone and pet name and any other fields I need.
0
leezac
Asked:
leezac
1 Solution
 
käµfm³d 👽Commented:
I think we need more information on the structure of your database table(s).
0
 
leezacAuthor Commented:
I have not designed tables yet.  Just general question about if doable and how.  I have never done before and think would be complex if a lot of tables.  But suppose code would need to select from all the tables concerned if name is found in one and pet name in another.   I am just not sure how it would work.  Be like a Google search for SQL Server using .NEt.
0
 
MajorBigDealCommented:
Yes this is doable but it might not be the best approach.  SQL Server supports full text searching (via CONTAINS and FREETEXT) which is what I think you are trying to do.  

That said, if  the users know which info represents the pet name versus the phone number then it might be better to provide individual search fields so that your queries could be more structured and efficient.   If they don't know then I can see where you might want to use full text search and just return any hits that you find in the database.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now