How to deploy the XlsIO assembly as SQL CLR?
The following list of .NET dependent assemblies is needed to deploy the XlsIO assemblies as SQL CLR, and these 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 deploy XlsIO assemblies as SQL CLR.
Steps:
- Please ensure to use MS SQL Server version 2008 or later.
- 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 the 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 Message: | Msg 10300 |
You could use the query below to resolve this error. Please ensure “System.Web dll” is referred to 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.
Take a moment to peruse the documentation, where you can find basic worksheet data manipulation options along with features like Conditional Formatting, worksheet calculations through formulas, adding charts in worksheets or workbooks, organizing and analyzing data through tables and pivot tables, appending multiple records to a worksheet using template markers, and most importantly, PDF and image conversions, etc., with code examples.
Refer here to explore the rich set of Syncfusion Essential XlsIO features.
Note:
Starting with v16.2.0.x, if you reference Syncfusion assemblies from the trial setup or from the NuGet feed, include a license key in your projects. Refer to this link to learn about generating and registering a Syncfusion license key in your application to use the components without a trial message.
Conclusion:
I hope you enjoyed learning about how to deploy the XlsIO assembly as SQL CLR.
You can refer to our XlsIO’s feature tour page to learn about its other groundbreaking features. Explore our UG documentation and online demos to understand how to manipulate data in Excel documents.
If you are an existing user, you can access our latest components from the License and Downloads page. For new users, you can try our 30-day free trial to check out XlsIO and other Syncfusion components.
If you have any queries or require clarification, please let us know in the comments below or contact us through our support forums or feedback portal. We are always happy to assist you!