vb.net database project

  • Hi guys

    Im creating a vb database project (CLR) in VS2010, but i need to add a dll to the reference folder so that it will appear in the sql server tab, but to do that i need to run in the dll into the DB(sql server 2008) and need to know what sql exactly to run in to make this dll become available in my project? In the project properties in the database tab i have set permission level to unsafe should i actually do this?

    And should i run in same sql for the actual clr program?

    Thanks

  • There's a forum post here about the same topic, looks like you just have to create an assembly for the DLL you'll be referencing:

    http://www.eggheadcafe.com/software/aspnet/30462654/can-i-add-a-reference-to-an-external-dll-in-a-managed-clr-c-stored-procedure.aspx

    Referencing an external DLL (except the ones that Microsoft has marked SAFE) will almost certainly mean your CLR will have to be marked as UNSAFE.

  • Ive ran this first

    USE [WT]

    alter database [WT] set trustworthy on

    EXEC sp_configure 'show advanced options' , '1'

    go

    reconfigure

    go

    EXEC sp_configure 'clr enabled' , '1'

    go

    reconfigure

    go

    the when i run this...

    USE [WT]

    CREATE ASSEMBLY [ERPConnect40.dll]

    FROM 'C:\Program Files\ERPConnect\Bin\ERPConnect40.dll'

    WITH PERMISSION_SET = UNSAFE

    i get..

    CREATE ASSEMBLY failed because it could not open the physical file "C:\Program Files\ERPConnect\Bin\ERPConnect40.dll": 3(The system cannot find the path specified.).

  • The path is the path on the SQL Server rather than on your local machine... If you've moved that dll to the server, check the SQL Service Account has permissions to the path

  • OK so when i put this on sql server path should that dll assembly be available then for reference?

    and do i then need to run same sql for the CLR? or will this just be added when i deploy it?

    and do i need to run any other sql after this?

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply