Find all cities that starts with A small program with Linq in C#

Code with C | Programming: Projects & Source Codes Forums C# Programming Find all cities that starts with A small program with Linq in C#

This topic contains 1 reply, has 1 voice, and was last updated by  Abhey 2 years, 9 months ago.

  • Author
    Posts
  • #10181

    ShikhaTan
    Member

    Show each region in which there is at least one male member who lives in a city whose name starts with the letter A.

    The question to me is asking for a city that starts with A. If it’s only one table then you only need to select Region. I don’t use SQL very often, but below is how I would do it with Linq in C#.This would return both USA and Canada because there is at least one member that is a male in both USA and Canada that lives in a City that starts with A.

  • #10182

    Abhey
    Member

    SELECT Region FROM Members WHERE Gender == ‘M’ AND City LIKE ‘A%’;

You must be logged in to reply to this topic.