Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

CLR Integration with Third Party DLL Expand / Collapse
Author
Message
Posted Thursday, December 11, 2008 3:32 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 10, 2014 5:46 AM
Points: 7, Visits: 27
Hi,

Help me to solve the issue.

I created wrapper class that used Microsoft Enterprise Library - Cryptography dll

and when i try to create assembly in sql server, it asks that supported assembly is not in the same location, then I copied cryptography library to the current bin folder and tried once again.

there was an error saying that 'system.management' assembly is not in the current database. [I have included it in my assembly]

at last there was an problem with 'system.runtime.serialization.formatter.soap' has nameCache as a static member, and that has to be in readonly

thanks in advance.



---
Satheesh Mohan
http://www.satheeshmohan.com
Post #617715
Posted Thursday, December 11, 2008 11:18 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, June 23, 2014 11:55 AM
Points: 1,708, Visits: 1,792
To even attempt to get it working, you would have to set trustworthy on, grant unsafe assembly to the database owner, and then try manually registering the DLL's as assemblies with UNSAFE access. Even then, certain CAS and HPA's can prevent SQL from loading the assemblies.

My question is why are you not using SQL Servers native encryption and decryption?


Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #618121
Posted Friday, December 12, 2008 7:40 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 10, 2014 5:46 AM
Points: 7, Visits: 27
Thanks Jonathan

Issue has been solved.

Have a new issue.

In my assembly i have used Enterprise library - cryptography, that required app config.

when I run my function it throws an error that app configuration is not found.

I have copy my configuration to sqlservr.exe.config in \Binn folder under the root path of the SQL Instance(C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn) but still i have problem.

I already used enterprise library encryption to encrypt data that stored in my db. so not interested to use sql server native encryption.

Thanks in advance


---
Satheesh Mohan
http://www.satheeshmohan.com
Post #618603
Posted Friday, December 12, 2008 9:59 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Thursday, June 5, 2014 10:54 AM
Points: 9,902, Visits: 9,480
How was it solved?

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #618730
Posted Friday, December 12, 2008 10:09 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, June 23, 2014 11:55 AM
Points: 1,708, Visits: 1,792
Satheesh Mohan (12/12/2008)
Thanks Jonathan

Issue has been solved.

Have a new issue.

In my assembly i have used Enterprise library - cryptography, that required app config.

when I run my function it throws an error that app configuration is not found.

I have copy my configuration to sqlservr.exe.config in \Binn folder under the root path of the SQL Instance(C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn) but still i have problem.

I already used enterprise library encryption to encrypt data that stored in my db. so not interested to use sql server native encryption.

Thanks in advance


SQL Server is not like a standard .NET application. To add a .config file, or for changes in an existing one to be picked up, you have to restart the SQL Server Service. This is why it is often better to store the information in a configuration table, that the CLR assemblies can read from over using an app.config file.


Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #618742
Posted Sunday, December 14, 2008 6:12 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 10, 2014 5:46 AM
Points: 7, Visits: 27
I solved this problem by

1. setting set trustworthy on and
2. signing my assembly a strong name (adding snk key).


---
Satheesh Mohan
http://www.satheeshmohan.com
Post #619361
Posted Sunday, December 14, 2008 6:34 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 10, 2014 5:46 AM
Points: 7, Visits: 27
In which name I should have app.config file?(app.config or sqlservr.exe.config),

in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn path
or any other path?


---
Satheesh Mohan
http://www.satheeshmohan.com
Post #619363
Posted Sunday, December 14, 2008 6:38 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, June 23, 2014 11:55 AM
Points: 1,708, Visits: 1,792
It should be sqlservr.exe.config, and it should be under the \Binn folder for the root path of the SQL Instance.

http://www.sqlclr.net/Articles/tabid/54/articleType/ArticleView/articleId/33/Default.aspx


Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #619364
Posted Sunday, December 14, 2008 6:53 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 10, 2014 5:46 AM
Points: 7, Visits: 27
My config setting is not picking up from that location even I restarted by sql server

what could be the problem?


---
Satheesh Mohan
http://www.satheeshmohan.com
Post #619367
Posted Sunday, December 14, 2008 6:56 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, June 23, 2014 11:55 AM
Points: 1,708, Visits: 1,792
Without seeing your code, I couldn't begin to say. Try creating the simple configuration file and function from the article I linked to above, and see if it will pull the demo setting.

Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #619368
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse