LLBLGen Pro exception: The multi-part identifier "MyDatabase.dbo.User.Name" could not be bound

If you get an exception like: System.Web.HttpUnhandledException (0x80004005): Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: The multi-part identifier "MyDatabase.dbo.User.Name" could not be bound.. make sure you use corresponding EntityFactory and Fields:   EntityCollection items = new EntityCollection(new UserEntityFactory()); …

Cannot find column Customer when sorting a Telerik RadGrid column with LLBLGen entities

When you sort a column in a Telerik RadGrid you get the error “Cannot find column Customer”, make sure the  SortExpression is the same as the DataField DataField="Customer.Description" HeaderText="Customer" SortExpression="Customer.Description" UniqueName="Customer" If SortExpression is not the same as the DataFiel, you will get the error: Message: Cannot find column Customer …

How to use datediff with LLBLGen Pro

If you want to use datedif to filter on a date, you can use code like: public EntityCollection<Customers> GetCustomers(DateTime creationDate) { EntityCollection<AfhaalopdrachtEntity> result = new EntityCollection<AfhaalopdrachtEntity>(); // Filter IRelationPredicateBucket filter = new RelationPredicateBucket(); IPredicate customerCreateDateFilter = new EntityField2("CreateCustomerDiff", new DbFunctionCall("DATEDIFF(day, {0}, {1})", new object[] { CustomerFields.CreationDate, creationDate})) == 0; filter.PredicateExpression.Add(customerCreateDateFilter …

Using TSQL Like operator in LLBLGen

If you want to query you’re database with LLBLGen, by filtering entities using the TQL Like operator you should use the FieldLikePredicate See LLGLGen v2.6 documentation: http://www.llblgen.com/documentation/2.6/hh_start.htm Specific part: http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/Adapter/Filtering%20and%20Sorting/gencode_filteringpredicateclasses_adapter.htm#FieldLikePredicate FieldLikePredicate Description compares the entity field specified with the pattern specified, using the LIKE operator. The pattern should contain the …

Sort ASP .NET Gridview on related table (prefetchpath) column with LLBLGen Pro

If you have a table Order and a related table Customer, you can sort and filter this data for ASP .NET with LLBLGen pro, as mentioned in the LLBLGen Pro documentation: // Define result entitycollection EntityCollection<CustomerEntity> customers = new EntityCollection<CustomerEntity>(); // Define sort (sort result on column "Order.ShipCountry") SortExpression result …

Error on calling stored procedure with LLBLGen Pro {"The ConnectionString property has not been initialized."}

When you get the error {“The ConnectionString property has not been initialized.”} on calling a stored procedure with LLBLGen Pro, you probably forgot to set the parameter “DataAccessAdapter adapter” on you’re LLBLGen Pro methode call: RetrievalProcedures.MyStoreProcedure(param1, param2, dataAccessAdapter); if you call the function like RetrievalProcedures.MyStoreProcedure(param1, param2); you will get the …