473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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?

Nov 16 '05 #1
1 2272
sorry. it's my fault. there are two from .:(

"ʹÃûÑï" <to*************@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ
:eE**************@TK2MSFTNGP12.phx.gbl...
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?

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
4
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
3
by: Lars Haugseth | last post by:
Setup: SuSE Linux 8.2 running IBM DB2 v8.1 with Net Search Extender. We had to hard reset our server, and did a successfull crash recovery. We now have a problem with operations involving text...
0
by: metaperl | last post by:
A Comparison of Python Class Objects and Init Files for Program Configuration ============================================================================= Terrence Brannon bauhaus@metaperl.com...
3
by: =?Utf-8?B?Q2luZHk=?= | last post by:
Hi all, I am trying to connect to a electromyograph machine for my thesis project, and I have a VB DDE client whose DDE functionality I want to convert to VC++. However I can't make my VC++...
5
by: Robert Latest | last post by:
Hello, if HTML authoring includes HTML autogeneration, this request is on-topic. Otherwise please forgive me and point me in the right direction. I'd like to make a bunch of dirs full of files...
4
by: neptundancer | last post by:
Hi, to extend my skills, I am learning python. I have written small program which computes math expression like "1+2*sin(y^10)/cos(x*y)" and similar, so far only + - * / ^ sin con tan sqrt are...
1
by: AngreGanon | last post by:
Hi all~ I've written a network program in C. This program catputures ARP request packet and reply wrong ARP packet. Hi. I've written a small program to learn to write in C. But unfortunately...
3
by: 100grand | last post by:
Modify the Inventory Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.