The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Collection Not Defined - Design Time

Last post 03-27-2007, 12:19 PM by quimbo. 4 replies.
Sort Posts: Previous Next
  •  03-26-2007, 11:41 AM 1409

    Collection Not Defined - Design Time

    EntitySpaces Version # 2007.0.318.0
    MyGeneration Version # 1.2.0.2

    Inside my solution i have a project called Calltracker.Library.  This is where I store my Custom and Generated BusinessObjects

    My form is in a project called CTWin.  This project has a reference to Calltracker.Library

    I add a datasource, pointing to  CallTracker.Library.BusinessObjects.CallTypeCollection

    I drag it onto the form and a DataGridView is created.

     When i try to run, i get this error inside the Designer.vb file:

      Type 'CallTracker.Library.BusinessObjects.CallTypeCollection' is not defined.   

    pointing to this line of code:

     

    Code:
     Me.CallTypeCollectionBindingSource.DataSource = GetType(CallTracker.Library.BusinessObjects.CallTypeCollection)

    If i add this line to the Designer Code:

     

    Code:
    Imports CallTracker.Library

      i can change the designer code to this:

     

    Code:
    Me.CallTypeCollectionBindingSource.DataSource = GetType(BusinessObjects.CallTypeCollection)
     

    I'm sure i'm missing something simple but cannot figure it out.  i want to avoid having to modify the designer code.     


     

     

     

     

     

     

     

  •  03-26-2007, 11:57 AM 1410 in reply to 1409

    Re: Collection Not Defined - Design Time

    Am I correct in understanding that this is a Windows.Forms project?  Either way this is a .NET thing, I would do some searching on Google as this all happens long before any EntitySpaces code is executed. It appears that it cannot determine that the EntitySpaces collection can be found in that dll, have you added that imports statement to your main form's vb file? And do you have a reference to it? Also, are you running with STRICT turned on? It's in your VS Project settings some where, it might flush some things out. 

    Still, something is wrong with that code, you still have to Load and populate the entity collection yourself, our EntitySpaces trial does it, perhaps David will chime in, somethings not correct with that code.


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  03-26-2007, 12:10 PM 1411 in reply to 1410

    Re: Collection Not Defined - Design Time

    Yes it is Windows.Forms

    I will search google later on to see if i can find anything, however I will probably use Run-Time binding as I like to have a little more control over what is going on.

    The imports statement is there because i can reference the different objects in 

    Option Strict is set to On

     

     

     

  •  03-26-2007, 3:16 PM 1418 in reply to 1411

    Re: Collection Not Defined - Design Time

    The Designer class for a Form is a partial class on that Form. I believe if you add an Imports statement for the full namespace in the code for your Form, you should not have to make any changes in the Designer code.

    Code:
    Imports CallTracker.Library.BusinessObjects

    David Neal Parsons
    www.entityspaces.net
  •  03-27-2007, 12:19 PM 1440 in reply to 1418

    Re: Collection Not Defined - Design Time

    no. i added
    Code:
    Imports CallTracker.Library.BusinessObjects
     
    The designer added this line of code:
     
    Code:
           Me.CourierBindingSource.DataSource = GetType(CallTracker.Library.BusinessObjects.Courier)
    
     
     if i change that designed added line of code to:
     
    Code:
    Me.CourierBindingSource.DataSource = GetType(Courier)
     
    and include the imports, it runs fine
View as RSS news feed in XML