Print Page | Close Window

Question about DataSource objects

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=264
Printed Date: 30-Aug-2025 at 5:01pm


Topic: Question about DataSource objects
Posted By: Customer
Subject: Question about DataSource objects
Date Posted: 16-Jul-2007 at 10:59am
I have a model project that I have added as a reference to my UI project.  When I want to setup a bindingsource to a specific business object I have to go through the procedure of creating a new datasource.  This has created a proliferation of datasource objects in my project that I don't really think are necessary (my 'thinking' may be the whole problem).  Couldn't I somehow work around this situation?  I see no data source folders or files anywhere in the Cabana application source code.



Replies:
Posted By: IdeaBlade
Date Posted: 16-Jul-2007 at 11:01am
When I configure a binding source to support a particular binding manager, I just set the DataSource property of the binding source to something that will populate it with the entities of interest.
 
For example, I might have a line of code that reads:
 
orderSummaryBindingSource.DataSource = mPm.GetEntities<OrderSummary>();
 
or perhaps
 
EntityList<OrderSummary> orders;
orders = mPm.GetEntities<OrderSummary>();
orderSummaryBindingSource.DataSource = orders;
 
where mPm is a PersistenceManager instance.
 
I guess I don't understand why you think you need to create distinct DataSource objects to populate binding sources.  If you could explain this to me then perhaps I would better understand your difficulty.
 


Posted By: Customer
Date Posted: 16-Jul-2007 at 11:04am
Shortly after I emailed you, I did the same construction in order to eliminate any kind of data source folder/file thing.  I tested it and it worked great.  I will need to go back to earlier code and try to determine what exactly was creating these files.  It may not even be related to DevForce, so I apologize for my premature cry for help.
 



Print Page | Close Window