I am only using one entity framework context...
The bindingsource  is an object, DomainClasses.SalesOrder 
so how can it be keeping 1 to 5 connections open?
 
to set up the bindingsource I am using
DbSet<DomainClasses.SalesOrder> dset = Db.SalesOrders;

dset.Load();

salesOrderBindingSource.DataSource = dset.Local.ToBindingList();

 
How come WPF binding is good and Winforms binding is bad?

  _____  

From: [email protected] [mailto:[email protected]]
On Behalf Of Davy Jones
Sent: Thursday, 7 November 2013 10:35 AM
To: ozDotNet
Subject: Re: Are BindingSource and BindingNavigator just for writing demos?


Same rule applies don't autobind. You end up with 1-5 connections open on
the database. Do your own mapping and binding away from the EF objects.

If you don't make the break from the bound objects, you have to deal with
objects that have been disassociated from their context and are stale.

As ever datalayer is for connecting to the database and translating to and
from your private objects. 

Davy.
Ps. My current team went against my advice and now are feeling the pain.
Lucky i have nothing to do with that part of the code. 

Sent from my starfleet datapad.

On 7 nov. 2013, at 00:04, Kirsten Greed <[email protected]> wrote:



I am using Entity Framework with Winforms
I have set up my object as a data source and would like to do a sales order
maintenance screen.
 
Can I use BindingSource and BindingNavigator controls in this scenario?
 
With my VB6 legacy code i learned not to use them, however I want to try
again with VS2012 and C#
Thanks
Kirsten



__________ Information from ESET NOD32 Antivirus, version of virus signature
database 9014 (20131106) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Reply via email to