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. LINQ
  4. LINQ To Datatable......................

LINQ To Datatable......................

Scheduled Pinned Locked Moved LINQ
csharpdatabaselinq
3 Posts 3 Posters 2 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi experts I want to fill data table using LINQ but i have no dbml file i want to fill data table with dynamic LINQ Query.

    F E 2 Replies Last reply
    0
    • L Lost User

      Hi experts I want to fill data table using LINQ but i have no dbml file i want to fill data table with dynamic LINQ Query.

      F Offline
      F Offline
      Fernando Soto
      wrote on last edited by
      #2

      What is the source of the data to fill the DataTable and is the DataTable already instantiated?

      1 Reply Last reply
      0
      • L Lost User

        Hi experts I want to fill data table using LINQ but i have no dbml file i want to fill data table with dynamic LINQ Query.

        E Offline
        E Offline
        ElCachubrey
        wrote on last edited by
        #3

        Hi! There is no way to do it directly. The first way to do it is fill entity at first and then use CopyToDataTable() method. Since you haven't had dbml file (dataContext) you can't do it. Or more complex you should write your own extension method which takes ExpressionTree and translates it in string represntation then simply use standard DataSet approach for DataTable filling. (Still it is very inconvinent) Generally speaking it is not good itdea to mix DataSet and LinqToSQL approach in one project. More here: http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/05996101-299e-423c-9137-e3b8d02890e1/

        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