You need to access the
SpotLanding member of your object (which by the way, should not also be called
SpotLanding as that is just confusing).
Also you can write your query much more concisely using the overload of
Count that takes a predicate:
int spot = entrytable.Count(x => x.SpotLanding);
where SpotLanding = true
you're trying to assign a boolean value instead comparing it.
where SpotLanding == true
You need to use the == operator instead of =
var spot = (from SpotLanding in entrytable where SpotLanding == true select SpotLanding).Count;
- Linq to sql issue in C# forms application with .mdf database
- Can't add a new record with an integer value into database by using linq from code C#
- Issue with querying database using LINQ query to bring list of DTO
- Having an issue with a null exception on WPF DataGrid when trying to display data from a database with Linq
- How can I use Linq with a MySql database on Mono?
- Database is locked when inside a foreach with linq without ToList()
- Retrieving an image from database with Linq to SQL
- ASP.NET MVC TDD with LINQ and SQL database
- Application hangs using PLINQ AsParallel(). No problems with LINQ
- Issue with dynamic LINQ queries containing brackets
- NHibernate 3 LINQ inner join issue with three jumps: NotSupportedException
- LINQ Source Code Available
- Linq with where clause in many-to-many EF Code First object
- EntityFramework 6.1.1 with Linq Performance issue
- LINQ to SQL: Issue with concurrency
- LINQ to SQL - Database Design issue
- What are the prerequisites for using SQL and LINQ with my winforms application in C#?
- Issue With LINQ and Reference List
- Either an issue with my linq statement or with my GetCollection<T>()
- Is there a way to use linq in C# application with .net framework 2?
- C# - Linq optimize code with List and Where clause
- Connect to Database with Connection String to use LINQ
- whats the issue with this LINQ query?
- LINQ Confusion - Database not persisting after the application closes?
- Trying to get distinct values using LINQ with database field as parameter
- Linq to Entities : how to handle null values in database with a contains
- creating Linq to sqlite dbml from DbLinq source code
- Stubbing Code for Test With Linq Expressions and Lambdas
- Mixing local list operations with linq to entities database operations
- Reuse Linq to SQL code with entityframework
- C# Is it possible to abstract an orderby LINQ clause into a function parameter?
- Logging changes using LINQ to SQL
- LINQ request many-to-many
- linq query group by in a list of strings
- Get the number of distinct property values in List<T> using LINQ in C#
- How to do an outer join into a list while joining a third table
- Using LINQ left join with multiple conditions and subquery
- Using LINQ to sort a Class that inherits from LIST<TTYPE>
- email read from EWS (exchange web service) server cannot process this request error c#
- Using GroupBy in Linq complex
- Linq query with several left join generate few query
- IEnumerable contains IEnumerable
- Entity Framework "The wait operation timed out" on simple DeleteAll
- How do i filter and search selected fields only and exclude null textboxes in ASP.NET MVC
- Linq query with Average
- linq grouping result takes a long time
- Get data from SQL Server using linq
- Error: "The specified LINQ expression contains references to queries that are associated with different contexts"
- Linq and returning types
- Handling Population within a game (unity)