Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Friday, March 30, 2012

How to develope a notification service application

hi all,

i am a novice in notification service.i am trying to develope an application on notification service but i am not able to do a sample application.i am not able to understand what is instance and rest of the things in notification service.

can anybody provide any guideline or links so that i am able to understand what notification service is and how to create a sample application.

please help

thanks a lot in advance.

Hi -

I typically recommend that people start with the walkthrough included in BOL; it'll give you a pretty good overview of the technology, terminology, etc. Many people, after going through the example, are left with more questions that when they began. That's where some of the other sample instances can help out to some extent.

At the risk of sounding like I'm doing little more than promoting my own book, I will mention that I do have a book out there that's designed to get people up to speed with SSNS in a very short amount of time. It's less than 200 pages and I've heard good things about it in the community.

Shyam Pather, also has a book out there on the subject. At 600+ pages, it's definitely a great resource to have and it covers much more than my book - custom content formatters, etc.

I also blog about the topic here - http://www.sqlns.com.

And of course you can content to visit this forum and we'll be glad to provide whatever help we can.

HTH...

Joe|||

Indeed, Joe Webb is right:

his and S.Pather's books are the best 2 books in the market now.

There are quite a few others which either have a chapter on NS or are completely dedicated to NS, but those 2 are way better.

Just get either one of those 2 books (or, better yet, both) and follow the samples.

It won't take you too long to get your own prototype up and running, and then you will change and extend it the way you need.

That's how I did my NS app.

Undoubtedly, MSDN is the best source of technical info when you need to quickly find an answer to a particular question...

...but to get you up and running, you need a good book.

How to develope a notification service application

hi all,

i am a novice in notification service.i am trying to develope an application on notification service but i am not able to do a sample application.i am not able to understand what is instance and rest of the things in notification service.

can anybody provide any guideline or links so that i am able to understand what notification service is and how to create a sample application.

please help

thanks a lot in advance.

Hi -

I typically recommend that people start with the walkthrough included in BOL; it'll give you a pretty good overview of the technology, terminology, etc. Many people, after going through the example, are left with more questions that when they began. That's where some of the other sample instances can help out to some extent.

At the risk of sounding like I'm doing little more than promoting my own book, I will mention that I do have a book out there that's designed to get people up to speed with SSNS in a very short amount of time. It's less than 200 pages and I've heard good things about it in the community.

Shyam Pather, also has a book out there on the subject. At 600+ pages, it's definitely a great resource to have and it covers much more than my book - custom content formatters, etc.

I also blog about the topic here - http://www.sqlns.com.

And of course you can content to visit this forum and we'll be glad to provide whatever help we can.

HTH...

Joe|||

Indeed, Joe Webb is right:

his and S.Pather's books are the best 2 books in the market now.

There are quite a few others which either have a chapter on NS or are completely dedicated to NS, but those 2 are way better.

Just get either one of those 2 books (or, better yet, both) and follow the samples.

It won't take you too long to get your own prototype up and running, and then you will change and extend it the way you need.

That's how I did my NS app.

Undoubtedly, MSDN is the best source of technical info when you need to quickly find an answer to a particular question...

...but to get you up and running, you need a good book.

Friday, March 9, 2012

How to delete the role by using AMO(Analysis Management Object)?

I want to delete the role by using AMO, but what I find is only a way that how to create it.

following sample is deleting the members of the role :

Code Snippet

Dim ServerName As Server 'Connect OLAP Server
Dim db As Database 'Database of OLAP Server

Dim role As Role

role = db.Roles.Item(0)
role.Members.Clear()
role.Update()

So I think that deleting the roles of database is like following :

Code Snippet

db.Roles.Clear()

db.Update()

It's wrong. It can't delete roles of a database after executing.

Please tell me what I shall do or where I can find these infoemation, thanks!!

Here's a code sample from one of our developers that does this. (Thanks for the code, Jason.) Keep in mind that in this code, we were looking for Roles that met a naming standard. It's a long story, but you may want to skip that step. Still, I kept it in here (and only changed the naming pattern) so I can insure the code still works with minimal effort. Also, keep in mind this code was written for an SSIS package so you will see some odd ball references in there.

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

Dim roleCollection As New ArrayList()

' FIND ALL OF THE ROLES IN THE ANALYSIS SERVICES DB THAT MATCH THE NAMING PATTERN
For Each currentRole As Role In database.Roles
If (currentRole.Name.StartsWith("XYZ")) Then
' BECAUSE YOU CAN'T DELETE AN ITEM IN A COLLECTION, ADD TO THE roleCollection ARRAY LIST
roleCollection.Add(currentRole)
End If
Next

' DELETE ALL ROLES IN THE roleCollection
For Each currentObj As Role In roleCollection

'DROP OPTION OF AlterOrDeleteDependents SHOULD REMOVE ANY ASSOCIATED PERMISSIONS WITH THIS ROLE
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()
Next

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub

|||

Thanks for your answer~~

I can delete the role now.But I find that I can skip the step of ArrayList() and delete the role.

I don't know what a risk has in these statement, like following code :

If you know that. Could you tell me,please? Thanks!!

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

' DELETE A ROLES
Dim currentObj As Role

currentObj.database.Roles.FinByName("XYZ")
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub

How to delete the role by using AMO(Analysis Management Object)?

I want to delete the role by using AMO, but what I find is only a way that how to create it.

following sample is deleting the members of the role :

Code Snippet

Dim ServerName As Server 'Connect OLAP Server
Dim db As Database 'Database of OLAP Server

Dim role As Role

role = db.Roles.Item(0)
role.Members.Clear()
role.Update()

So I think that deleting the roles of database is like following :

Code Snippet

db.Roles.Clear()

db.Update()

It's wrong. It can't delete roles of a database after executing.

Please tell me what I shall do or where I can find these infoemation, thanks!!

Here's a code sample from one of our developers that does this. (Thanks for the code, Jason.) Keep in mind that in this code, we were looking for Roles that met a naming standard. It's a long story, but you may want to skip that step. Still, I kept it in here (and only changed the naming pattern) so I can insure the code still works with minimal effort. Also, keep in mind this code was written for an SSIS package so you will see some odd ball references in there.

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

Dim roleCollection As New ArrayList()

' FIND ALL OF THE ROLES IN THE ANALYSIS SERVICES DB THAT MATCH THE NAMING PATTERN
For Each currentRole As Role In database.Roles
If (currentRole.Name.StartsWith("XYZ")) Then
' BECAUSE YOU CAN'T DELETE AN ITEM IN A COLLECTION, ADD TO THE roleCollection ARRAY LIST
roleCollection.Add(currentRole)
End If
Next

' DELETE ALL ROLES IN THE roleCollection
For Each currentObj As Role In roleCollection

'DROP OPTION OF AlterOrDeleteDependents SHOULD REMOVE ANY ASSOCIATED PERMISSIONS WITH THIS ROLE
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()
Next

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub

|||

Thanks for your answer~~

I can delete the role now.But I find that I can skip the step of ArrayList() and delete the role.

I don't know what a risk has in these statement, like following code :

If you know that. Could you tell me,please? Thanks!!

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

' DELETE A ROLES
Dim currentObj As Role

currentObj.database.Roles.FinByName("XYZ")
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub