?
Solved

Linq Contains Operator no working

Posted on 2014-09-02
3
Medium Priority
?
120 Views
Last Modified: 2016-02-15
Not sure why I am not returning
 var testType = new string[] { "1,3,10,11,12,13,17" };


var GetString = atesttype.Load()
                .Where(e => e.TypeID == 1 && e.Active == true && testType.Contains(e.Type.ToString()))
.Select(v => new { v.ship }).ToList().Distinct();

Example
select ship from atesttype where typeid =1 And Active = 1 and TestType in (1,3,10)

Open in new window

0
Comment
Question by:Seven price
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 40300196
Hi sevensnake77;

I think you meant to assign the array testType as follows having 7 elements and NOT one element in the array with one long string.

var testType = new string[] { "1","3","10","11","12","13","17" };

Open in new window

0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 40300946
adull. I should of known, thanks.
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 40300955
Not a problem sevensnake77, glad I was able to help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question