asp .net / sql database / search function

M

mattmerc

Hi all,

I've searched around on this topic but haven't come up with anything
that matches exactly what I am trying to do. I have an ASP .net
application running over a SQL database. I need to allow users to do a
"free text" search on some of the SQL data. I'm thinking there must be
code out there to do this already. I don't want to reinvent the wheel,
and it doesn't help that I wouldn't know where to start reinventing
anyway... :)
 
M

mattmerc

Well, after more searching I have discoverd how to turn on the full
text indexing and use the sql CONTAINS and FREETEXT. I have run up on
another issue maybe someone can help with. This one is kind of hard to
explain, but here it goes.

The freetext search on my site should search various fields in
different tables. All tables are associated to the main table by
foreign key. When the search is complete a datagrid should show with
some preliminary info from the main table and a option to view a single
record or to export the datagrid to excel.

TABLE: incident PRIMARY KEY: incident_number
TABLE: person FOREIGN KEY: incident_number
TABLE: property FOREIGN KEY: incident_number
TABLE: attachment FOREIGN KEY: incident_number

My problem is that FREETEXT can only be performed on one table at a
time. So if I perform each query separately pulling the incident_number
from each query, how can I combine all of these incident numbers
(without duplicates) into my final datagrid?

Thanks all. I hope my description made some sense.
 
M

mattmerc

Well, looks like I may have solved my problem by using several SELECT
statements joined by a UNION. Anyone agree or disagree? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top