Linq Syntax - Selecting multiple columns?

This is my Linq Syntax which I am using to my entity model IQueryable<string> objEmployee = null; objEmploye...

Sequence contains no matching element?

I have an asp.net application in which I am using linq for data manipulation. While running, I get the exception "Se...

Projecting into KeyValuePair via EF / Linq?

I'm trying to load a list of KeyValuePairs from an EF / Linq query like this: return (from o in context.myTable ...

Group By ranges in Linq?

Thanks all, I am sorry but I am very beginner. Let me explain it in details: I have a table "theTable" and has two c...

Extension method with optional generic argument?

I need to implement an API based on extensions methods (i.e. I have to use a static non-generic class). API should w...

XElement namespaces (How to?)?

How to create xml document with node prefix like: <sphinx:docset> <sphinx:schema> <sphinx:fiel...

System.InvalidCastException: Specified cast is not valid. Error?

I am on a C# ASP.NET project. I have a MySQL table with a userid field of type int. Now I want to get the number ...

Linq Syntax - Selecting multiple columns?

This is my Linq Syntax which I am using to my entity model IQueryable<string> objEmployee = null; objEmploye...

“Order by Col1, Col2” using entity framework?

I need to order by 2 columns using the entity framework. How is that done? return _repository.GetSomething().Order...

Extension methods must be defined in a non-generic static class?

I'm getting the error: Extension methods must be defined in a non-generic static class On the line: public cl...

Entity framework left join?

How do I change this query so it returns all u.usergroups? from u in usergroups from p in u.UsergroupPrices select ...

Sequence contains more than one element?

I'm having some issues with grabbing a list of type "RhsTruck" through Linq and getting them to display. RhsTruck ...

Linq: GroupBy, Sum and Count?

I have a collection of products public class Product { public Product() { } public string ProductCode {get;...

How to get the index of an item in a list in a single step??

How can I find the index of an item in a list without looping through it? Currently this doesn't look very nice - s...