Need help running query on Indexing Server in VB.NET with VS2005


In a web project I am trying to run a simple query on a catalog off of our Microsoft Indexing server.  I'm having a couple of problems. 

#1 - The tutorials keep refering to a view inside the catalog, but my server admin doesn't know what that means.  How do we find the view name?

#2 - The line: Return oCommand.ExecuteReader() returns this error;
Incorrect syntax near '-1.'.  Expected end-of-file, ';', AS, CREATE, DOT, DOTDOT, DOTDOT_SCOPE, DOTDOTDOT, DOTDOTDOT_SCOPE, DROP, ORDER_BY, SELECT, SET, WHERE. SQLSTATE=42000

The query being executed is:  SELECT * FROM PN-1.Powernet..Powernet;
where PN-1 is the server name and Powernet is the catalog name (Powernet.wci) and we just tried Powernet as the view name because we don't know what else to call the view.

Any ideas as to what is wrong with this part?

Here is my code:

Imports

System.Data.OleDb

Partial

Class _Default

Inherits System.Web.UI.Page

Function

SearchIndex() As OleDbDataReader

Using oConn As New OleDbConnection("Provider=MSIDXS;")

Dim oCommand As New OleDbCommand("SELECT * FROM PN-1.Powernet..Powernet;")

oCommand.Connection = oConn

Try

oConn.Open()

Catch ex As Exception

Response.Write(ex)

End Try

Return oCommand.ExecuteReader()

End Using

End

Function

Protected

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim sFieldName() As String

Dim iIndexCount As Integer

Dim rdrReader1 As OleDbDataReader = SearchIndex()

rdrReader1.Read()

iIndexCount = rdrReader1.FieldCount

For i As Integer = 0 To iIndexCount

sFieldName(i) = rdrReader1.GetName(i)

Next

End

Sub

End

Class
0
bucketofsquid
5/4/2006 3:21:53 PM
asp.net.other-databases 819 articles. 0 followers. Follow

3 Replies
635 Views

Similar Articles

[PageSpeed] 36
Get it on Google Play
Get it on Apple App Store

The catalog is not in indexing server that comes with IIS but it is in the Microsoft search service which is required to run Fulltext query in SQL Server.  If the above is not correct post a link to the tutorial so I can tell you if your implementation is technically sound or not.  Hope this helps.
Kind regards,
Gift Peddie
0
Caddre
5/5/2006 7:34:03 PM

Hi,

I got the link below but your application may break because you are running everything in IIS which is using Windows file system.  The link includes all the configuration you need.  Hope this helps.

http://support.microsoft.com/default.aspx?scid=kb;en-us;820105


Kind regards,
Gift Peddie
1
Caddre
5/5/2006 7:44:18 PM

Thanks! That did help.  When following the instructions in the article you linked to I discovered that indexing was disabled.  That would tend to explain why nothing worked.

 

0
bucketofsquid
5/16/2006 10:00:33 PM
Reply: