score:2
Forgive me, without much knowledge about this LINQ usage my answer might be totally off.
This question seems to be related though and suggests that you parse/convert the (quoted in that case!) value.
score:1
You say cookie
and cookie2
are strings... what about m_CategoryID
?
have you tried
ldsCustomerLinks.Where = ldsCustomerLinks.Where + " && CategoryID == " + m_CategoryID.ToString();
OK - I was suspicious of the lack of quotes for CustomerNumber in the 'Where' string, but not confident enough to post it as a suggestion (having a bad SO day!)
So to answer the second question:
the type mismatch comes within the database, where CustomerNumber (I am inferring) is a string, but you are building a query with a number, like
CustomerID == 312 && CustomerNumber == 45654789 && CategoryID == 3
where you should be saying
CustomerID == 312 && CustomerNumber == "45654789" && CategoryID == 3
and to get the quotes within a string (which is enclosed by quotes) you need to use the """ syntax.
Source: stackoverflow.com
Related Query
- Dynamically setting LINQ datasource results in Operator '==' incompatible with operand types 'String' and 'Int32'
- LINQ subquery with AND operator displays no results
- Setting a variable to linq query with no results
- Linq Dynamic Query Issue - Operator '&&' incompatible with operand types 'String' and 'Boolean'
- How to dynamically create linq code at runtime and get results
- Linq Dynamic Query Issue - Operator 'OR' incompatible with operand types 'Boolean' and 'String'
- Linq to xml with missing nodes in the source XML and null-coalescing operator won't work
- How to dynamically add OR operator to WHERE clause in LINQ
- Paginated search results with LINQ to SQL
- Handling null results with the LINQ Average() method
- The || (or) Operator in Linq with C#
- LINQ sum collection of items to return object with results (multiple columns)
- LINQ How to define a default type for use with ElementAtOrDefault Operator
- Dynamically cast IEnumerable to IQueryable or dynamically call AsQueryable with LINQ Expressions
- Dynamically Sorting with LINQ
- Dynamically generate LINQ select with nested properties
- Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool>
- LINQ Source Code Available
- Linq Dynamically append Where clauses with OR
- Use == operator with generic type in a Where Linq statement
- Error with two structurally incompatible initializations within a single LINQ
- Linq with where clause in many-to-many EF Code First object
- linq join operator type with lambda syntax
- EBay OData Type Provider in F# and getting no results with LINQ
- Why am I getting different results filtering with foreach vs LINQ .Where()?
- Where with IN operator using Linq on NHibernate
- Fill ComboBox with Results of LINQ Query, Directly
- Queryable.Intersect() with SQLite and Linq not giving expected results
- LINQ GroupBy with SQLite.EF6 results in 'APPLY joins are not supported' exception
- Linq to Sql with the And operator on the same field
More Query from same tag
- LINQ ToList().Take(10) vs Take(10).ToList() which one generates more efficient query
- What i need to Change here in my List<> on employee object
- Distinct doesn't work on Entity Framework
- How to use multiple groupby statements in Entity Framework linq?
- Convert Left Outer join with 2 condition in relation to LINQ
- DeleteOnSubmit doesn't exist?
- Join 2 lists by order instead of condition in LINQ
- C#, dynamic linq error No applicable method 'Contains' exists in type 'String'
- SQL data projection with nested query in ef-core
- How to get the name of elements/attributes in xml files and write these into another new xml file using LINQ
- linq query which will return single values and a list in one call
- Linq -- Join on joined table's primary key
- Why are stored procedures, functions, and views put into a .dbml file instead of the code file?
- How convert to linq request?
- Linq to SQL Slow Query
- Sort XML file by attribute but keep the parent structure [dynamic]
- Fastest way to find index of differences in two arrays
- Asp.net MVC Question regarding n-tier
- How is using Entity + LINQ not just essentially hard coding my queries?
- Simple question regarding LINQ
- Nested LINQ Query Question
- c# linq get results by filters and discard string empty
- How to use Linq to check tags within JSon
- C# Creating an Expression in runtime with a string
- How get unmatched list from dictionary
- Loop an array and send the result to view ASP.NET
- Linq error in the select statement
- Is there any method like ForEach for IList?
- order by to the linq query
- Most efficient way to auto-hookup a foreign key in LINQ