Need system.web for httputility.urlencode in CLR? - encode

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.

Related

Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F and Emgu.CV.CvEnum.IplDepth.IplDepth32F

I'm new to emgu, and found people are using Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F in their implementation. In my program, I don't know why I can not use it. However, I found that I could use Emgu.CV.CvEnum.IplDepth.IplDepth32F. I'm guessing they are the same thing, but I'm using a different version of emgu from other people. I'm using emgu.cv.dll version 3.0.0.2157. I tried to find which version uses Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F as other people are using, but didn't get any luck. I probably referred to the wrong place. Can any one tell how to figure out such problems?
Usually when faced with something like this I go to the Emgu.CV web site and look in the API documentation. I checked v2.4.10 and that version uses IPL_DEPTH_32F. If they are using 2.4.10 then you are fine.
I will let you check other versions if necessary.
Doug

Making a datagrid in zend framework 2

I am looking for software which creates a DataGrid in ZF2. I've found odiaseo/zf2-datagrid from GitHub but I currently do not understand how to use it. Does anyone have any suggestions on where I can find a tutorial with step-by-step instructions?
Step by step installation and usage guide is already there on git.
https://github.com/odiaseo/zf2-datagrid
I don't know what type of suggestions you need. but you can find good comparison of zf2 with other frameworks. one of them is here
Have you tried using this
There are some other datagrids for zf2 as well. Try one that fits your need
see here: http://modules.zendframework.com/?query=datagrid
e.g. https://github.com/ThaDafinser/ZfcDatagrid

MVC 3 asking for System.Web version 2.0.0.0 (System.Web.UI.Controls): Is this a compiler bug?

Setup:
An MVC 3 app I am working on suddenly won't compile. I get the following error:
The type 'System.Web.UI.Control' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
This is clearly absurd: I have System.Web version 4.0.0.0 on my machine.
If I remove the code at the relevant line, the error simply moves to the next line.
Visual Studio had been complaining about an add in, eg, if I was trying to Go To Definition, VS would complain and ask if I wanted to remove the add in.
Questions:
Is VS mangled?
Do I need to reinstall the whole bally thing (VS 2010, power tools, MVC 3 and heck knows what else)?
EDIT:
Since finding the cause and therefore solving the issue, I have renamed the question to a name that is more likely to be found by others with the same or similar problem.
To the best of my abilities, my answer tells how to troubleshoot this issue. But if anyone can come up with a full explanation for this issue, then I will gladly mark that as the answer.
OK, I have got to the bottom of this.
The problem was that I was using some string extensions. These were packed in a library, written ages ago.
The issue is caused by the namespace. Lets call it WS.Extensions
In WS.Extensions I also had some extension methods for plain vanilla asp.net server controls, and the classes these extensions are in have using statements for System.Web.UI.
Although the relevant dlls are referenced in the library project, it seems that this causes issues with MVC 3 and, to my mind, an obscure error. Obvious once you know where the issue lies, but not otherwise.
I have moved all the extensions to a new library with no cross using statements that reference server control namespaces such as System.Web.UI.
I have not deleted my post as I think that the problem could happen to others moving from the horrors of server controls to MVC.
Addendum:
The nasty thing of this error is that it shows as a compiler error, with a specific line where the "problem" is. Commenting out this line just moves the line that the compiler complains about down one line. Also, the line had absolutely NOTHING to do with the lines where the extensions were used. So there were no clues.
As a result, I would consider this to be a compiler bug, that has nothing to do with ASP.NET MVC, 3 or otherwise.
It is caused by referencing (using) a namespace from and ASP.NET MVC 3 app, when that namespace includes code that is written for ASP.NET server controls.
I lost half a day on the problem, so hope that this helps someone else. As a result, have renamed the question.
I had the same problem. I had several projects which used different versions of MVC, so I received this kind of error.
Also sometimes it is good to clear ASP.NET cache after converting project to MVC 3. This is also useful.

Visual Studio 2010 ASP.NET MVC: Create Strongly Typed View Not Showing My Classes

For some reason, when I create a new view and select 'Create Strongly Typed View', when I try to select a view data class from my project I find that its not in the list?
Classes from all my project's references (external references) are there, but NONE of mine?
I know this can be done manually, but (bloody) visual studio wont allow me to select a page template unless a view data class has been selected. Im sure this is something I have forgetten or changed somewhere by mistake. Hope someone can help!
This is probably a stupid suggestion, but the only time this has happened to me has been when I've created a new ViewModel and tried to create a strongly typed view without building the project first.
I had this exact same issue, could not find the solution anywhere, and i really searched google, read many sites answers/suggestions, but nothing helped me, until i did this below.
Ok, you may have already figured out the answer by now, or even tried what i am about to suggest, but, save project, build project, just to be sure, then close project, then close vs altogether, then RUN VS AS ADMINISTRATOR, then open your project and add view, i bet you can now see the data classes in the View data class drop-down...!
Let me know if this worked for you.
//edit: just fyi, I don't think you would see this behavior in say Windows XP for instance, it must be due to the uac in Vista and 7, so I am assuming you are using one of these two. In my case i am using 7. I may have gotten this totally wrong, pardon me if i did, but it solved this issue for me, thanks.
//another edit: In fact, i think many problems with vs and sqlsrvr are related to permissions in vista and 7... just my thoughts.
Jimbo - again 'stupid suggestion'. but are you checking for the fully qualified name of the project.classname?? So if you're looking for 'Albums' in the class list from the 'zulu' project, you'd have to scroll down to 'zulu.Albums'...
just a thought
I need to close this question as the problem is gone now - the solution?
Install Visual Studio 2010 - sorted :)
If anyone does find out why this happens, please just drop me a comment here and I will re-open the question for a successful answer.
I had similar issue. I try all the suggestions but installing Visual studio seems big process,
Why not try rebuild the solution , then it show all the classes in the project ..Hope it definitely works

Upgrade MVCMembership to 1.0?

Does anyone know if there is a version of MVCMembership that works with MVC 1.0?
The existing code doesn't work properly with this release. Alternatively, would anyone be willing to help upgrade the code-base?
(edit to draw out the key points)
I'm the creator of the MvcMembership project and I am addressing this concern on the project website:
http://mvcmembership.codeplex.com/Thread/View.aspx?ThreadId=52251
Please close this question as I think it is indeed more appropriately addressed on CodePlex.
Troy

Resources