dbTalk Databases Forums  

How to make UDF(user-defined functions) for OLAP(Analysis Services) with VS.NET.

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss How to make UDF(user-defined functions) for OLAP(Analysis Services) with VS.NET. in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ik4sp
 
Posts: n/a

Default How to make UDF(user-defined functions) for OLAP(Analysis Services) with VS.NET. - 06-08-2004 , 02:42 PM






To make UFD for Analysis Services you need a COM library. Below is a
paragraph from the "Books on line".

User-defined function libraries should be implemented as COM
components. These libraries can be implemented as in-process servers
(in a .dll) or as local servers (in an .exe). Before loading a
user-defined function library, ensure that the library contains a type
library. Additionally, all of the interfaces defined in the type
library must be derived from IDISPATCH for automation. User-defined
function libraries can be developed in any environment capable of
generating COM components.

Many people including me do not have VS6 installed any more. So I
tried to use VS.NET C# and Interop to create COM server. The code is:

using System;
using System.Runtime.InteropServices;

namespace ASLIB
{

[Guid("XXXX-………")]
public interface IasLib
{
int foo(int i);
}

[Guid("YYYY-………")]
public class InterfaceImplementation : IasLib
{
public int foo(int i);
{
Return(i+1);
}
}
}


File compiled with a command line (BTW how to add compiler options in
VS.NET?) :

csc /target:library /out:aslib.dll aslib.cs

And then type library and registration:

regasm aslib.dll /tlb: aslib.tlb


When attempt is done to load this TLB into say MDX Builder by using
"Register.." button, the following message pop up:

Unable to add library reference C:\.....\foo..tlb.
The operation has failed because of an error in the COM component -
unknown error The system cannot find the file specified.

Did anybody successfully produce UDF in .NET? Is it any suggestions?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.