D
Don
I am new to Indexing Services, have been researching the MS Site as well as
web articles on DevHood, etc. I have set up a seperate catalog
("KnowledgeBase") on Win XP with a number of files. I am trying to use
OLEDB through ADO to search results and serve them up onto an ASP.Net
web page, yet I consistently get back 0 results.
I have this working fine in a console application. I think my problem
is I have to allow IIS access to my IS catalog, but I am not sure how.
The MS articles in MSDN have not been of any assistance.
Here is what I have tested:
1. searching through management console works fine
2. searching with a VB.Net console app works:
Sub Main()
Dim conn As OleDbConnection = New
OleDbConnection("Provider=MSIDXS;Data Source=KnowledgeBase")
Dim cmd As OleDbCommand = conn.CreateCommand()
cmd.CommandText = "SELECT DocTitle FROM Scope()"
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim dt As DataTable = New DataTable("Results")
Dim results As Integer = 0
results = adapter.Fill(dt)
Dim ds As DataSet = New DataSet("Search")
ds.Tables.Add(dt)
Console.WriteLine("Results = " + results.ToString)
If (results > 0) Then
Dim lRow As DataRow
For Each lRow In ds.Tables("Results").Rows
Console.WriteLine(lRow(0))
Next
End If
Console.ReadLine()
End Sub
3. Search with an ASP.Net web page does not work (assume there is a
search button, a datagrid for results, and a label to indicate result
count)
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnSearch.Click
Dim conn As OleDbConnection = New
OleDbConnection("Provider=MSIDXS;Data Source=KnowledgeBase")
Dim cmd As OleDbCommand = conn.CreateCommand()
cmd.CommandText = "SELECT DocTitle FROM Scope()"
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim dt As DataTable = New DataTable("Results")
Dim results As Integer = 0
results = adapter.Fill(dt)
Dim ds As DataSet = New DataSet("Search")
ds.Tables.Add(dt)
lblResultsCount.Text = results.ToString + " results."
If (results > 0) Then
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataSource = ds
DataGrid1.DataBind()
DataGrid1.Visible = True
End If
End Sub
4. SYSTEM has r/w priviledges on my IS catalog and data directries.
Thanks for any suggestions.
Don
P.S. Cross posted to the Index Server group.
web articles on DevHood, etc. I have set up a seperate catalog
("KnowledgeBase") on Win XP with a number of files. I am trying to use
OLEDB through ADO to search results and serve them up onto an ASP.Net
web page, yet I consistently get back 0 results.
I have this working fine in a console application. I think my problem
is I have to allow IIS access to my IS catalog, but I am not sure how.
The MS articles in MSDN have not been of any assistance.
Here is what I have tested:
1. searching through management console works fine
2. searching with a VB.Net console app works:
Sub Main()
Dim conn As OleDbConnection = New
OleDbConnection("Provider=MSIDXS;Data Source=KnowledgeBase")
Dim cmd As OleDbCommand = conn.CreateCommand()
cmd.CommandText = "SELECT DocTitle FROM Scope()"
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim dt As DataTable = New DataTable("Results")
Dim results As Integer = 0
results = adapter.Fill(dt)
Dim ds As DataSet = New DataSet("Search")
ds.Tables.Add(dt)
Console.WriteLine("Results = " + results.ToString)
If (results > 0) Then
Dim lRow As DataRow
For Each lRow In ds.Tables("Results").Rows
Console.WriteLine(lRow(0))
Next
End If
Console.ReadLine()
End Sub
3. Search with an ASP.Net web page does not work (assume there is a
search button, a datagrid for results, and a label to indicate result
count)
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnSearch.Click
Dim conn As OleDbConnection = New
OleDbConnection("Provider=MSIDXS;Data Source=KnowledgeBase")
Dim cmd As OleDbCommand = conn.CreateCommand()
cmd.CommandText = "SELECT DocTitle FROM Scope()"
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim dt As DataTable = New DataTable("Results")
Dim results As Integer = 0
results = adapter.Fill(dt)
Dim ds As DataSet = New DataSet("Search")
ds.Tables.Add(dt)
lblResultsCount.Text = results.ToString + " results."
If (results > 0) Then
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataSource = ds
DataGrid1.DataBind()
DataGrid1.Visible = True
End If
End Sub
4. SYSTEM has r/w priviledges on my IS catalog and data directries.
Thanks for any suggestions.
Don
P.S. Cross posted to the Index Server group.