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 pPosted Apr 15, 2009, 1:21 AM
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 };
NeCroFirePosted Apr 17, 2009, 4:26 AM
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
NeCroFirePosted Apr 15, 2009, 7:14 AM
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?
Niradhip ChakrabortyPosted Apr 15, 2009, 6:50 AM
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
NeCroFirePosted Apr 15, 2009, 6:30 AM
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.