Indexing service Query help in asp.net ( c#) - Inetserver
This is a discussion on Indexing service Query help in asp.net ( c#) - Inetserver ; string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL OF
\"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (Create >= '" +
FromDate.ToString("yyyy/MM/dd") + "' AND Create<= '" +
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";
...
-
Indexing service Query help in asp.net ( c#)
string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL OF
\"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (Create >= '" +
FromDate.ToString("yyyy/MM/dd") + "' AND Create<= '" +
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";
Above given is my indexing service query. I have written this to get files
between two dates that it has created. I am geting wrong results and many
files are not dispalyed. If i remove the Date condintion in the where clause
i am getting the deasired result . Later I added @ near create like shown
below
string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
OF \"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (@Create >= '"
+ FromDate.ToString("yyyy/MM/dd") + "' AND @Create<= '" +
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";
This gave me an error:
System.Data.OleDb.OleDbException: Incorrect syntax near '@'. Expected '(',
NOT, CAST, CONTAINS, CREATE, FREETEXT, MATCHES, ID. SQLSTATE=42000 at
downloadECN1.FillDataSet(String Connect, String Command, String TableName) at
downloadECN1.GetEcnDetails(DateTime FromDate, DateTime ToDate) at
downloadECN1.btnECNSearch_Click(Object sender, EventArgs e).
Please help me in this matter
Thanks in advance
Parvez Mohamed
-
Re: Indexing service Query help in asp.net ( c#)
Your query is for the creation dates of the files. Are you sure you are not
looking for the last modified date (the write property)?
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Parvez" <Parvez@discussions.microsoft.com> wrote in message
news:3AE6EAD6-0280-4D48-A375-DFDB1A38B8E1@microsoft.com...
> string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
> OF
> \"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (Create >= '" +
> FromDate.ToString("yyyy/MM/dd") + "' AND Create<= '" +
> ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName +
> "%')
> Order By Create";
>
> Above given is my indexing service query. I have written this to get
> files
> between two dates that it has created. I am geting wrong results and many
> files are not dispalyed. If i remove the Date condintion in the where
> clause
> i am getting the deasired result . Later I added @ near create like shown
> below
>
> string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
> OF \"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (@Create >=
> '"
> + FromDate.ToString("yyyy/MM/dd") + "' AND @Create<= '" +
> ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName +
> "%')
> Order By Create";
>
> This gave me an error:
> System.Data.OleDb.OleDbException: Incorrect syntax near '@'. Expected '(',
> NOT, CAST, CONTAINS, CREATE, FREETEXT, MATCHES, ID. SQLSTATE=42000 at
> downloadECN1.FillDataSet(String Connect, String Command, String TableName)
> at
> downloadECN1.GetEcnDetails(DateTime FromDate, DateTime ToDate) at
> downloadECN1.btnECNSearch_Click(Object sender, EventArgs e).
>
> Please help me in this matter
> Thanks in advance
> Parvez Mohamed
-
Re: Indexing service Query help in asp.net ( c#)
I am specifically looking for create date. These files are non editable
..So will the create date be equal to write( even if it is viewed many times)
"Hilary Cotter" wrote:
> Your query is for the creation dates of the files. Are you sure you are not
> looking for the last modified date (the write property)?
>
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
>
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
>
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
>
>
> "Parvez" <Parvez@discussions.microsoft.com> wrote in message
> news:3AE6EAD6-0280-4D48-A375-DFDB1A38B8E1@microsoft.com...
> > string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
> > OF
> > \"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (Create >= '" +
> > FromDate.ToString("yyyy/MM/dd") + "' AND Create<= '" +
> > ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName +
> > "%')
> > Order By Create";
> >
> > Above given is my indexing service query. I have written this to get
> > files
> > between two dates that it has created. I am geting wrong results and many
> > files are not dispalyed. If i remove the Date condintion in the where
> > clause
> > i am getting the deasired result . Later I added @ near create like shown
> > below
> >
> > string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
> > OF \"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (@Create >=
> > '"
> > + FromDate.ToString("yyyy/MM/dd") + "' AND @Create<= '" +
> > ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName +
> > "%')
> > Order By Create";
> >
> > This gave me an error:
> > System.Data.OleDb.OleDbException: Incorrect syntax near '@'. Expected '(',
> > NOT, CAST, CONTAINS, CREATE, FREETEXT, MATCHES, ID. SQLSTATE=42000 at
> > downloadECN1.FillDataSet(String Connect, String Command, String TableName)
> > at
> > downloadECN1.GetEcnDetails(DateTime FromDate, DateTime ToDate) at
> > downloadECN1.btnECNSearch_Click(Object sender, EventArgs e).
> >
> > Please help me in this matter
> > Thanks in advance
> > Parvez Mohamed
>
>
>
Similar Threads
-
By Application Development in forum Inetserver
Replies: 4
Last Post: 02-13-2007, 02:36 AM
-
By Application Development in forum Inetserver
Replies: 1
Last Post: 03-13-2006, 07:09 AM
-
By Application Development in forum Inetserver
Replies: 1
Last Post: 01-22-2006, 07:45 AM
-
By Application Development in forum Inetserver
Replies: 3
Last Post: 07-20-2005, 06:58 AM
-
By Application Development in forum Inetserver
Replies: 4
Last Post: 01-20-2004, 06:21 PM