0

I have a table like blow image:

enter image description here

How do I write a LINQ query to bring records of Jan, Feb, March from the table?

my query:

 var query = (from c in db.TheMonthlyDelivery  select c).AsQueryable();

I am new to LINQ please help me.

3
  • What you have tried? Commented Dec 17, 2014 at 6:17
  • I don't know how to do it that is why I posted here Commented Dec 17, 2014 at 6:19
  • You didn't mentioned your attempted code initially, apart from that your query don't show any "efforts", your query is simply selecting the whole data, is that how you query your tables in database? Commented Dec 17, 2014 at 6:23

1 Answer 1

1

Try this:-

int[] months = { 1, 2, 3 };
var query=  db.TheMonthlyDelivery.Where(x => months.Contains(x.Date.Month));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.