views:

139

answers:

2

I have a very typical linq-to-entities data binding in WinForms:

myGrid.DataSource = myEntities.entity

When it reaches that line of code it simply hangs. Similar assignment a different entity work fine elsewhere in the code. The database contains no more than 50 lines of data in all entities (it's a new project) so it's not waiting on data.

+1  A: 

Depending on if it's asp.net or windows forms... If it's a asp.net client you are trying to databind I would recommend sending the results to a List before assigning it to any datasource.

mhenrixon
Winforms. Interestingly, I may have found the solution. I had an entity we'll call C, which linked entities A and B together as a join table. I decided A and B could be linked directly. Apparently this messed up the internal Linq logic and binding to either A or B then hung. When I removed C the binding to A and B started working.
Jeff
Navigational properties can be a pain in the ?$$ at times :)
mhenrixon
A: 

Interestingly, I may have found the solution. I had an entity we'll call C, which linked entities A and B together as a join table. I decided A and B could be linked directly. Apparently this messed up the internal Linq logic and binding to either A or B then hung. When I removed C the binding to A and B started working.

Jeff