How to deploy the XlsIO assembly as SQL CLR?
The following list of .Net dependent assemblies are needed to deploy the XlsIO assemblies as SQL CLR and which can be accessed from the location “C:\windows\Microsoft.NET\Framework64\v4.0.30319 “
Dependent Assemblies:
S.No | Dependent Dlls |
1 | Accessibility.dll |
2 | Microsoft.Build.Framework.dll |
3 | Microsoft.Build.Tasks.v4.0.dll |
4 | Microsoft.Build.Utilities.v4.0.dll |
5 | SMDiagnostics.dll |
6 | System.ComponentModel.DataAnnotations.dll |
7 | System.Configuration.Install.dll |
8 | System.Design.dll |
9 | System.DirectoryServices.dll |
10 | System.DirectoryServices.Protocols.dll |
11 | System.Drawing.Design.dll |
12 | System.Drawing.dll |
13 | System.EnterpriseServices.dll |
14 | System.Runtime.Caching.dll |
15 | System.Runtime.Remoting.dll |
16 | System.Runtime.Serialization.dll |
17 | System.Runtime.Serialization.Formatters.Soap.dll |
18 | System.ServiceModel.Internals.dll |
19 | System.ServiceProcess.dll |
20 | System.Web.ApplicationServices.dll |
21 | System.Web.dll |
22 | System.Web.RegularExpressions.dll |
23 | System.Windows.Forms.dll |
24 | System.Xaml.dll |
25 | Syncfusion.XlsIO.Base.dll |
26 | Syncfusion.Compression.Base.dll |
27 | Syncfusion.Core.dll |
Here are the steps to deploying XlsIO assemblies as SQL CLR.
Steps:
- Please ensure to use the MS SQL Server with 2008 version.
- Create a new database and name the Database.
- Expand the created data base and browse to the SyncfusionXlsIODll->Programmability->Assemblies-> path contains only default assembly. i.e., Microsoft.SqlServer.Types.
- Copy the Syncfusion.Compression.Base, Syncfusion.Core and Syncfusion.XlsIO.Base dll and paste in to the following location. “C:\Windows\Microsoft.NET\Framework\v2.0.50727”.
- Access the created Database using the below query.
USE SyncfusionXlsIODll GO |
- Deploy the Syncfusion.XlsIO.Base assembly in Sql server using the below query.
CREATE ASSEMBLY [Syncfusion.XlsIO] FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Syncfusion.XlsIO.Base.dll' WITH PERMISSION_SET = UNSAFE |
- During deployment if the following error occurs,
Error | Assembly 'Syncfusion.XlsIO.Base' references assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', 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: version, culture or public key mismatch). Please load the referenced assembly into the current database and retry your request. |
Sql Server Error Msg | Msg 10300 |
You could use the below query to resolve this error. Please ensure “System.Web dll” is referred from this location. 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727
ALTER DATABASE SyncfusionXlsIODll SET TRUSTWORTHY ON
CREATE ASSEMBLY[System.Web] from 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Web.dll' with permission_set = UNSAFE GO |
- After executing the above query do the step 6. Now the Syncfusion.XlsIO.Base assembly will be added to the Assembly Node.