Showing posts with label event. Show all posts
Showing posts with label event. Show all posts

Friday, March 9, 2012

Retrieving a list of Event Classes

Hi,
I have been trying in vain for the last few hours to retrieve a list of EventClasses for a particular Notification Service instance. Its a web application that I'm building I want to be able to populate a drop down list with all the notifications a user can subscribe to. Any advice on the subject would be greatly appreciated.
RegardsIn relation to the above its actually a list of subscription classes that I wish to retrieve from the notification services instance and then the user will be able to select which one they wish to subscribe to. Sorry about the mix up.
Regards|||Hi,

Stored procedure named "NSGetSubscriptionClasses" on NS application database will get you that information.


Shamir

Saturday, February 25, 2012

Retrieve last inserted or updated record

Hi

I have an application which get any change from database using sql dependency. When a record is inserted or updated it will fire an event and my application get that event and perform required operation.

On the event handler I am usin select ID,Name from my [table];

this will return all record from database.

I just want to get the record which is inserted or updated.

Can u help me in that.

Take care

Bye

You need no event to get the same. It can be easily done like:-

Dim sql As String = "INSERT INTO myTable (col2,col3) VALUES (bb,cc); SELECT * FROM jobs WHERE col1 = @.@.IDENTITY"

@.@.Identity carries the identity value of the last inserted record. Above statement can be executed with ExecuteReader method.

Hope this helps.

|||

Similarly code can be written for update.

|||

In the query you can use

SELECT@.ID=IDENT_CURRENT('TableName') for inserting

|||

Plz click "Mark as Answer" on the post that helped you.