Friday, March 30, 2012

is it possible to process the cube using vb.net/c# which exists in the remote server?

Hi

can we process the cube exists in the remote system, using vb.net/c#

i am able to process in the same system, where analysis service available.

i couln't process this from the client system.

is there any soluctions?

You can use either the AMO or ADOMD libraries to send processing commands to a remote server.

The AMO library is easier to work with for admin tasks, but you would have to redeploy the dll's. Where as any client that has to query the cubes will already need have ADOMD installed.

The following send an XMLA processing command using ADOMD, all you need to do is to create a console application, add a reference to Microsoft.AnalysisServices.AdomdClient and paste in the following:

Code Snippet

Sub Main()

Dim serverName As String = "Server1"

Dim databaseName As String = "Adventure Works DW"

Dim databaseID As String = databaseName

Dim cubeID As String = "Adventure Works"

Dim cn As New AdomdConnection("Provider=MSOLAP;Data Source=" & serverName & ";Initial Catalog=" & databaseName)

Console.WriteLine("Opening Connection...")

cn.Open()

Dim cmd As AdomdCommand

cmd = cn.CreateCommand()

cmd.CommandType = CommandType.Text

cmd.CommandText = "<Batch xmlns=""http://schemas.microsoft.com/analysisservices/2003/engine""><Parallel><Process> <Object>" & _

"<DatabaseID>" & DatabaseID & "</DatabaseID>" & _

"<CubeID>" & cubeID & "</CubeID> " & _

"</Object><Type>ProcessFull</Type><WriteBackTableCreation>UseExisting</WriteBackTableCreation> </Process> </Parallel> </Batch>"

Try

Console.WriteLine("Executing Command...")

cmd.ExecuteNonQuery()

Console.WriteLine("Command Complete")

Catch ex As Exception

Console.WriteLine(" --== ERROR ==--")

Console.WriteLine(ex.Message)

Console.WriteLine()

Finally

cn.Close()

Console.WriteLine("Finished")

End Try

End Sub

|||

Hi Darren

I tried your solution using AdoMd 8.0 on AS 2005,

but it seems that no data are refreshed,

neverthless the command text is executed without any error

Do I miss any other instruction (i.e: 'comitt transaction', .)?

Thanks

|||

I don't think ADOMD 8.0 has the execute method you need 9.0 to work with AS2005.

I just double checked and if your account has permission to process the server, database and cube properties are set correctly it should work. Try running a profiler session on the server and see if there are any errors being thrown at that end.

No comments:

Post a Comment