How to add a reference to the System.Xml.Linq.dll or any other external assembly in a SQLServerProject VS2008

If you want to add a reference to the System.Xml.Linq.dll in a SQLServerProject VS2008 or any other external assembly just create a normal class library add all you’re references and deploy the created assembly:

CREATE ASSEMBLY [Rvl.Prototype.CommonClassLibrary.dll]
FROM 'C:\Temp\Rvl.Prototype.CommonClassLibrary.dll'
WITH PERMISSION_SET = UNSAFE
GO

image

After deploying the normal assembly you can reference that assembly in you’re SqlServerPorject by clicking “Add reference” > SQL Server

image

Using the “UNSAFE” permmission set might result in errors make sure you’re SQL Server instance has clr enabled:

sp_configure 'clr enabled', 1;
GO

RECONFIGURE;
GO

And you’re database property TRUSTWORTHY is ON:

ALTER DATABASE Mydatabase SET TRUSTWORTHY ON;
GO

The user executing the stored procedure must be sysadmin or you must set correct prermissions, see google.

Do a postback from javascript with ASP .NET AJAX

If you want to do a postback from javascript with ASP .NET AJAX and the aspx page contains a

<form id="mainForm" runat="server">

, you can create and use the javascript function to do a postback from javascript:



function
DoPostBack() {

    var form = document.getElementById(‘mainForm’);

    form.submit();

}