Hi,
I love your tool Otios
but I'm sure I will love it more when I get used to it.
Thank you for ur help.
I have a problem when I am trying to do like a search on a table called "Products". I used this code just to search the "Products" table for any Product Name that has the entered value:
Dim tosearch As String
tosearch = Request.QueryString("search")
Dim EntityFieldFactory As FactoryClasses.EntityFieldFactory
Dim products As New CollectionClasses.ProductCollection
Dim filter As IPredicateExpression = New PredicateExpression
filter.Add(New FieldFullTextSearchPredicate(EntityFieldFactory.Create(ProductFieldIndex.ProductName), FullTextSearchOperator.Contains, tosearch))
Dim amount As Integer = products.GetDbCount(filter, Nothing)
resultgrid.DataSource = products.GetMulti(filter)
resultgrid.DataBind()
And when I run that code I get this error in the browser:
Server Error in '/e-commerce' Application.
--------------------------------------------------------------------------------
An exception was caught during the execution of a retrieval query: Cannot use a CONTAINS or FREETEXT predicate on table 'dbo.Products' because it is not full-text indexed.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Cannot use a CONTAINS or FREETEXT predicate on table 'dbo.Products' because it is not full-text indexed.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
Source Error:
Line 511: Dim scalarQuery As IRetrievalQuery = DynamicQueryEngine.CreateSelectDQ(fields, DbUtils.DetermineConnectionToUse(containingTransaction), _
Line 512: Filter, 1, Nothing, relations, True, groupByClause)
Line 513: Return MyBase.ExecuteScalarQuery(scalarQuery, containingTransaction)
Line 514: End Function
Line 515:
Source File: C:\Inetpub\wwwroot\e-commerce\Functions\DaoClasses\ProductDAO.vb Line: 513
Stack Trace:
[ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Cannot use a CONTAINS or FREETEXT predicate on table 'dbo.Products' because it is not full-text indexed.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.]
SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.ExecuteScalar() +171
SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteScalarQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction) +151
Commerce.DaoClasses.ProductDAO.GetScalar(IEntityFields fields, ITransaction containingTransaction, IPredicate Filter, IRelationCollection relations, IGroupByCollection groupByClause) in C:\Inetpub\wwwroot\e-commerce\Functions\DaoClasses\ProductDAO.vb:513
Commerce.CollectionClasses.ProductCollection.GetScalar(ProductFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IRelationCollection relations, IGroupByCollection groupByClause) in C:\Inetpub\wwwroot\e-commerce\Functions\CollectionClasses\ProductCollection.vb:740
Commerce.CollectionClasses.ProductCollection.GetDbCount(IPredicate filter, IRelationCollection relations) in C:\Inetpub\wwwroot\e-commerce\Functions\CollectionClasses\ProductCollection.vb:660
e_commerce.search_results.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\e-commerce\search_results.aspx.vb:38
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
So can you please tell me what is the problem ?
Thank you.