Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Linq in 3.0 Framework

Linq in 3.0 Framework

Scheduled Pinned Locked Moved C#
csharpasp-netdatabaselinqregex
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tiger456
    wrote on last edited by
    #1

    In my smart client application (3.0 Framework) i would like to use Linq. Whe i tried below code.

    string[] names = { "Burke", "Connor", "Frank",
    "Everett", "Albert", "George",
    "Harris", "David" };

            IEnumerable<string> expr = from s in names
                                       where s.Length == 5
                                       orderby s
                                       select s.ToUpper();
    
            foreach (string item in expr) { Console.WriteLine(item); }
    

    This code is throwing an error message Could not find an implementation of the query pattern for source type 'string[]'. 'Where' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'? i have used System.Linq directive in code but unable to add 'System.Core.dll' becuse as it disable. As per the requirement we need to stick on with 3.0 Framework. Any other way to do it.

    H 1 Reply Last reply
    0
    • T Tiger456

      In my smart client application (3.0 Framework) i would like to use Linq. Whe i tried below code.

      string[] names = { "Burke", "Connor", "Frank",
      "Everett", "Albert", "George",
      "Harris", "David" };

              IEnumerable<string> expr = from s in names
                                         where s.Length == 5
                                         orderby s
                                         select s.ToUpper();
      
              foreach (string item in expr) { Console.WriteLine(item); }
      

      This code is throwing an error message Could not find an implementation of the query pattern for source type 'string[]'. 'Where' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'? i have used System.Linq directive in code but unable to add 'System.Core.dll' becuse as it disable. As per the requirement we need to stick on with 3.0 Framework. Any other way to do it.

      H Offline
      H Offline
      Hiren solanki
      wrote on last edited by
      #2

      Tiger456 wrote:

      Could not find an implementation of the query pattern for source type 'string[]'. 'Where' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?

      I think IEnumerable is not supported by LINQ in .NET 3.0 Framework. You need to implement that functionality manually or initialize query result with var statement. Click Here for more..[^]

      Regards, Hiren. "The more we give of anything, the more we shall get back." - Grace Speare (you can consider this quote while giving vote also) Microsoft Dynamics CRM

      modified on Friday, December 3, 2010 1:28 AM

      T 1 Reply Last reply
      0
      • H Hiren solanki

        Tiger456 wrote:

        Could not find an implementation of the query pattern for source type 'string[]'. 'Where' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?

        I think IEnumerable is not supported by LINQ in .NET 3.0 Framework. You need to implement that functionality manually or initialize query result with var statement. Click Here for more..[^]

        Regards, Hiren. "The more we give of anything, the more we shall get back." - Grace Speare (you can consider this quote while giving vote also) Microsoft Dynamics CRM

        modified on Friday, December 3, 2010 1:28 AM

        T Offline
        T Offline
        Tiger456
        wrote on last edited by
        #3

        Thanks for the response. But using this method will force the client machine to have .NET 3.5 Framework to run appication right ?

        H 1 Reply Last reply
        0
        • T Tiger456

          Thanks for the response. But using this method will force the client machine to have .NET 3.5 Framework to run appication right ?

          H Offline
          H Offline
          Hiren solanki
          wrote on last edited by
          #4

          Yes, For your code you need to upgrade to FW 3.5. Or you can achieve the same manually using the link I provided.

          Regards, Hiren. "The more we give of anything, the more we shall get back." - Grace Speare (you can consider this quote while giving vote also) Microsoft Dynamics CRM

          T 1 Reply Last reply
          0
          • H Hiren solanki

            Yes, For your code you need to upgrade to FW 3.5. Or you can achieve the same manually using the link I provided.

            Regards, Hiren. "The more we give of anything, the more we shall get back." - Grace Speare (you can consider this quote while giving vote also) Microsoft Dynamics CRM

            T Offline
            T Offline
            Tiger456
            wrote on last edited by
            #5

            So with .NET Framework 2.0 its not possible ?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups