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. Deferred loading in LinqToSql

Deferred loading in LinqToSql

Scheduled Pinned Locked Moved LINQ
databasequestion
2 Posts 2 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.
  • E Offline
    E Offline
    ElCachubrey
    wrote on last edited by
    #1

    Hi all. Could somebody explain me why this string automatically retrieve data from db. _bindingSource.DataSource = _context.VAllClients; How could i prevent this? What i should do that neccessary data retrieved only when i requiry them directly? I mean: Every time when i link some dataSource to dataEntity this dataEntity is filled automatically. I want to control this (when data should be loaded) by myself. Thanks!

    T 1 Reply Last reply
    0
    • E ElCachubrey

      Hi all. Could somebody explain me why this string automatically retrieve data from db. _bindingSource.DataSource = _context.VAllClients; How could i prevent this? What i should do that neccessary data retrieved only when i requiry them directly? I mean: Every time when i link some dataSource to dataEntity this dataEntity is filled automatically. I want to control this (when data should be loaded) by myself. Thanks!

      T Offline
      T Offline
      TheyCallMeMrJames
      wrote on last edited by
      #2

      What kind of object is _bindingSource? My guess would be that it likely iterates through the data when DataSource is assigned to. You could create a var that holds the _context.VAllClients reference and only assign to _bindingSource when you're ready.

      They Call me Mister James

      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