Im using LLBL Gen Pro version 3 against a SQL Server 2008 R2 database. When using the generated code I get an error for the following code
Public Class CRBTApp
Public Sub New()
Dim sConn As String = System.Configuration.ConfigurationManager.AppSettings("ConnString").ToString()
Repository.DaoClasses.CommonDaoBase.ActualConnectionString = sConn
End Sub
Public Sub Test()
Dim colSubjects As New CollectionClasses.SubjectCollection()
Dim filter As New PredicateExpression()
Try
filter.Add(SubjectFields.HostIdent > 100 And SubjectFields.HostIdent < 500)
colSubjects.GetMulti(filter)
colSubjects.Sort(SubjectFieldIndex.HostIdent, System.ComponentModel.ListSortDirection.Ascending)
For Each entSubJect As SubjectEntity In colSubjects
Debug.Print(entSubJect.SubjectId.ToString())
Next
Catch oex As ORMQueryExecutionException
MessageBox.Show(oex.Message & vbCrLf & oex.InnerException.Message & vbCrLf & oex.StackTrace)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
The error message:
An exception was caught during the execution of a retrieval query: Invalid object name 'Repository.dbo.Subject'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
The stacktrace:
at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Query\RetrievalQuery.cs:line 132
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery, IFieldPersistenceInfo[] fieldPersistenceInfos) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\DaoBase.cs:line 1500
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, IPrefetchPath prefetchPathToUse, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\DaoBase.cs:line 984
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicate selectFilter, IRelationCollection relations, IPrefetchPath prefetchPathToUse, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\DaoBase.cs:line 802
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase1.GetMulti(IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, IPrefetchPath prefetchPathToUse, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\EntityCollectionBase.cs:line 777
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase
1.GetMulti(IPredicate selectFilter) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\EntityCollectionBase.cs:line 639
at BioTrustExport.CRBTApp.Test() in C:\Development\VS2010\GUI\BioTrustExport\BioTrustExport\Classes\CRBTApp.vb:line 29
The generated code I was given so that I could create an application against it. It is in use in a couple of other applications so I am thinking I am missing something somewhere but I have not been able to identify it in the docs....
What am I missing ?
Thanks