We started working with the "ADO.NET Entity Data Model" Template and we like it a lot.
We are having some trouble with the queries though.
How do we do a query from multiple tables so it would return a single result and then show the result in a DataGrid?
We're working in C# and Windows Forms.
Loading

ramesh p66 reputationPosted Apr 14, 2009, 9:21 PM EDT
Please try like this...
gvIncidents.DataSource =
from i in db.Incidents
from it in db.IncidentTypes
where (i.IncidentTypeId == it.IncidentTypeId)
orderby i.IncidentId descending
select new { IncidentId = i.IncidentId,
DateEntered = i.DateEntered,
EnteredBy = i.EnteredBy,
SchoolId = i.SchoolId,
CallerName = i.CallerName,
ParentIds = i.ParentIds,
StudentIds = i.StudentIds,
IncidentTypeName = it.IncidentTypeName };
NeCroFire82 reputationPosted Apr 15, 2009, 2:30 AM EDT
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
I have created a separate project where I have added the the entity model and compiled it to a dll. Then I'm referencing the dll from my Service level. The error came up in the My_Entities.Designer.cs file.
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Apr 15, 2009, 2:50 AM EDT
For that particular error you can refer the following solution.
http://blogs.interakting.co.uk/mattnield/archive/2008/01/25/LINQ-Error-19-Could-not-find-an-implementation-of-the.aspx
NeCroFire82 reputationPosted Apr 15, 2009, 3:14 AM EDT
I don't follow what he means here. I made my Entity model as straight forward as possible, but I'm guessing that's the problem. What exactly do I need to change or redo to get my source Enumerable?? And if it's just a property, where do I change it?
NeCroFire82 reputationPosted Apr 17, 2009, 12:26 AM EDT
Read here if there is anyone else having trouble with running and Entity model as a separate project/Data Layer. Just look for my name.
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/d0261818-ed96-43b6-adfd-3c146d8e1a68?prof=required
Cheers