New Posts New Posts RSS Feed: DevForceDataSource
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DevForceDataSource

 Post Reply Post Reply
Author
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Topic: DevForceDataSource
    Posted: 30-Dec-2008 at 2:20pm
I am having an issue with the DevForceDataSource object when running the ExecuteSelect method.
 
I am mimicking the example:
-Create a dropdownlist for entities <Organization>
-Create DFDS to run GetAllEntities for <Organization>
 
Outcome: Runs successfully
 
-Create DetailsView
-Create DFDS to GetSelectedEntity using ControlParameter from the SelectedValue from the dropdownlist
 
Outcome: fails: Cannot cast Organization to IEnumerable
 
This does not make sense to me. ExecuteSelect for GetAllEntities is made of of a list of Organizations and passes. But, getting one Organization fails. List<Organization> is based off of Organization which is based from Entity which is based from DataRow. DataRow should be IEnumerable correct?
 
Please help. Been trying to track this down for a few days.


Edited by orcities - 30-Dec-2008 at 2:21pm
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 31-Dec-2008 at 8:35am
DevForceDataSource ia working as designed,  It expects a list of Entities, not a single Entity.  Therefore, you must return  a list containing a single Entity.  A single Orgnization is not the same as an EntityList<Organization> even when the EntityList contains a single  Organizatiion.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 31-Dec-2008 at 9:22am
I did it exactly like the example. The example works and mine does not. The example has it return 1 record and it is successful.
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 31-Dec-2008 at 2:13pm
Try doing a cast to IEnumerable before you return the result.  I know this should not be necessary, but I remember once doing it anyway, and it fixed my problem.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down