Binding Datasource to an Entity that is mapped to a view

Posts   
 
    
Loan
User
Posts: 46
Joined: 07-Nov-2007
# Posted on: 12-Mar-2008 11:53:18   

LLBLGen Pro Version 2.5 Final (Released December 5th 2007) using adapter

I decided to start a new thread because, the typed view was not really what I wanted to use. I have attached a screen capture of the LLBL project to show what I've done.

However, when I go into C#, Visual Studio 2008 click on datasource for BindingSource component, assign it to the new BudgetLineEntity, nothing happens and if I click on the Datasource property again, I get an error message: Object reference not set to an instance of an object.

Here is the code to retrieve the entity. But it's not being used, because I am only working in design mode at the moment.

    public static EntityCollection<BudgetLineEntity> getBudgetCollection()
    {
        EntityCollection<BudgetLineEntity> col =
            new EntityCollection<BudgetLineEntity>(new BudgetLineEntityFactory());
        using (DataAccessAdapter adapter = new DataAccessAdapter())
        {
            adapter.FetchEntityCollection(col, null);
        }
        return col;
    }
Attachments
Filename File size Added on Approval
ErrorMessage.JPG 12,163 12-Mar-2008 11:53.34 Approved
Loan
User
Posts: 46
Joined: 07-Nov-2007
# Posted on: 12-Mar-2008 12:02:40   

Something has gone wonky in my current project, I really wish some one could tell me what. In any case, I created a new project in Visual Studio 2008, to try out the new entity and it works just fine.

So, unless one of you guys could sit at my desk and dig into the project, I highly doubt we will get it resolved.

The only frustrating thing, is that this is the 2nd time this has happened, but the last time it happened, it was at the beginning of the project, so I did not mind starting a new project, now I am quite a bit further into the project and it will take some work to start from the beginning. I will be able to just copy all the code atleast.

If this has happened to anyone else, please let me know.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 12-Mar-2008 13:11:37   

Without the .lgp file we can't do a lot. vs.net doesn't reveal a stacktrace so the exception could be anywhere, including in microsoft's code. These issues with design time databinding are hard to track down due to this.

If you have a repro project, thus vs.net 2008 project, which we could check out ourselves, we can attach a second vs.net instance and try to debug the design time code to see where it goes wrong. But as said, it can be anywhere, as there's no stacktrace.

Your reports are alittle inconsistent though: first you had this with a typedview and now with an entity? Because the weird thing is: a typedview is a datatable, so there's little/no design time code from us in that class. If that goes wrong, something else is going wrong...

Frans Bouma | Lead developer LLBLGen Pro
Loan
User
Posts: 46
Joined: 07-Nov-2007
# Posted on: 13-Mar-2008 00:35:59   

I found the source of the problem after probing the internet.

Basically, there is a datasource folder which contains .datasource files, if anyone of these is corrupted, missing, or if you somehow generate a bad datasource (which I did by making a mistake in my view definition) then the visual studio designer stops working.

Conclusion, it wasn't an LLBL issue. I'll close this thread.