C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

Notification Services (.NET and MS SQL Server)


Posted Date: 27 Oct 2004    Resource Type: Articles    Category: .NET Framework
Author: Nirmala PMember Level: Bronze    
Rating: 1 out of 5Points: 7



Notification Services is one of SQL Server's newest features. This is collection of technologies allows developers and administrators to create applications based on SQL Server that notify users when specific events occur. Notification Services can be integrated and developed in dotnet application to simpler Notification related Applications.

Notification Services

1. Install SQLXML & Notification Services SDK from Microsoft website http://www.microsoft.com/sql/ns/

In Notification Services there are three regions to identify
· Client who interact with the application
· Notification services Database
· An administrator who creates Subscribers and Subscriptions
Also events

Consider a simple scenario, A Subscriber “ABC” has registered himself to get Notified whenever Stock value for Item “Item1” exceeds 100. In this case administrator create a Subscriber “ABC” for Stock symbol “Item1” with value 100 and creates events. Like wise administrator can create as many number of subscribers depending on request and also can specify the mode of Notification

It is pretty difficult to start with Notification Services because there is no simple documentation on any website.
I have prepared a document on this to simpler the steps needed for using Notification Services.

You can download my sample application from my site : http://www.geocities.com/nirmala792004/index.htm

Classes in Microsoft.SqlServer.NotificationServices
1. NSInstance – Notification Services instance
2. NSApplication
3. NSUtility

Architecture

The following terms need an introduction to understand the architecture.
· Event: An event is an action that occurred affecting the specified data.
· Subscriber: Subscriber is an entity interested in being notified when an event occurs.
· Subscription:Subscription is an act by which subscriber describes when and what he wants to be notified as. (Subscriber specifies that he wants to be notified when stock price goes more than $100.)
· Notification: Notification is a mode/channel of communication. Email, SMS, data files are a few examples.

In Notification Services we mainly work around 2 files
1. ADF – Application Data File, it is an xml file
2. Configuration file – it is an xml file

Steps to Create Notification Services

(You can download the zip file that I have created a sample application on Notification services from site visit http://www.geocities.com/nirmala792004/index.htm . ADF and Config xml files are included )

1. Create SampleNSTestADF.xml (contain application and DB definition)
2. Create SampleNSTestConfig.xml and copy in base directory of Notification Services C:\Program Files\Microsoft SQL Server Notification Services\v2.0.3008.0

3. Create Notification Instance that is defined in SampleNSTestConfig
Using nscontrol create command (run this command at basepath of NS)
Goto Notification services command prompt C:\Program Files\Microsoft SQL Server Notification Services\v2.0.3008.0> and run the following commands
nscontrol create -in SampleNSTestConfig.xml -sqlusername NS -sqlpassword ns

output :

Creating instance
SampleNSTestInstance

Creating application
Application name: SampleNSTest

Create successful.

4. Register Notification Instance using nscontrol register
nscontrol register -n SampleNSTestInstance -s Transcore -service -sqlusername NS -sqlpassword ns
output: successfully Registered

5. Start the service NS$SampleNSTestInstance (that created after registering instance)

6. Enable the Instance using nscontrol enable
nscontrol enable -n SampleNSTestInstance -s Transcore

output:
Status of instance "SampleNSTestInstance":

Subscribers: Enabled

Application: SampleNSTest
Hosted event providers
SampleNSTestEP (NIRMALA-XP): Enabled

Non-hosted event providers
WebEventCreator : Enabled

Generator
SampleNSTestGen1 (NIRMALA-XP): Enabled

Distributors
SampleNSTestDist1 (NIRMALA-XP): Enabled

Subscriptions: Enabled

Windows services
NS$SampleNSTestInstance (NIRMALA-XP): The service is running


7. Now it is ready to use Notification Service class objects to Create subscribers & Subscriptions, and adding trigger values
8. Create Events

Please feel free to contact Nirmala792004@yahoo.com, Pls. give feed back on this article



Responses

Author: S. Suresh    04 Nov 2004Member Level: Gold   Points : 0
Good article this is....Hope this will be useful for people who are going to work on advanced applications...


Author: pinaki nag    01 Dec 2004Member Level: Bronze   Points : 0
it was a good article . but nirmala please answere my mails i have sended two mails to you please can you help me




Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: A Simple Thread example in Visual C#.Net 2005
Previous Resource: Create a table in MS Access Database using SQL via VB.NET
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use