locked
How to update windows control in real-time when change in database table occurs RRS feed

  • Question

  • I'm trying to figure how to bind/update listView control to database table that will update in real-time when database table is updated or an insert occurs.

    Any advice/solutions will be much appreciated.

     

    -allen

    Sunday, November 21, 2010 10:59 PM

Answers

  • I always just do this whenever there is an insert or update in the stuff I write:

    this.validate();
    this.xxbindingsource.endedit();
    this.tableadaptermanager.updateall(this.dataset);
    this.xxtableadapter.fill(this.dataset.xx,yy,zz,pp);

    Granted I've written my applications with custom fills all over the place to minimize
    data transfer (30 to 150 rows max at a time).

    Wednesday, December 1, 2010 6:07 AM

All replies

  • If you are the one making the changes to the database within the same application you can setup an updated Event that will allow you to rebind this. If not I would suggest using a polling timer to hit the database and bind to the changes.
    Monday, November 22, 2010 2:58 PM
  • Also try using SQL Broker Service
    www.midnightprogramer.net
    Monday, November 22, 2010 4:11 PM
  • Hi d.allen101,

    Thanks for your post.

    If it is a web project, Database cache dependecy may help.

    Here is a link: http://www.eggheadcafe.com/articles/20030716.asp

     

    Have a nice day.

    Alan Chen

    Thursday, November 25, 2010 8:07 AM
    Moderator
  • I always just do this whenever there is an insert or update in the stuff I write:

    this.validate();
    this.xxbindingsource.endedit();
    this.tableadaptermanager.updateall(this.dataset);
    this.xxtableadapter.fill(this.dataset.xx,yy,zz,pp);

    Granted I've written my applications with custom fills all over the place to minimize
    data transfer (30 to 150 rows max at a time).

    Wednesday, December 1, 2010 6:07 AM