Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to write a system tray application which is running through windows that shows a notification and appears when a new record is added to a table in database.

-First I need to get the username logged in from Active Directory.
-Second checking database if a new record is added.
-Third if yes ,then the form appears to a group of users and notify them a user has sent a request()

please help me with your answers.
Posted
Comments
ridoy 29-Dec-14 3:26am    
So write it yourself, what's the problem?

 
Share this answer
 
Comments
Maciej Los 29-Dec-14 6:39am    
5ed too!
ridoy 29-Dec-14 6:40am    
owoo! thank you Maciej, :)
There is a SqlDependency class[^] which provides functionality to get information about data add/change events.

Please, see:
Using SqlDependency for data change events[^]
Detecting Changes with SqlDependency[^]
SqlDependency in an ASP.NET Application[^]
Using SqlDependency in a Windows Application [^]

To be able to create "system tray application", i'd suggest to use NotifyIcon[^]
 
Share this answer
 
Comments
ridoy 29-Dec-14 6:38am    
5ed!
Maciej Los 29-Dec-14 6:39am    
Thank you ;)
You already have divided your problem into smaller parts.
Now find a solution for each part and then put everything together.

1. How to get User Data from the Active Directory[^]

2. Create a Stored procedure or SQL query to check the table that has changed.
For example you can check if row count of the table has increased compared to previous query.
C# SqlConnection Example[^]
SQL Example:
SQL
SELECT COUNT(*) FROM TableName;

(There are plenty of other ways to do this, just do some research.)

3. Not sure what you want to do here.
How do you define the group?
This can be probably be done by a client that each user runs, that polls the database for updates separately.
Or if you have a server you could create a WCF service that pushes information to connected clients.

4. For creating an application so it appears with a tray icon, you can read about it here
C# Application System Tray Icon[^]
 
Share this answer
 
Comments
Mohamad hashemi 29-Dec-14 6:00am    
I think after doing the project I should install it on the computers of specified users.
Am I right ?
George Jonsson 31-Dec-14 2:59am    
Yes.
Unless you go for a web application and use a browser.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900