By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,338 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,338 IT Pros & Developers. It's quick & easy.

searching index server with c#

P: n/a
I found some code on how to run a search against index server, but it
isn't working. I'm getting an exception saying...

System.Data.OleDb.OleDbException: Column 'AGENCYID' has not been
defined. SQLSTATE=42S22

Here's my code.

System.Data.OleDb.OleDbConnection odbSearch = new
System.Data.OleDb.OleDbConnection();
System.Data.OleDb.OleDbCommand cmdSearch = new
System.Data.OleDb.OleDbCommand();
odbSearch.ConnectionString = "Provider=\"MSIDXS\";Data
Source=\"JobAdCatalog\";";

cmdSearch.Connection = odbSearch;
cmdSearch.CommandText = "Select AgencyId from scope() where
@Site=230 order by rank desc";

odbSearch.Open();
try
{
OleDbDataReader rd = cmdSearch.ExecuteReader();
Console.WriteLine(rd[0].ToString());
}
catch (Exception exc)
{
Console.WriteLine(exc.ToString());
}
odbSearch.Close(); odbSearch.Dispose(); odbSearch = null;
Console.ReadLine();

Since AgencyId is not in the text part of the htm but in the meta
portion, I'm not sure if I have the query correct. But, in relation to
the error, I've used the IXSSO.Query object in VB6 and had to define
columns. It appears that's the problem here, but I'm not sure how to
define columns in this case. Can anyone shed some light on this?
Thanks.

Apr 5 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.