title: LINQ query with a where condition containing
body: <p>I am just learning LINQ and I have come across and issue Im not sure how to do in LINQ.</p>
  
  <pre><code>string numbers = "1,3,4,5";
  string[] outletsInaStringArray = outlets.Split(',');
  List&lt;string&gt; numbersAsAList = outletsInaStringArray.ToList();
  </code></pre>
  
  <p>I have a field in my database which holds a number. I only want to select the lines WHERE the number in the database is IN the line list of numbers "1,3,4,5" (these numbers are just examples).</p>
  
  <p>Thanks in advance</p>
  
  <hr>
  
  <p>I have looked at Tim and James answers and also looked at the line that James has sent. Im still a bit confused.....Sorry. Below is my actual code. It compiles but does not work</p>
  
  <pre><code>string outlets = "1,3,4,5"
  string[] outletsNeeded = outlets.Split(',');
  List&lt;string&gt; outletsNeededList = outletsNeeded.ToList();
  
  DashboardEntities1 db = new DashboardEntities1();
  var deptSalesQuery =  (
  from d in db.DashboardFigures
  where (d.TypeOfinformation == "DEPTSALES") &amp;&amp; (outletsNeeded.ToString().Contains(d.OutletNo.ToString())) 
                                       select new DeptSales
                                       {
                                            Dn = (int)d.Number,
                                            Dnm = "Mens",
                                            On  = d.OutletNo,
                                            Qs = (double)d.Value_4,
                                            Se = (double)d.Value_2,
                                            Si = (double)d.Value_3
                                       }                                    
                                   );
  </code></pre>
  
  <p>In the DASHBAORDFIGURES table in SQL I have 2 records where the outlets number = 1, and therefore should have come up with two records.
  Sorry if this is a simple thing, its just new to me and its frustrating.</p>