Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 11th, 2007, 08:05 AM
Registered User
 
Join Date: Oct 2007
Location: , , France.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database call

I'm trying to build a search page in Visual Web Developer, I have 5 columns in one database table which which the end user needs to able to search. I'm trying to build a DB call using the data in a text box to complete the call:
ex:SELECT * FROM ++++++++ WHERE +++++ = TEXTBOX.TEXT
Can anyone tell me how this can be achieved?

Thank's in anticipation,

Wayne

  #2 (permalink)  
Old October 11th, 2007, 08:07 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Have you considered using a Full Text Index?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========
  #3 (permalink)  
Old October 11th, 2007, 08:12 AM
Registered User
 
Join Date: Oct 2007
Location: , , France.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The database contains a list of lepidoptera, nearly 3000 species. I would like the end user to be able to search by, latin name, english common name, french common name or by code number. I think a full text index would be to large. Thank you for your reply.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========
[/quote]

  #4 (permalink)  
Old October 11th, 2007, 08:18 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Well how is your database setup? Do you have a master table that contains the latin name, english common name, french common name and code number? Or is this split out into multiple tables?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========
  #5 (permalink)  
Old October 11th, 2007, 08:19 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

well.. if you want to pursued in that tech (and not try the full text index, which I suggest you try before just thinking of it), you can in fact fill the data of from and where, just asking the type of data is the user entering (If the user enters a latin name, you probably already know table and field that you need)... You can achieve that which just a combobox, filled with the type of data the user want to look at...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
  #6 (permalink)  
Old October 11th, 2007, 08:33 AM
Registered User
 
Join Date: Oct 2007
Location: , , France.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All the information is in one table along with a column giving a path to the relevant insects picture and another column giving a path to that insects data. I would like the end result (after a user has selected a species) to be that the corresponding picture and data are shown to the user.
 Well how is your database setup? Do you have a master table that contains the latin name, english common name, french common name and code number? Or is this split out into multiple tables?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========
[/quote]

  #7 (permalink)  
Old October 11th, 2007, 08:37 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You could write a query something like this then:

"SELECT <columns> FROM <masterTable> Where latin name like '%" + textbox1.text + "%' OR english common name like '%" + textbox1.text + "%' or french common name like '%" + textbox1.text + "%' or code number like '%" + textbox1.text + "%'"

You will obviously have to tweak it for your specific use but something like that would work.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========
  #8 (permalink)  
Old October 11th, 2007, 08:37 AM
Registered User
 
Join Date: Oct 2007
Location: , , France.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Good idea and thank you, but I would like to use separate text boxes for each search category.

Wayne

 well.. if you want to pursued in that tech (and not try the full text index, which I suggest you try before just thinking of it), you can in fact fill the data of from and where, just asking the type of data is the user entering (If the user enters a latin name, you probably already know table and field that you need)... You can achieve that which just a combobox, filled with the type of data the user want to look at...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
[/quote]

  #9 (permalink)  
Old October 11th, 2007, 08:41 AM
Registered User
 
Join Date: Oct 2007
Location: , , France.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for that, I'll give it a go.

Wayne

 You could write a query something like this then:

"SELECT <columns> FROM <masterTable> Where latin name like '%" + textbox1.text + "%' OR english common name like '%" + textbox1.text + "%' or french common name like '%" + textbox1.text + "%' or code number like '%" + textbox1.text + "%'"

You will obviously have to tweak it for your specific use but something like that would work.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========
[/quote]



Similar Threads
Thread Thread Starter Forum Replies Last Post
Database call my app?? TheMajor SQL Server 2000 2 February 17th, 2007 10:49 AM
don't know how to call it stasnikov Access 2 January 17th, 2007 04:02 AM
How to call a sub in a sub busybee ASP.NET 1.0 and 1.1 Basics 4 March 22nd, 2006 01:39 AM
Call from database mikeholohan Classic ASP Basics 1 December 18th, 2003 04:39 AM
Unable to call the date from the database nvillare Classic ASP Basics 2 July 10th, 2003 04:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.