Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2007, 05:07 AM
Registered User
 
Join Date: Apr 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB.NET 2005 Indexing Service

I've got two questions about Indexing Service with COM.
How can you add an directory to a catalog by code ?
How can you get the state from the indexing process by code ?
i.e. state is 40 %

I will show some code what I did get working:

Dim obj As New CIODMLib.AdminIndexServerClass 'reference to Indexing Service Administration Type Library 1.0

'create catalog
obj.Stop()
obj.AddCatalog("ICT", "D:\ICT_Catalog")
obj.Start()
MessageBox.Show("Succesfully Added")

'get catalogs
Dim isFoundCatalog As Boolean = obj.FindFirstCatalog
Dim sCatalogList As String
While isFoundCatalog
Dim Catalog As CIODMLib.ICatAdm = obj.GetCatalog
sCatalogList &= "Name: " & Catalog.CatalogName & ", "
sCatalogList &= "Loc: " & Catalog.CatalogLocation & ", "
sCatalogList &= "Running: " & Catalog.IsCatalogRunning & ControlChars.NewLine
isFoundCatalog = obj.FindNextCatalog()
End While
MsgBox(sCatalogList)

'find items in catalogs
Dim con As OleDbConnection
Dim cmd As New OleDbCommand
con = New OleDbConnection("Provider=\MSIDXS.1\;Data Source=ICT;Integrated Security .=")
cmd.Connection = con
cmd.CommandText = "select doctitle, filename, vpath, rank, characterization from scope() " & _
" where FREETEXT(Contents, '" + TextBox1.text + "') order by rank desc "
con.Open()
Dim da As OleDbDataAdapter = New OleDbDataAdapter(cmd)
cmd.ExecuteNonQuery()
Dim ds As DataSet = New DataSet
Dim dt As DataTable = New DataTable
da.Fill(ds, "SearchResult")
dt = ds.Tables(0)
DataGridView1.DataSource = dt





Similar Threads
Thread Thread Starter Forum Replies Last Post
reg conn to sql server 2005 from vb.net 2005.. veda SQL Server 2005 2 July 1st, 2008 12:16 AM
what is the alternate to windows indexing service hyder_master ASP.NET 2.0 Professional 0 January 22nd, 2008 02:21 AM
Indexing Service and ASP.NET 2.0 Master Pages thenoseknows ASP.NET 2.0 Professional 1 September 15th, 2006 09:35 AM
ASP and Indexing service sebastian Classic ASP Professional 1 August 28th, 2003 02:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.