I have created a CLR database project and I would like to use httputility.urlencode. However, when I tried to add reference to my project, I could not find system.web any where. I googled and some suggested that I change the framework to full .net 4.0.

However, the problem is I can't deploy it using 4.0 as it was pointed out by microsoft through this link (http://msdn.microsoft.com/en-us/library/dd193408.aspx). So I need to use 3.5. And even if I tried to change it to 4.0 or 3.5 to see if I can find system.web, I still can't see the reference in the list.

My problem is very similar to this one Why can't I find or use UrlEncode in Visual Studio 2010?

All System.Web gives me are: AspNetHostingPermission, AspNetHostingPermissionAttribute, and AspNetHostingPermissionLevel

I followed the suggested solution, but no luck at all. Any suggestion please? Really need your help.

Thanks.

有帮助吗?

解决方案

Hello everyone after a long time research. I found a simpler solution to my problem. It may have some limitations that I am not aware of but I think it is much much simpler that creating an assembly in the SQL server. The solution is to create a function for URL encode using this link:

http://sqlblog.com/blogs/peter_debetta/archive/2007/03/09/t-sql-urlencode.aspx

Hope it help others too.

Cheers.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top