views:

34

answers:

1

Has anyone had any luck creating an assembly for iTextSharp for use with CLR Stored procedures? I've been trying all afternoon and have not been able to get any results. SQL management studio is saying I need to register system.drawing first (can't be the new version, has to be the old version no less) but it gives me issues when I try to run create it for safe and unsafe.

So I'm just wondering if anyone has had any luck with setting up iTextSharp to work via CLR SPROCS? The reason I want to do this is because then I'd be able to pass parameters and generate reports much easier (CLR SPROC holds the standard static stuff while parameters could control dynamic stuff)

Thanks for any help

A: 

Hi. Register these assemblies on the server:

CREATE ASSEMBLY [System.Drawing] FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll' WITH PERMISSION_SET = UNSAFE

CREATE ASSEMBLY [System.Windows.Forms] FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll' WITH PERMISSION_SET = UNSAFE

CREATE ASSEMBLY [itextsharp] FROM 'C:\MY_CLR\itextsharp.dll' WITH PERMISSION_SET = UNSAFE

Then you can find refence for itextsharp in Add reference dialog (SQL Server tab)

It works (VS2010, C#, SQLServer2005, itextsharp5.0)

efarkas