There is no direct IN equivalent in linq. Instead you can use Contains() or any other trick to implement the same. Here is a sample using .Conains():

	string[] s = new string[5];
	s[0] = "34";
	s[1] = "12";
	s[2] = "55";
	s[3] = "4";
	s[4] = "61";
 
	var result1 = from d in context.TableName
                      where s.Contains(d.fieldname)
                      select d;
VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. LINQ Group : how to
  2. Extreme beginner’s LINQ sample in VB.NET
  3. Apply LINQ on XML string
  4. Build DateTime from values
  5. LINQ, SQLMetal and SqlTac