How to extract data from SQL Server with the Index Server Search Result?

S

savvy

I am developing a Recruitment Agency Website
I am using MS SQL Server in which I have a table called CV_Details
which stores all the details of different Job Seekers. I have stored
all the Word and PDF docs of the Job seekers in a 'mycatalog' using
Index Server and stored the path in the CV_Details table along with
rest of the cv details. Basically I want to download the cv's which i
get after making a search in the doc's. I am able to get the filename,
Path, Filesize by using Index Server Query.
Is it anyway possible to extract all the CV Details data by matching
the path.
I want the cv details from the SQL Server of all the Related Paths at
the same time not one at a time. Is it possible.
I tried alot but i'm going nowhere. I'm giving my code below. Can
anyone help me please.
Thank you very much in Advance

string strCatalog = "TestCatalog", strsearchstrings="";
string strQuery="";
strsearchstrings = txtsearch.Text;

strQuery = "Select Filename,PATH from Scope() where
FREETEXT('" +strsearchstrings+ "')";
// TextBox1.Text is the word that you type in the text box
to query by using Indexing Service.
string connstring = "Provider=MSIDXS.1;Integrated Security
..='';Data Source="+strCatalog;

System.Data.OleDb.OleDbConnection conn = new
System.Data.OleDb.OleDbConnection(connstring);
conn.Open();


System.Data.OleDb.OleDbCommand objcmd = new
System.Data.OleDb.OleDbCommand(strQuery, conn);
System.Data.OleDb.OleDbDataReader objRdr;

objRdr = objcmd.ExecuteReader();
DataGrid1.DataSource=objRdr;
DataGrid1.DataBind();
objRdr.Close();
conn.Close();
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top