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. Windows Forms, Entity Framework, Data Binding, threading

Windows Forms, Entity Framework, Data Binding, threading

Scheduled Pinned Locked Moved LINQ
databasesql-serverwpfwinformswcf
2 Posts 2 Posters 8 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.
  • D Offline
    D Offline
    Dana Gehm
    wrote on last edited by
    #1

    I've seen some good information on this site as to how to set up a Windows Forms application using the Entity Framework and Data Binding the controls on the forms to the Entity Framework. And also have a SQL Server at the bottom of the stack. But, there is one thing that I don't understand. I could be missing something. But it seems that, in the examples that I've seen, that the Form controls, the entity framework, and the binding between are all running off of the same thread. If that's true, then I would think that I could expect the UI to appear to hang while waiting on a round trip query to the Database. It would seem that it would be better to make any Database query run in a separate thread for performance reasons. Or, perhaps it's the case that optimizations along these lines take place, by default, under the hood in ObjectContext and I just don't know it. Could someone please enlighten me?

    L 1 Reply Last reply
    0
    • D Dana Gehm

      I've seen some good information on this site as to how to set up a Windows Forms application using the Entity Framework and Data Binding the controls on the forms to the Entity Framework. And also have a SQL Server at the bottom of the stack. But, there is one thing that I don't understand. I could be missing something. But it seems that, in the examples that I've seen, that the Form controls, the entity framework, and the binding between are all running off of the same thread. If that's true, then I would think that I could expect the UI to appear to hang while waiting on a round trip query to the Database. It would seem that it would be better to make any Database query run in a separate thread for performance reasons. Or, perhaps it's the case that optimizations along these lines take place, by default, under the hood in ObjectContext and I just don't know it. Could someone please enlighten me?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Using data binding will run in the same thread in Windows Forms applications, however, in WPF you can specify the IsAsync property on a binding and have it execute asynchronously as you are hoping for. If you are using Windows Forms you would have to write something custom. More here [^].

      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