The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
2answers
441 views

Lookup using Entity Framework (SQL query to LINQ)

Problem : I am trying to do lookup cross 2 tables using Entity Framework unfortunately I couldn't find way but I do have sql query which does what I want SQL Query select top(1) p1.Percentage ...
2
votes
1answer
160 views

How to convert SQL date query to Entity Framework

I am using Entity frame work, i want to convert SQL query of LIKE date to Entity framework. here is the query Select * from Schedule where SerialNo='11119' and DueDate like '%2012%'
2
votes
1answer
1k views

MSSQL / C# EF — mapping tinyint to int?

I have about a dozen fields marked as tinyint, which translates to a byte field. I'm finding that I'm having to do a lot of casting to int in my code to interact with integers. Because of this, I'm ...
1
vote
3answers
75 views

SQL to Entities - Return a record despite a field being empty

(I'm new to Entity Framework, so apologies if this is an easy question!) In my DB table, I have a column titled [SiteURL] and another [Keywords] I have records in there, but some do not have any ...
0
votes
1answer
44 views

Are you missing a using directive or an assembly reference? Entity framework Distinct Function

I have requirement in which i just want to return List of Unique Vendor ID based on Service Status, Done/No; Select Distinct(vendorid) FROM DC_System_Assets where ServiceStatus='Done' I tried to ...
0
votes
1answer
324 views

Convert SQL subquery to EF Query using Lambda syntax

Here is SQL Query,,, I have two tables, one is Categoreis and other Sub Categories,,, I want to use inner query(Category table) and that value pass to outer query(Sub categories table) How to convert ...
0
votes
1answer
126 views

Does EF4 support mapping 1 component from several tables?

At my company we have a database with one table being so big that it was splitted into 3 tables. They all share an ID and the info is NOT normalized so there is info for several entities in the ...
0
votes
1answer
136 views

How to make conversion SQL Inner joins query vs Entity Framework

Here are three tables Service_Orders, Project_Services and Company. There is inner join between 3 tables by Service Order and CompanyID. I want below query to convert into Entity framework with Lamda ...
0
votes
2answers
154 views

How to write lambda expression for an sql expression?

I have an SQL expression select S.SpecialtyName, COUNT(distinct SUC.SiteUserId) as Subscribers from SiteUserContent SUC Inner join Specialties S on SUC.SpecialtyId = S.SpecialtyId Inner ...
0
votes
1answer
21 views

How to select collection instead of collection of collections in SqlToEntity?

Suppose you have Role class, and each Role has a collection of Users. I want to select all users within specified collections. I do: DataContext.Roles.Where(r=>r==r1||r==r2).Select(r=>r.Users); ...
0
votes
1answer
100 views

Help to: Convert a sql command to EF 4.1 Code First

I have this schema: ...and I want to select some records using this query: SELECT Articles.ArticleId, Articles.Title, Articles.Tooltip, Articles.UriTitle, Articles.SubTitle, ...
0
votes
0answers
43 views

How to get current ident of SQL table in entity framework

I want get last index of already existing data in SQL TABLE.... in Entity Framework.... mean what is last index of my table. i have SQL Query as below SELECT ...
0
votes
1answer
222 views

Dynamically select a list of properties from an entity

I have a collection IEnumerable. In a LINQ query, preferably, I would like to select only the properties in this collection from type T, into an anonymous type, where T is a POCO business object. ...