Parvez
2006-11-08 05:57:33 UTC
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
\"/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