<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>my code trip &#187; Bugs And Fixes</title>
	<atom:link href="http://mycodetrip.com/tag/bug-fix/feed/" rel="self" type="application/rss+xml" />
	<link>http://mycodetrip.com</link>
	<description>stories from the information technology highway</description>
	<lastBuildDate>Mon, 29 Nov 2010 19:58:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>The Service Cannot Be Started Either Because It Is Disabled Or Because It Has No Enabled Devices Associated With It</title>
		<link>http://mycodetrip.com/2009/01/13/the-service-cannot-be-started-either-because-it-is-disabled-or-has-no-enabled-devices-associated-with-it-0x80070422-0x80070032_256/</link>
		<comments>http://mycodetrip.com/2009/01/13/the-service-cannot-be-started-either-because-it-is-disabled-or-has-no-enabled-devices-associated-with-it-0x80070422-0x80070032_256/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 19:45:49 +0000</pubDate>
		<dc:creator>Shiva Manjunath</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Bugs And Fixes]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=256</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2009/01/13/the-service-cannot-be-started-either-because-it-is-disabled-or-has-no-enabled-devices-associated-with-it-0x80070422-0x80070032_256/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix For Error: The Requested FTP Command Is Not Supported When Using HTTP Proxy</title>
		<link>http://mycodetrip.com/2008/10/29/fix-for-error-the-requested-ftp-command-is-not-supported-when-using-http-proxy_118/</link>
		<comments>http://mycodetrip.com/2008/10/29/fix-for-error-the-requested-ftp-command-is-not-supported-when-using-http-proxy_118/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 17:30:09 +0000</pubDate>
		<dc:creator>Shiva Manjunath</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Bugs And Fixes]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=118</guid>
		<description><![CDATA[Fix for the Error "System.InvalidOperationException: The requested FTP command is not supported when using HTTP proxy."]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> I created a <strong>SQL Server CLR stored procedure</strong> today from a <strong>C# utility dll</strong> to upload files to an FTP server. When I tried to execute the CLR stored procedure, I got the following error.<br />
<code>Msg 6522, Level 16, State 1, Procedure usp_FtpUploadFile, Line 0<br />
A .NET Framework error occurred during execution of user-defined routine or aggregate "usp_mct_FtpUploadFile":<br />
System.InvalidOperationException: The requested FTP command is not supported when using HTTP proxy.<br />
System.InvalidOperationException:<br />
at System.Net.FtpWebRequest.GetHttpWebRequest()<br />
at System.Net.FtpWebRequest.GetRequestStream()<br />
at mycodetrip.com.Utils.FtpUtils.UploadFile(SqlString ftpServerAndFolder, SqlString uploadFileName, SqlString ftpUser, SqlString ftpPassword, SqlString localSourceFileFolder)<br />
</code><br />
What was surprising was that my <strong>NUnit test in C#</strong> that called my utility method &#8220;<strong>UploadFile</strong>&#8221; worked fine. However, when I created a SQL Server CLR stored procedure from the same utility method&#8217;s assembly and tried to run in from within SQL Server I got this error.</p>
<p><strong>Solution:</strong> After a bit of investigation, I found that the error was happening because the method call from SQL Server was attempting to use the <strong>HttpProxy </strong>on the Server machine. If the <strong>proxy </strong>is not set to <strong>null</strong> <em>explicitly </em>in your code, then you will get this error.</p>
<p>So to fix it, set the Proxy of the request object to null as follows (see line # 3) .<br />
<strong>C# Version</strong></p>
<pre class="brush: csharp">
FtpWebRequest request =
(FtpWebRequest)WebRequest.Create((string)ftpServerAndFolder + &quot;/&quot; + (string)uploadFileName);
// set proxy to null to avoid the System.InvalidOperationException: The requested FTP command is not supported when using HTTP proxy.
request.Proxy = null;
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential((string)ftpUser, (string)ftpPassword);
</pre>
<p><strong>VB.Net Version</strong></p>
<pre class="brush: vb">
FtpWebRequest request =
CType(WebRequest.Create(CType(ftpServerAndFolder + &quot;/&quot; + CType(uploadFileName, string, String))), FtpWebRequest)
&#039; set proxy to null to avoid the System.InvalidOperationException: The requested FTP command is not supported when using HTTP proxy.
request.Proxy = Nothing
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = New NetworkCredential(CType(ftpUser, CType(ftpPassword, string, String)))
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2008/10/29/fix-for-error-the-requested-ftp-command-is-not-supported-when-using-http-proxy_118/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How To Restore The Security Tab in Windows XP Pro Folders</title>
		<link>http://mycodetrip.com/2008/07/07/restore-security-tab-windows-xp-pro-folders-that-disappeared_24/</link>
		<comments>http://mycodetrip.com/2008/07/07/restore-security-tab-windows-xp-pro-folders-that-disappeared_24/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 00:18:27 +0000</pubDate>
		<dc:creator>Shiva Manjunath</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[Bugs And Fixes]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=24</guid>
		<description><![CDATA[If you right clicked a folder in your Windows XP Professional file explorer to grant rights to specific users, and ]]></description>
			<content:encoded><![CDATA[<p>If you right clicked a folder in your <strong>Windows XP Professional</strong> file explorer to grant rights to specific users, and   found the <strong>Security tab</strong> missing, then you are not alone. I had this problem when I was trying to open   a log file in one of my virtual directories for an application I was writing using <strong>ASP.NET</strong>. I got a   security exception because the user that the application was running in the context of did not have write   permissions on that folder. So I needed to grant these permissions and could not find the Security tab to do this. Ultimately I figured it out. Here&#8217;s how.</p>
<h2>Restore the Security Tab for your Folders</h2>
<ul>
<li> Right click <strong>Start</strong> and Click <strong>Explore</strong> to open a file explorer window.</li>
<li>Click <strong>Tools &gt; Folder Options</strong>. Click the <strong>View</strong> tab.</li>
<li>In the <strong>View</strong> tab, scroll to the bottom until you see the <strong>&#8220;Use Simple File Sharing (Recommended)&#8221;</strong> checkbox.
<p><img src="http://img176.imageshack.us/img176/3431/restoresecuritytabwindooh9.jpg" alt="restore-security-tab-windows-xp-pro-folders-image-01" /></li>
<li>Uncheck the <strong>&#8220;Use Simple File Sharing (Recommended)&#8221;</strong> checkbox and click Ok.</li>
<li>Now, right click any folder and click <strong>Sharing and Security&#8230;</strong>
<p><img src="http://img297.imageshack.us/img297/9813/restoresecuritytabwindowx9.jpg" alt="restore-security-tab-windows-xp-pro-folders-image-02" /></li>
<li>You should see the <strong>Security tab</strong> which will allow you to set user specific folder permissions.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2008/07/07/restore-security-tab-windows-xp-pro-folders-that-disappeared_24/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix for &#8216;The database principal owns a schema in the database, and cannot be dropped&#8217; Error</title>
		<link>http://mycodetrip.com/2007/03/27/15138-the-database-principal-owns-a-schema-in-the-database-and-cannot-be-dropped_34/</link>
		<comments>http://mycodetrip.com/2007/03/27/15138-the-database-principal-owns-a-schema-in-the-database-and-cannot-be-dropped_34/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 01:30:27 +0000</pubDate>
		<dc:creator>Shiva Manjunath</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[Bugs And Fixes]]></category>
		<category><![CDATA[Error Solution]]></category>
		<category><![CDATA[Management Studio]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=34</guid>
		<description><![CDATA[A Fix for SQL Server 2005 Error "15138 the database principal owns a schema in the database and cannot be dropped".]]></description>
			<content:encoded><![CDATA[<p>In <strong>SQL Server 2005</strong>, if you try to drop a database user by right-clicking the user name and clicking <strong>Delete</strong>, you   may encounter an error as follows.</p>
<p><span style="font-family: Courier New;">&#8220;The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)&#8221; </span></p>
<p><img src="http://img148.imageshack.us/img148/6200/sqlserver2005deleteuserol0.jpg" alt="sql-server-2005-user-cannot-be-dropped-error-image-1" /></p>
<p>The reason for this is that in <strong>SQL Server 2005</strong>, if a user is associated with a Schema, then that user has to be first   replaced by another user in the schema before you can drop the user from the database.</p>
<h2>Fix the Error</h2>
<p>In <strong>SQL Server 2005 Management Studio</strong>, expand the node</p>
<p><strong>Database &gt; <em>yourdatabasename</em> &gt; Security</strong> and then click   <strong>Schemas</strong>. On the right pane, you will see a name value pairs list of the schemas and the corresponding owners.</p>
<p><a title="sql-server-2005-user-cannot-be-dropped-error-image-2" rel="lightbox" href="http://img201.imageshack.us/img201/5012/sqlserver2005deleteuserhw8.jpg"> <img class="left" src="http://img201.imageshack.us/img201/5012/sqlserver2005deleteuserhw8.th.jpg" alt="sql-server-2005-user-cannot-be-dropped-error-image-2" /></a></p>
<p>For one or more of the schemas, you should see the user you are trying to drop listed as the owner.  For each of these schemas, do the following.</p>
<ul>
<li>Right click the schema, and click <strong>Properties</strong>. In the schema owner box, type the name of the schema, ex. in the following, I would type <strong>db_admin</strong> over the   <strong>mynewcommunity_admin.</strong></li>
<li>Click <strong>OK</strong>.</li>
<li>After you do this for all schemas that the user you are trying to drop is the owner of, you should see something like this.     <a title="sql-server-2005-user-cannot-be-dropped-error-image-3" rel="lightbox" href="http://img155.imageshack.us/img155/2284/sqlserver2005deleteuserrz4.jpg"> <img class="right" src="http://img155.imageshack.us/img155/2284/sqlserver2005deleteuserrz4.th.jpg" alt="sql-server-2005-user-cannot-be-dropped-error-image-3" /></a></li>
</ul>
<ul>
<li>Now, if you right click the user and click <strong>Delete</strong>, you should be able to successfully drop the user from the database.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2007/03/27/15138-the-database-principal-owns-a-schema-in-the-database-and-cannot-be-dropped_34/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Fix for &#8216;XML Parsing Error: not well-formed Line Number 1, Column 2&#8242; Error</title>
		<link>http://mycodetrip.com/2007/03/26/fix-for-xml-parsing-error-not-well-formed-line-number-1-column-2-error_36/</link>
		<comments>http://mycodetrip.com/2007/03/26/fix-for-xml-parsing-error-not-well-formed-line-number-1-column-2-error_36/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 01:33:41 +0000</pubDate>
		<dc:creator>Shiva Manjunath</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Bugs And Fixes]]></category>
		<category><![CDATA[Error Solution]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=36</guid>
		<description><![CDATA[Fix for ASP.Net Error - 'XML Parsing Error: not well-formed Line Number 1, Column 2']]></description>
			<content:encoded><![CDATA[<p>When you access an <strong>ASP.NET</strong> page in your browser, you may get an <strong>XML Parsing Error</strong> that says that the XML is not well formed. The error message also displays the page directive statement present in the 1st line of the <strong>.aspx</strong> file. First we will fix this error, then we will look at one possible reason why you may be getting this error in <strong>ASP.NET</strong>.</p>
<p><img src="http://img412.imageshack.us/img412/3250/aspnetxmlparsingerrornona9.jpg" alt="asp-net-xml-parsing-error-not-well-formed" /></p>
<h2>Fix the &#8216;XML Parsing Error&#8217;</h2>
<p>Click <strong>Start &gt; Run</strong>, and type the following command depending on which ASP.NET framework is in use by the default web site in your <strong>IIS</strong>.</p>
<h3>ASP.NET 2.0 Framework</h3>
<p><span style="font-family: Courier New;"> %Windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i</span></p>
<h3>ASP.NET 1.1 Framework</h3>
<p><span style="font-family: Courier New;"> %Windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i</span></p>
<p>You should see a command window that is displayed briefly, that shows that <span style="font-weight: bold;">ASP.NET</span> is being installed. After the registration is successful, the window will be closed. <img src="http://img178.imageshack.us/img178/9021/aspnetxmlparsingerrornoye5.jpg" alt="register-asp-net-framework-with-iis" /></p>
<p>Now refresh the <strong>.aspx</strong> page that you got the XML Parser error for in the browser and your page should be rendered correctly.</p>
<h2>Why did you get this error ?</h2>
<p>I have seen this error happen to me in situations where I had installed IIS <em>after</em> the installing the .Net Framework. This make sense. If you install IIS after you install the <strong>.Net Framework</strong>, then the framework is not registered with IIS. So when a   request for a <strong>.aspx</strong> page comes to <strong>IIS</strong>, it simply passes on the contents of the page as-is without processing it. So in effect, the browser receives the entire <strong>.aspx</strong> page&#8217;s code, tried to parse it as an XML file, encounters the parsing error at the second character in the page directive and stops.</p>
<p><strong>Related:</strong> <a title="ASP.NET Registration Tool" rel="nofollow" href="http://msdn2.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx" target="_blank">ASP.NET IIS Registration Tool</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2007/03/26/fix-for-xml-parsing-error-not-well-formed-line-number-1-column-2-error_36/feed/</wfw:commentRss>
		<slash:comments>90</slash:comments>
		</item>
		<item>
		<title>Fix for &#8216;A potentially dangerous Request.Form value was detected from the client&#8217; Error</title>
		<link>http://mycodetrip.com/2006/12/26/fix-a-potentially-dangerous-request-form-value-detected-client_46/</link>
		<comments>http://mycodetrip.com/2006/12/26/fix-a-potentially-dangerous-request-form-value-detected-client_46/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 02:44:38 +0000</pubDate>
		<dc:creator>Shiva Manjunath</dc:creator>
				<category><![CDATA[Tips / HowTos]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Bugs And Fixes]]></category>

		<guid isPermaLink="false">http://mycodetrip.com/?p=46</guid>
		<description><![CDATA[Fix for ASP.Net 1.1 Error 'A potentially dangerous Request.Form value was detected from the client']]></description>
			<content:encoded><![CDATA[<p>When you access one of your ASP.NET web pages, if you get an error message that says something in the lines of &#8216;A potentially dangerous Request.Form value was detected from the client&#8217;, then you are most likely passing &lt; or &gt; in the querystring parameters. <a rel="lightbox" href="http://img132.imageshack.us/img132/610/potentiallydangerousrequw1.jpg"><img class="right" src="http://theshiva.us/images/blogimages/asp-net-a-potentially-dangerous-request-error_tn.jpg" alt="asp-net-a-potentially-dangerous-request-form-value-detected-client" /></a></p>
<p>Allegedly Microsoft introduced this check in ASP.NET 1.1 to prevent scripting attacks. So how do you fix this ?</p>
<h2>Fix the &#8216;A potentially dangerous Request.Form value was detected&#8230;&#8217; Error</h2>
<ul>
<li>Open the .aspx page in a text editor or in Visual Studio 2003.</li>
<li>In the Page directive, add the following</li>
</ul>
<div style="margin-left: 40px;"><span style="background-color: #ffff00; font-family: Courier New;">validatePageRequest=&#8221;false&#8221;</span></p>
<p>Example:</p>
<p><span style="background-color: #ffff00; font-family: Courier New;">&lt;%@ Page language=&#8221;c#&#8221; Codebehind=&#8221;Software.aspx.cs&#8221; AutoEventWireup=&#8221;false&#8221; Inherits=&#8221;Setup.Software&#8221; </span><span style="background-color: #ffff00; font-family: Courier New;">validatePageRequest=&#8221;false&#8221;</span><span style="background-color: #ffff00; font-family: Courier New;">%&gt; </span></div>
<p><span style="background-color: #ffff00; font-family: Courier New;"></p>
<p></span></p>
<ul>
<li>Save and close the <strong>.aspx</strong> file. This should fix it.</li>
<li>This fix is only for that individual page. If you wanted to make this default for all your pages, then add the following in your &lt;system.web&gt; section of your web.config file.</li>
</ul>
<div style="margin-left: 40px;"><span style="font-family: Courier New; color: #800000;">&lt;system.web&gt;</span><br style="color: #800000; font-family: Courier New;" /><br />
<span style="font-family: Courier New; color: #800000;"> &lt;pages <span style="color: #ff0000;">validateRequest</span>=&#8221;<span style="color: #0000ff;">false</span>&#8221; /&gt;</span><br style="color: #800000; font-family: Courier New;" /><br />
<span style="font-family: Courier New; color: #800000;">&lt;/system.web&gt; </span></div>
<p>Related : <a rel="nofollow" href="http://www.aspnetpro.com/NewsletterArticle/2004/03/asp200403dk_l/asp200403dk_l.asp" target="_blank">Caveats and Consequences of  <strong>validateRequest</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mycodetrip.com/2006/12/26/fix-a-potentially-dangerous-request-form-value-detected-client_46/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

