ASP.Net with Indexing Services returns zero results

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.
 
T

tweekDev

Finnally found it. If you are letting the DataGrid automatically
generate columns then it does not seem to do it right. As soon as I
manualy defined bound columns in the grid the title for the documents
that had it showed up. Try that, if you haven't already.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top