MTrinder wrote:
Are you getting the message when you try and compile the generated code - or when you use it in code...?
If it's in code could you post a stack trace so we can take a look?
Thanks
Matt
The project compiles fine, it's when it's running that it dies with the error because the code is generating a query that the database can't execute because of the column difference.
The ComputerName column was renamed to HardwareName and the IsAdmin column was deleted from the table.
Here is the exception details.
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException was unhandled by user code
Message="An exception was caught during the execution of a retrieval query: Invalid column name 'ComputerName'.\r\nInvalid column name 'IsAdmin'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."
Source="SD.LLBLGen.Pro.ORMSupportClasses.NET20"
RuntimeBuild="01222008"
RuntimeVersion="2.5.0.0"
QueryExecuted="\r\n\tQuery: SELECT [CDGEquipment].[dbo].[UserHardware].[HardwareID] AS [HardwareId], [CDGEquipment].[dbo].[UserHardware].[UserID] AS [UserId], [CDGEquipment].[dbo].[UserHardware].[Make], [CDGEquipment].[dbo].[UserHardware].[Model], [CDGEquipment].[dbo].[UserHardware].[MfgModel], [CDGEquipment].[dbo].[UserHardware].[ComputerName], [CDGEquipment].[dbo].[UserHardware].[SerialNumber], [CDGEquipment].[dbo].[UserHardware].[IsAdmin], [CDGEquipment].[dbo].[UserHardware].[RetiredDate] FROM [CDGEquipment].[dbo].[UserHardware] WHERE ( ( [CDGEquipment].[dbo].[UserHardware].[UserID] = @UserId1))\r\n\tParameter: @UserId1 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 1.\r\n"
StackTrace:
at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, IEntityFactory2 entityFactory, IEntityCollection2 collectionToFill, IFieldPersistenceInfo[] fieldsPersistenceInfo, Boolean allowDuplicates, IEntityFields2 fieldsUsedForQuery)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollectionInternal(IEntityCollection2 collectionToFill, IRelationPredicateBucket& filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket)
at Wellsfargo.CDG.Equipment.AppServices.EquipmentManager.GetHardwares(Int32 userId, IEntityCollection2 results) in C:\Program Files\Projects\Equipment Manager\EquipmentManagerSln\Wellsfargo.CDG.Equipment.AppServices\EquipmentManager.cs:line 72
at _Default.hardwareDS_PerformSelect(Object sender, PerformSelectEventArgs2 e) in c:\Program Files\Projects\Equipment Manager\EquipmentManagerSln\EquipmentManagerWebsite\Default.aspx.cs:line 336
at SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSource2.OnPerformSelect(PerformSelectEventArgs2 eventArgs)
at SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelectEntityCollection(Int32 pageSize, Int32 pageNumber, DataSourceSelectArguments arguments)
at SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelect(DataSourceSelectArguments arguments)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at System.Web.UI.WebControls.GridView.DataBind()
at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
at System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e)
at System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)