HI
I'm trying to reproduce the VB CLR sample concat function from the SQL documentation (ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/5a188b50-7170-4069-acad-5de5c915f65d.htm)
I've installed Visual Studio 2005 and compiled the DLL which seems to work fine, but when I try to register the DLL with this call:
create assembly sqlfuncdll from 'D:\SQLdata\dll\SQLfunctions.dll'
I got this error:
Msg 10301, Level 16, State 1, Line 1
Assembly 'SQLfunctions' references assembly 'system.windows.forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.
When I remove the system.windows.form reference from the VB project (my suggestion is : I don't need the forms) then the project won't builld, so somehow it needs it.
What sould I do to get this DLL working?
hans
What type of Visual Studio project are you using? If you make a class library rather than a Windows Forms application then just the code in the documentation alone should compile fine without the reference.
--Bonnie
|||
The application type of the project is indeed "Class Library".
When I remove the System.Windows.Forms reference from the project, then the compilation of the DLL fails, I don't get any error message why, it just don't work. When I put the reference back, then the compilation is succesfull. I can't get why it needs this reference.
Some how I should get this project working without the System.Windows.Forms reference, because in the SQL documentation I found that this library is not supported and not linked by default :
http://msdn2.microsoft.com/en-us/library/ms403279.aspx
I started the VB project from scratch and now it does not need the System.Windows.Forms reference I don't understand why, but some how this reference was needed.
|||Most people make the mistake that they want to use MessageBox.Show in their Assemblies, which is sure not supported by the SQL CLR. If you are not sure which command is preventing you from registering the assembly, send the code over and we / I will have a look on it.Jens K. Suessmeyer.
http://www.sqlserver2005.de
No comments:
Post a Comment