> I assume you are using a file-based SQLite database. Just watch the last > updated stamp on the database file, then fire your refresh code.
Yeah, that's what I ended up doing. One of the replies to my Stack Overflow question pointed me to the FileSystemWatcher class, which worked great. I posted sample code there, if anyone's interested. -Tom > > > > On Thu, Jul 22, 2010 at 10:10 AM, Tom Bushell <[email protected]> wrote: > > I have two C# programs that share a single SQLite database file. > > > One program (let's call it Writer) writes new data to the database. > > The other program (Reader) reads it. Both programs use Fluent > > NHibernate and System.Data.SQLite to access the DB. > > > Currently, I've just got a big Refresh button on my Reader program, > > and the user has to click it to get any new data that was written to > > the DB since the last refresh. This works, but is hardly elegant. > > > Is there any way to get NHibernate to fire an event in the Reader > > program when the DB is updated by Writer, so I can automatically > > present new data to the user? (I looked at the NH docs for > > Interceptors and Events, but it was not clear if these would do what I > > want) > > > Or, is there a good way to poll for updates using NH? > > > Failing an NH solution, can I do something similar with > > System.Data.SQLite, or via another lower level mechanism? > > > Thanks, > > > -Tom Bushell > > > (Note: I also asked this on Stack Overflow - > > >http://stackoverflow.com/questions/3303843/can-nhibernate-detect-when... > > ) > > > -- > > You received this message because you are subscribed to the Google Groups > > "nhusers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<nhusers%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
