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. Multiple dbml file in One Website

Multiple dbml file in One Website

Scheduled Pinned Locked Moved LINQ
databasecsharplinq
3 Posts 3 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.
  • V Offline
    V Offline
    Vishal09
    wrote on last edited by
    #1

    Hi, I have One Database for Master Tables & Another Database for Transaction Tables. I have Created two .dbml file.I want to write qurey with the combination of both files. Is it possible to write query which links two database using LINQ. Thanks.

    F E 2 Replies Last reply
    0
    • V Vishal09

      Hi, I have One Database for Master Tables & Another Database for Transaction Tables. I have Created two .dbml file.I want to write qurey with the combination of both files. Is it possible to write query which links two database using LINQ. Thanks.

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

      It is not possible to define 2 DataContext and create a query that uses tables from both of them.

      1 Reply Last reply
      0
      • V Vishal09

        Hi, I have One Database for Master Tables & Another Database for Transaction Tables. I have Created two .dbml file.I want to write qurey with the combination of both files. Is it possible to write query which links two database using LINQ. Thanks.

        E Offline
        E Offline
        Eslam Afifi
        wrote on last edited by
        #3

        I think it's possible to use 2 contexts if you are going to perform the the parts of the query that involve both the contexts on the client side. You do parts of the query that involve a context on its server then you do the parts that involve both on the client. This is done by getting entities involved in the joint query in the client's memory and then do query them locally. The ToArray, ToList, AsEnumerable... can be used to force loading entities to memory from the server. But you must be careful of what you load otherwise you'd end up loading so much data in client memory affecting performance and maybe get a nice OutOfMemoryException :) I've just tried AsEnumerable and it works.

        Eslam Afifi

        modified on Monday, June 22, 2009 9:19 PM

        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