Re: News/Announcements form?

From: Jeremy (thevisualcore_at_hotmail.com)
Date: 08/19/04


Date: Thu, 19 Aug 2004 20:29:50 GMT


"Tom" <tom@nospam.com> wrote in message
news:O3lhcPihEHA.556@TK2MSFTNGP10.phx.gbl...
> I am in the need for a 'News/Announcements' component for my VB.NET
> application. Basically, this would allow me to 'push' news items relating
to
> my application out to my users - i.e Attention: The application is
shutting
> down; New version of app will be installed on Tuesday; Big issue found in
> 'whatever' form; etc.

You have a common database right? Why not just keep the news-items in
there. Here would be the tables (as I imagin it):

NewsHistory
========
NewsId <int>
Message <varchar>
Priority <tiny_int> '// For critical announcements

UserNews
=========
UserId <int>
NewsId <int>

Whenever you create a news item, add it to the NewsHistory. Then insert it
into the UserNews table for every user in the system. When the user deletes
the news item, delete that NewsId from the UserNews table.

Just think of it as a mail box, where you keep a history of all the mail
ever sent. That sould take care of your #1 and #2 problems.

> 3. Must be able to poll occasionally during the execution of the main
> application to see if there are any new news or announcement items and
alert
> the user, especially if they are 'critical' announcments (like 'The
> application database is shutting down in 20 minutes' (Maybe this should
use
> threading? Or would a timer be sufficient? This would be on a main MDI
form)

If you want a super-tight integration, there is a way to hookup a DLL to SQL
Server and make it notify your app every time a record is inserted - but
this is very advanced (see article on MSDN). Personally, I would check when
the app starts, and then check again every 10 minutes.

The method you use to poll the system is entirly up to your level of
programming skill. If you think you are profecient with Threads, you could
do that, but it would probably be overkill (a timer would be a good
alternative). If it's a closed network that all the clients exist in, then
remoting would also be a possibility. In the case of remoting, you could
actually create a message inserter program that would notify all the clients
when you created a new message for them to read.

HTH,
Jeremy



Relevant Pages

  • Re: "Sorting" assignment
    ... #define elementtype News ... typedef struct { ... int ID; ... Because if you could have written it, why not do the simpler array ...
    (comp.programming)
  • Re: "Sorting" assignment
    ... Every news contains subject and body text. ... bin B depending on whether it is greater than, ... int quicksortPartition ... int intStoreIndex = intLeft; ...
    (comp.programming)
  • Getting top row(s) based on date
    ... I have a view which contains details of news items posted, ... [NewsItemCreatedDate] ...
    (microsoft.public.sqlserver.programming)
  • Re: Need help with reordering items
    ... > Here is a solution to the problem that uses a single update query: ... > set nocount on ... > Position int NOT NULL, ... > News wrote: ...
    (microsoft.public.sqlserver.programming)
  • PDO and "ORDER BY" clausel with parameters
    ... SELECT newsid, title, timestamp ... FROM news ... Is there a way to do it with PDO (I like the way PDO will secure the ...
    (php.general)

Loading