1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

DataContext, Linq to SQL, and Win32 - best practices?

Discussion in 'Microsoft News' started by NewsBot, May 8, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    Hi everyone -

    I'm looking for a best practice implementation of a Win32 app which uses DataContext and Linq to SQL.

    Specifically, I'm interested in the way it handles populating Tables (etc) of Entities in a background thread (eg. BackgroundWorker) and then forwards this to the UI for display.

    I'm a little confused how to do this mainly because of deferred execution. I mean, it's simply enough to grab a Table in a background operation and then pass that to the UI thread, but wouldn't it only execute the SQL to populate the table at the point that you consume the table - i.e. when you bind the table to a control? Hence, doesn't this break all the "threading laws" regarding the execution of non-UI work in the UI thread?

    Anyway - suffice to say, if there's a "best practice" reference implementation out there, I'd love to see it. Any clues?

    Thanks -
    /gerrod




     

Share This Page