Maharaje

Maharaje

  • NA
  • 133
  • 0

Indexing

Aug 18 2009 7:05 AM

Hi friends
i want to make a indexing like windows's indexing
this is it's code but i don't work how i can correct it?
 
public void Search()
{
try
{
OleDbConnection cn = new OleDbConnection("Provider='MSIDXS';Data Source='TestCatalog'");
string goal = textBox1.Text.ToString();
string query = "select Path from scpoe() WHERE FREETEXT(contents, '" + goal + "')";
OleDbCommand cmd = new OleDbCommand(query, cn);
cn.Open();
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
listView1.Items.Add(dr[0].ToString());
}
dr.Close();
cn.Close();
}
catch (Exception)
{
MessageBox.Show("Not Found");
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Search();
}

I think it's better to explain some thing about it:
when you type only a word like"windowsForm" in search Textbox with this Query it must shows all of documents that included this word and show it in listview but it doesn't work
PLZ Help

Answers (9)