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. refresh context

refresh context

Scheduled Pinned Locked Moved LINQ
csharplinqhelp
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.
  • K Offline
    K Offline
    kasraa00098000
    wrote on last edited by
    #1

    hi all, well, after insert one record in one table , im going to refresh datagrid in order to user could see the result, i used this :

    Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, Context.TableName);
    this.BindingSource.DataSource = Context.TableName;
    dataGridViewX1.DataSource = BindingSource ;
    alarmBindingSource.ResetBindings(true);

    but there is no chance to see the inserted row! exepts renewing DataContext which spends long time! plz help

    S 1 Reply Last reply
    0
    • K kasraa00098000

      hi all, well, after insert one record in one table , im going to refresh datagrid in order to user could see the result, i used this :

      Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, Context.TableName);
      this.BindingSource.DataSource = Context.TableName;
      dataGridViewX1.DataSource = BindingSource ;
      alarmBindingSource.ResetBindings(true);

      but there is no chance to see the inserted row! exepts renewing DataContext which spends long time! plz help

      S Offline
      S Offline
      Stoffy1972
      wrote on last edited by
      #2

      Have you tried to add the new record using the binding source. In that case the record should appear automatically in the datagrid, then accept changes in context and it should be written to database too.

      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