Error when retrieving a MySQL view

Posts   
 
    
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 07-Apr-2008 15:44:07   

Hi,

I have the latest version of MySql, LLBLGen and the CoreLab thingy but I'm getting this error from the following code...


EntityCollection<VwSkinEntity> collection = new EntityCollection<VwSkinEntity>();

DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(collection, null);

[ArgumentNullException: Fields can't be set to null Parameter name: Fields] SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.set_Fields(IEntityFields2 value) +86 *.LLBLGen.EntityClasses.VwSkinEntity.InitClassEmpty(IValidator validator, IEntityFields2 fields) in C:\Documents and Settings*\My Documents\LLBLGen Pro Projects\DatabaseGeneric\EntityClasses\VwSkinEntity.cs:398 *.LLBLGen.EntityClasses.VwSkinEntity..ctor() in C:\Documents and Settings*\My Documents\LLBLGen Pro Projects\DatabaseGeneric\EntityClasses\VwSkinEntity.cs:75

[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268 System.Activator.CreateInstance(Type type, Boolean nonPublic) +66 System.Activator.CreateInstance(Type type) +6 SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase21.DetermineEntityFactory() +118 SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase21..ctor(IEntityFactory2 entityFactoryToUse) +45 *.LLBLGen.HelperClasses.EntityCollection`1..ctor() in C:\Documents and Settings*\My Documents\LLBLGen Pro Projects\DatabaseGeneric\HelperClasses\EntityCollection.cs:84 *._Default.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings*\My Documents\Visual Studio 2005\Projects**\Default.aspx.cs:23 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Any ideas?

Cheers, Ian.

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 07-Apr-2008 19:47:57   

are you sure is only this:

EntityCollection<VwSkinEntity> collection = new EntityCollection<VwSkinEntity>();

DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(collection, null);

Please try regenerating your entities.

Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 15-Apr-2008 10:56:45   

The problem seems to be that when I add the view to the designer there's no information about the view. '#of fields' is '0'.

Here's the view..


DROP VIEW IF EXISTS `sdn_digital_signage`.`vw_player_aw_schedule`;
CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vw_player_aw_schedule` AS

select

max(`tbl_player_aw_schedule_feed`.`PlayerID`) AS `PlayerID`,
`tbl_player_aw_schedule_feed`.`ScheduleID` AS `ScheduleID

from
`tbl_player_aw_schedule_feed`

group by
`tbl_player_aw_schedule_feed`.`ScheduleID`;

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Apr-2008 12:24:23   

Would you please check the Designer output window for possible errors when refreshing the catalog.

Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 15-Apr-2008 12:57:25   

Ahh, I did a full refresh instead of an unattended and noticed that the 'views' checkbox wasn't selected. So I checked it and now the fields appear when the view is added.

So I don't think the view should have been added to the list of views during the unattended.