Databases Reference
In-Depth Information
Analysis Services Management Object, which you learn about in some detail
in Chapter 12 . In this section you see examples of stored procedures using
the object models AMO and ADOMD server. Stored procedures using the
AMO are referred to as AMO stored procedures and those using ADOMD
server object model as ADOMD stored procedures
Before you look at AMO and ADOMD stored procedures you will look at the
COM example in the previous section being written as a .NET stored proced-
ure using C#. Open Visual Studio 2005 and create a C# class library applica-
tion called PartialSumSproc. Enter the code shown below and compile the
class library.
using System;
using System.Collections.Generic;
using System.Text;
namespace PartialSumSproc
{
public class PratialSumSproc
{
public static double PartialSum (double []
Val, string [] Member,
string stopMember)
{
double PartialSum = 0;
int l = 0; //Lower bound value of the
array
int u = Val.Length; //upper bound value
of the array.
for (int i=l;i<u;i++)
{
//add tuple into the return set
PartialSum = PartialSum + Val[i];
//if the unique name of both tuple
is same then break and return
if (string.Compare (Member[i],
Search WWH ::




Custom Search