Link to home
Start Free TrialLog in
Avatar of Opusretis
OpusretisFlag for Switzerland

asked on

How can I import a third party .net dll into my CLR Function?

I need to import a dll into my clr function. Because early import is not supported I try to late import my DLL:
If I try to deploy I get an error without error Nr. The Message is (translatet from German):
Fehler beim Erstellen.
Error while build - but not more.
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Runtime.InteropServices;
 

public partial class UserDefinedFunctions
{
    [DllImport(@"c:\temp\my.dll")]
    public static extern string DoSomething(string something);

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlString Go(string myString)
    {
        string plain = DoSomething(myString);
        return new SqlString(plain);
    }
};

Open in new window

Avatar of APoPhySpt
APoPhySpt
Flag of Portugal image

don't know if this is really what you are looking for, but thought I'd give it a try:

http://blogs.thesitedoctor.co.uk/tim/2007/02/13/ImportingReferencing+DLLs+In+Visual+Studio.aspx
Avatar of Opusretis

ASKER

@APoPhySpt

No these are basics in "normal" projects. I have a CLR stored User defined Function for SQL Server.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial