Program ms index server with c#


Ê

ʹÃûÑï

i want connect ms index server with ado.net
here is my code
KB is a new index dir.it works correctly.

string constr="PROVIDER=MSIDXS;DATA SOURCE=KB";
OleDbConnection con=new OleDbConnection(constr);
try
{
OleDbCommand cmd=new OleDbCommand();
cmd.Connection=con;
cmd.CommandText="SELECT Rank, DocAuthor, DocAppName, DocTitle,
FileName, Create, Access, Characterization, VPath from FROM SCOPE()";
con.Open();
OleDbDataReader reader=cmd.ExecuteReader();//<- error here
reader.Close();
}
catch(Exception E)
{
Response.Write(E.Message);
}
finally
{
con.Close();
}

but it cannot run correctly. the exception says the sql is wrong .from need
" '(', SCOPE, ID, TEMPVIEW¡£SQLSTATE=42000 "

can anybody give me a correct example?
 
Ad

Advertisements


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

Top