Wednesday, October 3, 2012

C# - Convert HTML To Plain Readable Text

I have working with rich text editor in SharePoint and needed to read the plain text to put in title of a list item.
Here is the code I came up with to solve. You can also use this in ASP.NET but you need to use HtmlDecode .

Tuesday, October 2, 2012

Add Or Update Url Parameter using C# for ASP.NET

Several times when working on ASP.NET I need to redirect the user to same page / refresh the page and I wanted to do that with preserving Querystring.
The follow code will add new query string parameter if not exist otherwise it will update the value of that parameter and make sure you have reference the following:

using System.Text;
using System.Text.RegularExpressions;
using System.Web;

Monday, February 20, 2012

VirutalPC Memory Error and VirtualBox - "Failed to load unit 'pgm' VERR_EM_NO_MEMORY"

Solution First

Turn off Google Update. System Configuration > Startup
  1. In the start menu search box type "System Configuration", click on it to open.
  2. Go to Startup tab, find "Google Update" and uncheck that.
  3. Click on "Apply" button and then "OK".
  4. Reboot the machine

That is all! Now the VirutalBox and Virtual PC should work fine.

The Problems

I was facing VMWare mahine too slow. The Windows Server 2008 installation was taking more than 2 hrs. I was expriencing much much slow machine.
So thought, I should try other VM prodcuts like VirtualBox. The virutal box ran fine and after few days I got the error as mentioned below. I was also getting error when tying to resume a VirtualPC (Microsoft® free VM product). I even could not start a WinXP maching using VirtualPC, taking only 256 MB of RAM.

I thought some services might be causing issue but I was not sure. I tried formatting and then installing all the software but I failed and was getting same errors.

Now when I tried turing off the startup item it worked but I was not sure which start up item should I disable.
I tried turning off one by one and found Google Update was causing problem :( . It was really unexpected, I thought some antivirus or other services might be causing that issue.

Anyways, I found the solution so thought I should post that.

When trying to resume a virutal box machine, get following error message:
Failed to open a session for the virtual machine <Machine Name>
Failed to load unit 'pgm' (VERR_EM_NO_MEMORY).

When trying to resume a Virutal PC machine, get follwoing error message:
The virtual machine could not be restored becuase there was not enough memory available on the host.