Im working with a project, simple IM for our office... I have a Table in sql with column Status, if a user opens this application, the status column changes from 0 to 1, if it closes this app, the status turn back to 0. On my form load event, it pulls data from the database where status = 1 (shows logged on users). Here is the situation, if a user opens the app, he will see every logged on users, when someone closes it, he shouled be removed from the lists of logged on users. what i did is to call the form load event again to refresh m lists, but i need somthing to trigger this call. Im thinking of the CDC feature of sql but how will i tell vb.net that there are changes happen to database?

Hope I explained it clear

Thanks in advance

Recommended Answers

All 4 Replies

Just CDC won't help you here. It runs on the server only. The only way to notify your app from SQL Server would be to create an UDF that does that, which is not simple. A polling mechanism is much easier.

Thanks for the idea

Im creating a IM for our office, Is there a better way to monitor if my application is open from any computer within the network? I just need to add online users from my list/ then remove them if they are offline (offline if the application is close)

thanks again

IM is usually done over sockets (UDP/TCP). Clients connect to a server application that knows who's online and does database interaction.

Here's an example.

Thank you for helping, i will try it on monday

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.