<?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>Diary of an Entrepreneur Web Developer &#187; Programming / Coding</title>
	<atom:link href="http://www.cosmocentral.com/category/programming-coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cosmocentral.com</link>
	<description></description>
	<lastBuildDate>Thu, 03 Mar 2011 00:37:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Insert Max int Type Primary Column Value + 1 &#8211; Microsoft Sql</title>
		<link>http://www.cosmocentral.com/2011/03/insert-max-int-type-primary-column-value-1-microsoft-sql/</link>
		<comments>http://www.cosmocentral.com/2011/03/insert-max-int-type-primary-column-value-1-microsoft-sql/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 23:29:59 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=816</guid>
		<description><![CDATA[If you have a primary column of type int, you need to insert unique values for it, best approach is set the column IS IDENTITY type true with identity seed 1. That way you wont have to worry about it.]]></description>
			<content:encoded><![CDATA[<p>If you have a primary column of type int, you need to insert unique values for it, best approach is set the column IS IDENTITY type true with identity seed 1. That way you wont have to worry about it.</p>
<p>However in some cases you might not be able to do that. Recently i had to work for a large health provider in MA area. They gave me an access to the db without proper privileges, which doesn&#8217;t allow me set the column IS IDENTITY true. Since i am in rush to finish i have to come up with a way i could insert unique incremental values for the int primary key column on a table.</p>
<p>insert into MyTable(tId)<br />
Select IsNull((Select Max(IsNull(tId,0))+1 from MyTable),1)</p>
<p>Note that I have to wrap the inner subquery in a IsNull for the case when there is no rows in table.<br />
_______________________<br />
From Webcosmo Webmaster <a href="http://www.webcosmoforums.com/databases/27236-insert-max-int-type-primary-column-value-1-microsoft-sql.html">Forum http://www.webcosmoforums.com/databases/27236-insert-max-int-type-primary-column-value-1-microsoft-sql.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/03/insert-max-int-type-primary-column-value-1-microsoft-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Column Names of Table &#8211; Microsoft Sql</title>
		<link>http://www.cosmocentral.com/2011/03/get-column-names-of-table-microsoft-sql/</link>
		<comments>http://www.cosmocentral.com/2011/03/get-column-names-of-table-microsoft-sql/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 22:10:42 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=813</guid>
		<description><![CDATA[This is how you can get the name of the columns from a table in MS SQL.]]></description>
			<content:encoded><![CDATA[<p>This is how you can get the name of the columns from a table in MS SQL.</p>
<p>SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = &#8216;TableName&#8217;</p>
<p>And if you want them as a comma separated list:</p>
<p>declare @list varchar(max)<br />
select @list=COALESCE(@list+&#8217;, &#8216;,&#8221;)+COLUMN_NAME<br />
FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = &#8216;TableName&#8217;<br />
select @list<br />
______________<br />
From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/databases/27234-get-column-names-table-microsoft-sql.html">http://www.webcosmoforums.com/databases/27234-get-column-names-table-microsoft-sql.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/03/get-column-names-of-table-microsoft-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>innerText Does Not Work on FireFox &#8211; JavaScript</title>
		<link>http://www.cosmocentral.com/2011/02/innertext-does-not-work-on-firefox-javascript/</link>
		<comments>http://www.cosmocentral.com/2011/02/innertext-does-not-work-on-firefox-javascript/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 18:37:28 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=810</guid>
		<description><![CDATA[If you happen to try use the JavaScript property innerText on an element you wont get it work with FireFox browser.]]></description>
			<content:encoded><![CDATA[<p>If you happen to try use the JavaScript property innerText on an element you wont get it work with FireFox browser.</p>
<p>The reason is FireFox does not have a property innerText, rather they use a property called textContent.</p>
<p>There are many ways to solve this problem.</p>
<p>Option 1:<br />
Use JQuery.<br />
Example:<br />
$(document).ready(function() {<br />
$(&#8216;myElementId&#8217;).text(&#8220;My Text or Whatever&#8221;);<br />
});</p>
<p>Option 2:<br />
Create a JavaScript function, and call it when you need.</p>
<p>function ChangeContent(elem, content) {<br />
                                if (document.all)<br />
                                    elem.innerText = content;<br />
                                else<br />
                                    elem.textContent = content;<br />
                            }</p>
<p>There are many other ways as well.<br />
____________________<br />
From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/javascript-ajax/26917-innertext-does-not-work-firefox.html">http://www.webcosmoforums.com/javascript-ajax/26917-innertext-does-not-work-firefox.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/02/innertext-does-not-work-on-firefox-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just in time debugger keeps popping up in Visual Studio 2008</title>
		<link>http://www.cosmocentral.com/2011/02/just-in-time-debugger-keeps-popping-up-in-visual-studio-2008/</link>
		<comments>http://www.cosmocentral.com/2011/02/just-in-time-debugger-keeps-popping-up-in-visual-studio-2008/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 02:15:37 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=807</guid>
		<description><![CDATA[With VS 2008 this is an odd thing that just in time debugger keeps popping up when you have javascript url set with a script tag on the page.]]></description>
			<content:encoded><![CDATA[<p>With VS 2008 this is an odd thing that just in time debugger keeps popping up when you have javascript url set with a script tag on the page.<br />
For example<br />
<script type="text/javascript" src="myjs.js"></script></p>
<p>I find it very annoying as it keeps popping up while i try to type in code!</p>
<p>Setting from VS 2008 > Tools > Debugging > Just-In-Time simply doesnt work.</p>
<p>Without going for why it happens, this is how you can get rid of it.</p>
<p>    * Click on start menu<br />
    * Click on Run if you are using XP. On vista or 7 you can use the search box.<br />
    * Type regedit<br />
    * Hit enter button<br />
    * Expand HKEY_CURRENT_USER<br />
    * Expand Software<br />
    * Expand Microsoft<br />
    * Expand Windows Script<br />
    * Double Click on Settings<br />
    * Double Click on JITDebug<br />
    * Set 0 for &#8220;Value Data&#8221;. Click on Ok<br />
____________<br />
From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/asp/26385-just-time-debugger-keeps-popping-up-visual-studio-2008-a.html">http://www.webcosmoforums.com/asp/26385-just-time-debugger-keeps-popping-up-visual-studio-2008-a.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/02/just-in-time-debugger-keeps-popping-up-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot find either column dbo or the user-defined function or aggregate or the name is ambiguous &#8211; Microsoft SQL</title>
		<link>http://www.cosmocentral.com/2011/01/cannot-find-either-column-dbo-or-the-user-defined-function-or-aggregate-or-the-name-is-ambiguous-microsoft-sql/</link>
		<comments>http://www.cosmocentral.com/2011/01/cannot-find-either-column-dbo-or-the-user-defined-function-or-aggregate-or-the-name-is-ambiguous-microsoft-sql/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 18:25:39 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=804</guid>
		<description><![CDATA[You might get into this error when try to select from a table valued function in Microsoft SQL.]]></description>
			<content:encoded><![CDATA[<p>You might get into this error when try to select from a table valued function in Microsoft SQL.</p>
<p>Lets say you have a table-valued function named Test.<br />
If you call the function like this<br />
Select dbo.test(param if any)<br />
Then you will be getting the error &#8220;Cannot find either column dbo or the user-defined function or aggregate or the name is ambiguous&#8221;</p>
<p>The reason of that error is you are missing the column name(s) in the select.</p>
<p>Correct syntax would be something like this:<br />
Select * from dbo.test(param if any)<br />
____________<br />
From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/databases/25926-cannot-find-either-column-dbo-user-defined-function-aggregate-name-ambiguous-microsoft-sql.html">http://www.webcosmoforums.com/databases/25926-cannot-find-either-column-dbo-user-defined-function-aggregate-name-ambiguous-microsoft-sql.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/01/cannot-find-either-column-dbo-or-the-user-defined-function-or-aggregate-or-the-name-is-ambiguous-microsoft-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asp Menu Hiding Behind Page Elements</title>
		<link>http://www.cosmocentral.com/2011/01/asp-menu-hiding-behind-page-elements/</link>
		<comments>http://www.cosmocentral.com/2011/01/asp-menu-hiding-behind-page-elements/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 18:00:00 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=800</guid>
		<description><![CDATA[If your asp menu elements hide behind other elements on the page, this could be a potential solution for you.]]></description>
			<content:encoded><![CDATA[<p>If your asp menu elements hide behind other elements on the page, this could be a potential solution for you.</p>
<p>Surround the asp menu in a div with a z-index style with it.</p>
<blockquote><p>
&lt;div style=&#8221;z-index:200&#8243;&gt;<br />
&lt;asp:Menu ID=&#8221;Menu1&#8243; runat=&#8221;server&#8221; StaticDisplayLevels=&#8221;1&#8243;&gt;<br />
&lt;Items&gt;<br />
&lt;asp:MenuItem Text=&#8221;File&#8221; Value=&#8221;File&#8221;&gt;<br />
&lt;asp:MenuItem Text=&#8221;New&#8221; Value=&#8221;New&#8221;&gt;&lt;/asp:MenuItem&gt;<br />
&lt;asp:MenuItem Text=&#8221;Open&#8221; Value=&#8221;Open&#8221;&gt;&lt;/asp:MenuItem&gt;<br />
&lt;/asp:MenuItem&gt;<br />
&lt;/Items&gt;<br />
&lt;/asp:Menu&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>_____________<br />
From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/asp/25740-asp-menu-hiding-behind-page-elements.html">http://www.webcosmoforums.com/asp/25740-asp-menu-hiding-behind-page-elements.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/01/asp-menu-hiding-behind-page-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP Error 403.1 &#8211; Forbidden: Execute access is denied &#8211; IIS</title>
		<link>http://www.cosmocentral.com/2011/01/http-error-403-1-forbidden-execute-access-is-denied-iis/</link>
		<comments>http://www.cosmocentral.com/2011/01/http-error-403-1-forbidden-execute-access-is-denied-iis/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 19:45:25 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=798</guid>
		<description><![CDATA[In cases you have asp pages on your website but you get this error when you try to view the page on the browser. If you are getting this error there are two things to check.]]></description>
			<content:encoded><![CDATA[<p>In cases you have asp pages on your website but you get this error when  you try to view the page on the browser. If you are getting this error  there are two things to check.</p>
<p>Make sure that you have allowed Scripts to execute on your website.<br />
<strong>To do that:</strong></p>
<ul>
<li> Open up IIS Manager</li>
<li>Go to the Home Directory tab</li>
<li>Under Execute Permissions set one of Scripts Only or Scripts and Executables.</li>
<li>Click Apply</li>
</ul>
<p>If that didnt resolve your problem its also likely that you need to  enable web service extensions for .ASP and .ASPX on your IIS.<br />
<strong><br />
To do that:</strong></p>
<ul>
<li>Open up IIS Manager</li>
<li>You will see a folder called Web Service Extensions, Click on it</li>
<li>Click on Active Server Pages, if you see that prohibited on the status column, click on Allow button.</li>
<li>Click  on Asp .Net (whatever version you use for website), if you see that  prohibited on the status column, click on Allow button.</li>
</ul>
<p>When you try to set Allow permission you may get error like this one:</p>
<p>System.Web.HttpException: The current identity (NT AUTHORITY\NETWORK   SERVICE) does not have write access to   &#8216;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem  porary ASP.NET  Files&#8217;.</p>
<p>If you get this error set Network Service account  modify permission on the &#8220;Framework&#8221; folder and let the permissions be  inherited by its child folders.</p>
<p>______________</p>
<p>From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/windows-server/25186-http-error-403-1-forbidden-execute-access-denied-iis.html">http://www.webcosmoforums.com/windows-server/25186-http-error-403-1-forbidden-execute-access-denied-iis.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/01/http-error-403-1-forbidden-execute-access-is-denied-iis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Byte Conversion Formula</title>
		<link>http://www.cosmocentral.com/2011/01/byte-conversion-formula/</link>
		<comments>http://www.cosmocentral.com/2011/01/byte-conversion-formula/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 23:13:00 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=796</guid>
		<description><![CDATA[This might be confusing for some people converting bytes for storage media etc.]]></description>
			<content:encoded><![CDATA[<p>This might be confusing for some people converting bytes for storage media etc.</p>
<p>Here are the basics:</p>
<p>1 byte = 8 bits<br />
1 kilobyte (K / Kb) = 2^10 bytes = 1,024 bytes<br />
1 megabyte (M / MB) = 2^20 bytes = 1,048,576 bytes<br />
1 gigabyte (G / GB) = 2^30 bytes = 1,073,741,824 bytes<br />
1 terabyte (T / TB) = 2^40 bytes = 1,099,511,627,776 bytes<br />
1 petabyte (P / PB) = 2^50 bytes = 1,125,899,906,842,624 bytes<br />
1 exabyte (E / EB) = 2^60 bytes = 1,152,921,504,606,846,976 bytes</p>
<p>So the formula for conversion are:<br />
X KB = NumberOfBytes/1024<br />
X MB = NumberOfBytes/1048576 OR X MB = NumberOfBytes/1024/1024</p>
<p>_______________</p>
<p>From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/web-development-programming-coding/25107-byte-conversion-formula.html">http://www.webcosmoforums.com/web-development-programming-coding/25107-byte-conversion-formula.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2011/01/byte-conversion-formula/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery, $ is Not Defined</title>
		<link>http://www.cosmocentral.com/2010/12/jquery-is-not-defined/</link>
		<comments>http://www.cosmocentral.com/2010/12/jquery-is-not-defined/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 23:50:26 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=790</guid>
		<description><![CDATA[If you get javascript errors like jQuery is Not Defined or $ is Not Defined its almost always the case you are either not referencing the jquery javascript file or reference is wrong.]]></description>
			<content:encoded><![CDATA[<p>If you get javascript errors like</p>
<p>jQuery is Not Defined<br />
or<br />
$ is Not Defined</p>
<p>its almost always the case you are either not referencing the jquery javascript file or reference is wrong.</p>
<p>if you are not referencing the jquery file, you can download it from here http://docs.jquery.com/Downloading_jQuery</p>
<p>If you dont want to download you can always reference to the hosted jquery file. Links to some hosted jquery files can also be found here http://docs.jquery.com/Downloading_jQuery</p>
<p>____________<br />
From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/javascript-ajax/25013-jquery-not-defined.html">http://www.webcosmoforums.com/javascript-ajax/25013-jquery-not-defined.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2010/12/jquery-is-not-defined/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Too many characters in character literal &#8211; Asp .Net with JavaScript</title>
		<link>http://www.cosmocentral.com/2010/11/too-many-characters-in-character-literal-asp-net-with-javascript/</link>
		<comments>http://www.cosmocentral.com/2010/11/too-many-characters-in-character-literal-asp-net-with-javascript/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 18:04:37 +0000</pubDate>
		<dc:creator>manik</dc:creator>
				<category><![CDATA[Programming / Coding]]></category>

		<guid isPermaLink="false">http://www.cosmocentral.com/?p=788</guid>
		<description><![CDATA[When you try to build a javascript string in asp .net you might bump  into this error. The common cause of this not escaping the characters  that need to be escaped.]]></description>
			<content:encoded><![CDATA[<p>When you try to build a javascript string in asp .net you might bump  into this error. The common cause of this not escaping the characters  that need to be escaped.</p>
<p>For example:</p>
<blockquote><p>StringBuilder sb=new StringBuilder();<br />
sb.Append(@&#8221;&lt;a href=&#8221;JavaScript:Method(&#8216;var&#8217;);&#8221;&gt;Call method&lt;/a&gt;&#8221;);</p></blockquote>
<p>When using Vervatim you still need to escape the double quotes using another double quote not with a backslash(\).</p>
<p>This should be the proper way of doing it.</p>
<blockquote><p>sb.Append(@&#8221;&lt;a href=&#8221;"JavaScript:Method(&#8216;var&#8217;);&#8221;"&gt;Call method&lt;/a&gt;&#8221;);</p></blockquote>
<p>There could be other case scenarios.</p>
<p>____________<br />
From Webcosmo Webmaster Forum <a href="http://www.webcosmoforums.com/asp/24098-too-many-characters-character-literal-asp-net-javascript.html">http://www.webcosmoforums.com/asp/24098-too-many-characters-character-literal-asp-net-javascript.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cosmocentral.com/2010/11/too-many-characters-in-character-literal-asp-net-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

