<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-572327697876814847</id><updated>2024-09-06T16:36:45.443-07:00</updated><category term="javascript"/><category term="Silverlight"/><category term="WCF"/><category term="ASP.Net"/><category term="SQL Reporting Server 2005"/><category term="SQL Server"/><category term="SSRS"/><category term="TSQL"/><category term="troubleshoot"/><category term="3-tier Architecture"/><category term="C#"/><category term="CSS hack"/><category term="Client Proxy"/><category term="Cumulative Totals"/><category term="DataFormatString"/><category term="DateTime"/><category term="Error #2104"/><category term="Flash detect"/><category term="FormatSting"/><category term="Headings"/><category term="Hidden"/><category term="IE"/><category term="IE8"/><category term="Ipad"/><category term="Linq to SQL"/><category term="List as Array"/><category term="MIME"/><category term="Menu"/><category term="Microsoft JScript runtime error"/><category term="Multi Join"/><category term="Obect with null fields"/><category term="Opacity"/><category term="Proxy"/><category term="Reports"/><category term="SVN Server"/><category term="Sort Expression"/><category term="Source Control"/><category term="Uninstalling Reporting server"/><category term="Vertical Header"/><category term="Vertical Text"/><category term="Visibility"/><category term="WCF Learner"/><category term="WCF Starters"/><category term="WPF"/><category term="Workaround"/><category term="array for List"/><category term="bandwidth"/><category term="delegate"/><category term="dynamic"/><category term="dynamic columns"/><category term="dynamic data"/><category term="dynamic fields"/><category term="event handlers"/><category term="extendedProtectionPolicy"/><category term="navigator"/><category term="performance"/><category term="preload"/><category term="profiler"/><category term="session in SQL"/><category term="user agent"/><category term="visual studio"/><category term="white spaces in Menu"/><title type='text'>Valuable Learnings</title><subtitle type='html'>&quot;... things I learn through work!!!!&quot;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-874801228886037101</id><published>2014-02-04T04:16:00.004-08:00</published><updated>2014-02-04T04:22:45.008-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hidden"/><category scheme="http://www.blogger.com/atom/ns#" term="Opacity"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="Visibility"/><category scheme="http://www.blogger.com/atom/ns#" term="Workaround"/><title type='text'>Workaround for Visibility.Hidden in Silverlight</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I love working on XAML/Silverlight and I don&#39;t face any issues most of the times. But when I am in trouble, I don&#39;t find any clue on how to come out of that. Recently, I am working on a Silverlight application and got a requirement to apply background color for Items which contains Collapsible Controls. To Understand this properly, I have a list of CheckBoxes with TextBox Controls and the TextBox should only be visible on CheckBox Check. To accomplish this, I simply Binded the Visibility of TextBox with IsChecked Property and thats working like charm.&lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot;&gt;
&lt;TextBox DataContext=&quot;{Binding Path}&quot; HorizontalAlignment=&quot;Stretch&quot; VerticalAlignment=&quot;Stretch&quot; Visibility=&quot;{Binding IsChecked, Converter={StaticResource BoolToVisibilityConverter}}&quot;&gt;&lt;/TextBox&gt;
&lt;/pre&gt;
The problem is when I apply BackgroundColor to those Items. If I apply a BackgroundColor to ListItem in Template, It is taking only till CheckBox content, if there is no TextBox (i.e., CheckBox is Unchecked).&lt;br /&gt;
Now I came to know the importance of Hidden in the Visibility Values. But soon I found that its not supported in Silverlight.&lt;br /&gt;
The only work around for this is to manipulate Opacity of the TextBox instead of Visibility. This fulfilled my requirement and hope works in all the situations. I haven&#39;t tested for TabStop, HitVisibility, ScreenReaders as they are out of scope in our project. The Final Binding will look like following:
&lt;pre class=&quot;brush:xml&quot;&gt;
&lt;TextBox DataContext=&quot;{Binding Path}&quot; HorizontalAlignment=&quot;Stretch&quot; VerticalAlignment=&quot;Stretch&quot; opacity=&quot;{Binding IsChecked, Converter={StaticResource BoolToOpacityConverter}}&quot;&gt;&lt;/TextBox&gt;
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/874801228886037101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2014/02/workaround-for-visibilityhidden-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/874801228886037101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/874801228886037101'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2014/02/workaround-for-visibilityhidden-in.html' title='Workaround for Visibility.Hidden in Silverlight'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-1412605357353754341</id><published>2011-01-08T06:15:00.000-08:00</published><updated>2011-01-08T06:25:16.984-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Uninstalling Reporting server"/><title type='text'>Un Installing SQL Server Reporting Server 2005 - The setup failed to read IIsMimeMap table. The error code is -2147023550</title><content type='html'>I have been facing a severe issue when i try to install SQL Server 2005. SQL Reporting server is already installed in my system and I need to un-install that first and Install SQL Server again.&lt;div&gt;When I try to un-install Reporting server i got this error:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;The setup failed to read IIsMimeMap table. The error code is -2147023550.&lt;/b&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;I spent a day&lt;b&gt; &lt;/b&gt;to resolve this issue and finally i found a link to do the same. IIS Admin service is the culprit, which needs to be stopped before un-installing the Reporting server. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;If you face the same issue, plz follow the steps.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;1) Stop IIS Admin Service&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;2) Stop IIS&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;3) Uninstall SQL Server Reporting services.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;These steps will work like charm and thanks to &lt;a href=&quot;http://bhavikblogs.blogspot.com/2010/01/setup-failed-to-read-iismimemap-table.html&quot;&gt;friend&lt;/a&gt;, who helped me in this regard.&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/1412605357353754341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2011/01/un-installing-sql-server-reporting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/1412605357353754341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/1412605357353754341'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2011/01/un-installing-sql-server-reporting.html' title='Un Installing SQL Server Reporting Server 2005 - The setup failed to read IIsMimeMap table. The error code is -2147023550'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-4886346470312255007</id><published>2010-09-16T04:02:00.000-07:00</published><updated>2010-10-07T03:06:30.155-07:00</updated><title type='text'>Complete use of RequiredFieldValidator</title><content type='html'>It&#39;s very common to use asp:RequiredFieldValidator to validate form data before submission. Using this for a TextBox is very straight forward, but Today, I came to know that the same can be used effectively to validate asp:DropDownList and asp:RadioButtonsList too. Lets know, how this can be done.&lt;br /&gt;&lt;br /&gt;First of all, the usage depends on the Binding of List Items. If all the Items are static and added with &amp;lt;asp:ListItem&amp;gt; as below&lt;br /&gt;&lt;pre name=&quot;code&quot; language=&quot;csharp&quot;&gt;&lt;br /&gt;&amp;lt;asp:DropDownList ID=&quot;ddlAddress&quot; Width=&quot;150&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;    &amp;lt;asp:ListItem&amp;gt;-select-&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;    &amp;lt;asp:ListItem&amp;gt;Item1&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;    &amp;lt;asp:ListItem&amp;gt;Item2&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here first item is optional and used for DropDownList in general. Now, the RequiredFieldValidator for this dropdownlist will be as following:&lt;br /&gt;&lt;pre name=&quot;code&quot; language=&quot;csharp&quot;&gt;&amp;lt;asp:RequiredFieldValidator ID=&quot;rfvaAddress&quot; InitialValue=&quot;0&quot; ControlToValidate=&quot;ddlAddress&quot; runat=&quot;server&quot; ErrorMessage=&quot;*&quot; CssClass=&quot;Note&quot; /&amp;gt;&lt;br /&gt;&lt;/pre&gt;Here InitialValue is an optional property which  is used to mention the Item, which should be selected by default.&lt;br /&gt;&lt;br /&gt;But in general the dropdowns are binded in code-behind. If we have an initial item with select text,&lt;span style=&quot;font-weight: bold;&quot;&gt; the value for that select item should be string.Empty&lt;/span&gt;. If you don&#39;t have this default item, the first item will be selected by default and there is no use of RequiredFieldValidator.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/4886346470312255007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/09/power-of-requiredfieldvalidator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4886346470312255007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4886346470312255007'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/09/power-of-requiredfieldvalidator.html' title='Complete use of RequiredFieldValidator'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-7506273894253235511</id><published>2010-08-10T23:41:00.000-07:00</published><updated>2013-12-31T03:42:34.486-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flash detect"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Flash Detection Javascript</title><content type='html'>This is the simple javascript code to detect whether flash installed on the machine or not!

&lt;pre class=&quot;brush:jscript&quot;&gt;

//Look for a version of Internet Explorer that supports ActiveX (i.e., one that&#39;s
//running on a platform other than Mac or Windows 3.1) or a browser that supports
//the plugin property of the navigator object and that has Flash Player 2.0
//installed.
//The Check for Internet Explorer is needed as it can play native swf files.

var flashSupported;

if (
     (navigator.appName == &quot;Microsoft Internet Explorer&quot; 
          &amp;&amp; navigator.appVersion.indexOf(&quot;Mac&quot;) == -1 
          &amp;&amp; navigator.appVersion.indexOf(&quot;3.1&quot;) == -1) 
     || (navigator.plugins &amp;&amp; navigator.plugins[&quot;Shockwave Flash&quot;]) 
     || navigator.plugins[&quot;Shockwave Flash 2.0&quot;]){
     flashSupported = true;
}
else {
     flashSupported = false;
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/7506273894253235511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/08/flash-detection-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7506273894253235511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7506273894253235511'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/08/flash-detection-javascript.html' title='Flash Detection Javascript'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-7615682702370737173</id><published>2010-07-31T07:19:00.000-07:00</published><updated>2010-07-31T07:34:29.862-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ipad"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="navigator"/><category scheme="http://www.blogger.com/atom/ns#" term="user agent"/><title type='text'>Detect IPad Javascript</title><content type='html'>In my current project I am working on IPad and there are some specific things need to be applied on IPad. We can detect end user&#39;s browser and environment information from the navigator using the following code.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;var&lt;/span&gt; isIPad = navigator.userAgent.match(/iPad/i) !=&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt; null&lt;/span&gt;;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/7615682702370737173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/detect-ipad-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7615682702370737173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7615682702370737173'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/detect-ipad-javascript.html' title='Detect IPad Javascript'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-5720928056657520148</id><published>2010-07-31T06:32:00.000-07:00</published><updated>2010-07-31T07:13:52.908-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bandwidth"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Bandwidth detection with javascript</title><content type='html'>In one of my current projects, I came across a scenario to play a video based on the users downloading bandwidth. The detection should be done with javascript. There is a technique, to load an image of known size and calculating the bandwidth on basis of time taken to load that image. Though this technique is not 100% reliable, this will give an approximate estimate of bandwidth.&lt;br /&gt;&lt;br /&gt;Here is the javascript code to find users bandwidth:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;var&lt;/span&gt; userBandwidth = 0;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;var&lt;/span&gt; startTime;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;var&lt;/span&gt; endTime;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;var&lt;/span&gt; imgSize = 39842;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;var&lt;/span&gt; loadTimeInSec;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;function&lt;/span&gt; GetUserBandwidth() {&lt;br /&gt;            &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;var&lt;/span&gt; testImage = &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;new&lt;/span&gt; Image();&lt;br /&gt;            testImage.src = &quot;bwtest.jpg&quot;;&lt;br /&gt;            startTime = (&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;new&lt;/span&gt; Date()).getTime();&lt;br /&gt;            testImage.onload = CreateDelegate(testImage, DoneWithTest);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;function&lt;/span&gt; DoneWithTest() {&lt;br /&gt;            endTime = (&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;new&lt;/span&gt; Date()).getTime();&lt;br /&gt;            loadTimeInSec = (endTime - startTime) / 1000;&lt;br /&gt;            userBandwidth = (imgSize / loadTimeInSec) / 1024;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Here we are loading an image of size 38Kb and added a delegate on image loaded event. In the call back function, we calculate end time, with that we can calculate the bandwidth of the user.&lt;br /&gt;&lt;br /&gt;Check my previous &lt;a href=&quot;http://sivakrishnakuchi.blogspot.com/2010/07/delegate-in-javascript.html&quot;&gt;post&lt;/a&gt; to add delegate in javascript.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/5720928056657520148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/bandwidth-detection-with-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5720928056657520148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5720928056657520148'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/bandwidth-detection-with-javascript.html' title='Bandwidth detection with javascript'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-5201536874829764365</id><published>2010-07-31T05:34:00.000-07:00</published><updated>2010-09-29T21:53:18.740-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="delegate"/><category scheme="http://www.blogger.com/atom/ns#" term="event handlers"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Delegate in Javascript</title><content type='html'>Before going to the topic, lets know brief about &quot;Delegate&quot;:&lt;br /&gt;A &lt;b&gt;delegate&lt;/b&gt; is like a function pointer, which stores reference of a method. It specifies a method to call and optionally an object to call the method on. They are used, among other things, to implement callbacks and event listeners.&lt;br /&gt;&lt;br /&gt;We can create and define delegates in Javascript to perform some specific tasks on an object. The following is the code to define delegate.&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;javascript&quot;&gt;&lt;br /&gt;function CreateDelegate(contextObject, delegateMethod)&lt;br /&gt;{&lt;br /&gt;    return function()&lt;br /&gt;    {&lt;br /&gt;        return delegateMethod.apply(contextObject, arguments);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Let us take a simple example and use the delegate in that. Here is the scenario, there is a large image to be loaded on a web page and we need to display the height and width of that image after loading. Delegate method will be very handy in this situation.&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;javascript&quot;&gt;&lt;br /&gt;var image = new Image();&lt;br /&gt;image.src = &quot;test.jpg&quot;;&lt;br /&gt;image.onload = CreateDelegate(image, ImageLoaded);&lt;br /&gt;&lt;br /&gt;function ImageLoaded()&lt;br /&gt;{&lt;br /&gt;    alert(this.width +&quot; X &quot;+ this.height);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We are creating a delegate on image loaded event, which will call method &#39;ImageLoaded&#39;. This delegate automatically pass the object on which the delegate is defined, to the method. We can refer the actual image object using &#39;this&#39; in the method.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/5201536874829764365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/delegate-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5201536874829764365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5201536874829764365'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/delegate-in-javascript.html' title='Delegate in Javascript'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-560185100245821050</id><published>2010-07-31T04:55:00.000-07:00</published><updated>2010-07-31T06:32:42.396-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="preload"/><title type='text'>Pre load images with Javascript</title><content type='html'>In all UI Rich web applications, it is very common to pre-load images. General method to do this is to use Javascript. We can load images by creating client side images before page gets loaded. It is a simple technique and can be done with 2 lines of code.&lt;br /&gt;&lt;br /&gt;var testImage = new Image();&lt;br /&gt;testImage.src = &quot;test.jpg&quot;;&lt;br /&gt;&lt;br /&gt;With the above lines of code test.jpg will loaded in the DOM. As the images are cached by browsers, whenever we send a new request for test.jpg, the image will be loaded immediately from cache. With this pre-loading technique there wont be any time lag in getting the image also no display lag for the user. This can be used in the scenarios like displaying image gallery with all the thumbnails loaded on first load of the page, image change on hovering/click of some links.&lt;br /&gt;&lt;br /&gt;We can do this preloading in html page using an image tag with height and width set to zero or wrapping the dynamic image in a hidden div. But, advantage with this approach is the imag wont be loaded to the page.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/560185100245821050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/pre-load-images-with-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/560185100245821050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/560185100245821050'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/07/pre-load-images-with-javascript.html' title='Pre load images with Javascript'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-392905384147581580</id><published>2010-05-03T08:20:00.000-07:00</published><updated>2010-05-03T08:34:47.234-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="array for List"/><category scheme="http://www.blogger.com/atom/ns#" term="List as Array"/><category scheme="http://www.blogger.com/atom/ns#" term="troubleshoot"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Solution Array for List in WCF</title><content type='html'>Here is another common problem encounters with WCF Service in initial days. Suppose there is a method which returns a List of Objects the proxy will be generated as method which returns an array of objects.&lt;br /&gt;Reason:&lt;br /&gt;This problem is due to the default interpretation of collections. While generating proxy for the service all the collections are by default interpreted as arrays. That is why all the lists will be converted to arrays.&lt;br /&gt;Solution:&lt;br /&gt;If you are generating proxy by adding service reference from visual studio directly, there will be a &#39;advanced&#39; button. Click that button and select the System.Generic.List as your Collection. This will resolve the problem.&lt;br /&gt;If you are generating proxy with svcutil here is the command to do the job.&lt;br /&gt;svcutil.exe http://ServerName/ServiceName/Servic.svc?wsdl /collectionType:System.Collections.Generic.List`1&lt;br /&gt;or in short svcutil http://ServerName/ServiceName/Servic.svc?wsdl /ct:System.Collections.Generic.List`1&lt;br /&gt;&lt;br /&gt;for more information go through this link &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa347733.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa347733.aspx&lt;/a&gt;&lt;br /&gt;Here is a post which describes the basics of creating wcf service &lt;a href=&quot;http://sivakrishnakuchi.blogspot.com/2010/05/how-to-create-wcf-service-application.html&quot;&gt;http://sivakrishnakuchi.blogspot.com/2010/05/how-to-create-wcf-service-application.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/392905384147581580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/05/solution-array-for-list-in-wcf.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/392905384147581580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/392905384147581580'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/05/solution-array-for-list-in-wcf.html' title='Solution Array for List in WCF'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-2060883840990310108</id><published>2010-05-03T06:22:00.000-07:00</published><updated>2010-05-03T08:04:39.477-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Obect with null fields"/><category scheme="http://www.blogger.com/atom/ns#" term="troubleshoot"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Troubleshoot WCF service returning object with null fields</title><content type='html'>When you are working with WCF service for the first time, generally you will get this error for some reason. Here is the description of the error:&lt;br /&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;typ&quot;&gt;WebServiceReference&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 204, 204);&quot; class=&quot;typ&quot;&gt;ServiceClient&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; client &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot; class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span&gt;&lt;span class=&quot;typ&quot;&gt;WebServiceReference&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 204, 204);&quot;&gt;&lt;span class=&quot;typ&quot;&gt;ServiceClient&lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span&gt;&lt;span class=&quot;typ&quot;&gt;WebServiceReference&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 204, 204);&quot; class=&quot;typ&quot;&gt;ImplementationRequest&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; req &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot; class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span&gt;&lt;span class=&quot;typ&quot;&gt;WebServiceReference&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 204, 204);&quot; class=&quot;typ&quot;&gt;ImplementationRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;req = &lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;client.GetRequest();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;Here the Method GetRequest will return an object of ImplementationRequest. Everything will run without any error but the req object will contain all null fields/ majority null fields.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Solution:&lt;br /&gt;&lt;/span&gt;Those nulls are due to error in generating the proxy for the Data Contract defined by the service. Verify that [DataMember] attribute tag is given for all the data fields and [DataContract] for the Class. If those attributes are missing, the object will be generated with null values. If all fields&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt;have the tags but the issue is not resolved, then the service reference should be re-added and the proxy should be re-generated. Then the problem will be resolved.&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Here is a post which describes basics of creating a WCF service.&lt;br /&gt;&lt;a href=&quot;http://sivakrishnakuchi.blogspot.com/2010/05/how-to-create-wcf-service-application.html&quot;&gt;http://sivakrishnakuchi.blogspot.com/2010/05/how-to-create-wcf-service-application.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/2060883840990310108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/05/troubleshoot-wcf-service-returning.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2060883840990310108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2060883840990310108'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/05/troubleshoot-wcf-service-returning.html' title='Troubleshoot WCF service returning object with null fields'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-6999405717236264075</id><published>2010-05-03T02:39:00.000-07:00</published><updated>2010-05-03T06:12:59.903-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Client Proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF Learner"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF Starters"/><title type='text'>How to create a WCF Service Application</title><content type='html'>WCF is a buzz word now a days. Full form of WCF is &#39;Windows Communication Foundation&#39;. Though it is not that much difficult to create a wcf service, sometimes its a bit tricky to configure the service correctly. I want to share simple steps to create and configure a WCF service here. But before to that we should go through some important terms of WCF.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;EndPoint: &lt;/span&gt;A service must have atleast one EndPoint. It is the component of the service that communicates with the client and provides the service operations.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Address:&lt;/span&gt; This is the address of EndPoint. It may look like general Web URL.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Bindings:&lt;/span&gt; Bindings are what define how an endpoint communicates with the outside world. Each endpoint must have a binding. The binding, which is simply a set of properties, defines things like the transport pattern, the security pattern, and the message pattern. Though most of these things are optional, binding should specify transport at least.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Contracts:&lt;/span&gt; Contracts define format and structure of the message, also behavior of the service. Service contracts are well-formed XML documents, typically found in the format of WSDL or XSD. WCF supports the following three types of contracts.&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Service Contract:&lt;/span&gt; It define the operations that a service will perform when executed. They tell about the service such as message data types, operation locations, the protocols the client will need in order to communicate with the service, and the operations the service provides.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Message Contract:&lt;/span&gt; Message contracts allow the control of SOAP messages that are produced and consumed by WCF. &lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Data Contract: &lt;/span&gt;Data contracts specifically define the data that is being exchanged between a client and service. The client and the service must agree on the data contract in order for the exchange of data to take place. &lt;/li&gt;&lt;/ul&gt;Now we are ready to create a wcf service application. Here are the steps to follow:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a solution and add a new &#39;WCF Service Application&#39; to that.&lt;/li&gt;&lt;li&gt;This by default will add two important files Service1.svc and IService1.cs along with web.config file. Out of these IService1.cs is the interface to write all the signatures of our service and in Service1.svc.cs will have the actual implementation of the methods.&lt;/li&gt;&lt;li&gt;In IService1.cs file we can check the default/ example contracts defined already.&lt;/li&gt;&lt;li&gt;While adding a new method we need to declare that as [OperationContract] so that method can be accessed over service.&lt;/li&gt;&lt;li&gt;All the classes, which need to be exchanged between server and client, should be declared as [DataContract] and all the members with [DataMember]. If these are skipped we will get null objects in the client end.&lt;/li&gt;&lt;li&gt;Method complete implementation should be written in Service1.svc.cs. The logic to fetch or send the data objects will be here in this file.&lt;/li&gt;&lt;li&gt;Deploy this service on IIS.&lt;/li&gt;&lt;li&gt;This service can be used in any application with the url. To use the service methods, We need to generate proxy for this service. This can be done automatically through visual studio or manually with svcutil tool.&lt;/li&gt;&lt;li&gt;To generate proxy automatically we need to add the service reference in our application. Whenever there is change in the service we need to update the service reference.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;With &#39;svcutil.exe http://&amp;lt;hostname&amp;gt;/&amp;lt;servicename&amp;gt;?wsdl&#39; command the proxy will be generated manually. We can add the generated proxy in our application and use the service methods. Even here whenever there is a change in service, we need to change the file manually or the proxy file should be recreted.&lt;/li&gt;&lt;li&gt;While using we need to create ServiceClient Object and through that object we can access all the methods in the service.&lt;/li&gt;&lt;/ol&gt;These are all the basic steps for creating and accessing a WCF service. All these will be available in any starter guide in a scattered manner. I just want to group all those to one place here.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/6999405717236264075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/05/how-to-create-wcf-service-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/6999405717236264075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/6999405717236264075'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/05/how-to-create-wcf-service-application.html' title='How to create a WCF Service Application'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-4051470262113403099</id><published>2010-04-21T03:12:00.000-07:00</published><updated>2010-04-21T04:06:09.005-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="performance"/><category scheme="http://www.blogger.com/atom/ns#" term="profiler"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><title type='text'>How to Use Visual Studio Profiler</title><content type='html'>Recently I came to know that there is a inbuilt profiler in Visual Studio 2008, with which we can know the performance of our application. This can be started from VS Analyze tab.&lt;br /&gt;Here are the simple steps to use this profiler.&lt;ol&gt;&lt;li&gt;Open the project in visual studio and go to analyze tab -&gt; profiler -&gt; new performance session&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Performance Explorer will be added to the application. In that explorer click Launch performance wizard.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A wizard will be opened with the application selected by default and three simple steps to set up new performance target&lt;/li&gt;&lt;li&gt;Click on Launch with profiling button on the Performance Explorer. This will run the application, just like we run in debug mode.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJnFlv97s92MBCd6E323uUFzzHZ-am8fj_1vC2A3lcqywvJLX7n4vS0icmhdsz7RtiEGcECT5ludIY6ePsNiJe0eXfz4GnWTkKO0qsqBfcolfgmeCyw9gpxZirTjcgd-5BuOhZ4pUGL6E/s1600/performance_explorer.JPG&quot;&gt;&lt;img style=&quot;margin: 0px 0px 10px; display: block; text-align: left; cursor: pointer; width: 334px; height: 191px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJnFlv97s92MBCd6E323uUFzzHZ-am8fj_1vC2A3lcqywvJLX7n4vS0icmhdsz7RtiEGcECT5ludIY6ePsNiJe0eXfz4GnWTkKO0qsqBfcolfgmeCyw9gpxZirTjcgd-5BuOhZ4pUGL6E/s400/performance_explorer.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5462539675101224626&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Go through the scenario, in which you want to know the performance one by one. But going for One at a time is suggestible.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Once the scenario ends, Click on Stop profiler icon. This will automatically generates a report.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiitwxG6Ce3KWzNDlcr6rjaFEgK7lLDWJTtZpXHcyh6V5h51t0t5od9NTp0VE3gFJukQGQ3TpElig-_HJTnwQ7VwHVy-578xosmxJHqD8R3Vv7QVmSQHMY5Axe9-wGF8npYqv9gcSLBpYM/s1600/start_stop.JPG&quot;&gt;&lt;img style=&quot;margin: 0px 0px 10px; display: block; text-align: left; cursor: pointer; width: 284px; height: 200px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiitwxG6Ce3KWzNDlcr6rjaFEgK7lLDWJTtZpXHcyh6V5h51t0t5od9NTp0VE3gFJukQGQ3TpElig-_HJTnwQ7VwHVy-578xosmxJHqD8R3Vv7QVmSQHMY5Axe9-wGF8npYqv9gcSLBpYM/s320/start_stop.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5462540547224055874&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Report provides various view of data. We can use functions view to check which functions taking so much time.&lt;/li&gt;&lt;/ol&gt;Using this profiler is very simple. But understanding the report generated by this is a bit difficult and needs some basic information on what is shown in the report. More details can be found at &lt;a href=&quot;http://msdn.microsoft.com/en-us/magazine/cc337887.aspx&quot;&gt;http://msdn.microsoft.com/en-us/magazine/cc337887.aspx&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/4051470262113403099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/how-to-use-visual-studio-profiler.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4051470262113403099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4051470262113403099'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/how-to-use-visual-studio-profiler.html' title='How to Use Visual Studio Profiler'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJnFlv97s92MBCd6E323uUFzzHZ-am8fj_1vC2A3lcqywvJLX7n4vS0icmhdsz7RtiEGcECT5ludIY6ePsNiJe0eXfz4GnWTkKO0qsqBfcolfgmeCyw9gpxZirTjcgd-5BuOhZ4pUGL6E/s72-c/performance_explorer.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-3486024162489574005</id><published>2010-04-21T00:09:00.000-07:00</published><updated>2010-04-21T00:37:56.900-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="extendedProtectionPolicy"/><category scheme="http://www.blogger.com/atom/ns#" term="Proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><title type='text'>extendedProtectionPolicy tag problem: Workaround</title><content type='html'>When one use Windows7 to generate a WCF configuration file/ proxy that will generate some extra lines of code which will cause the problems in running the application.&lt;br /&gt;The extra lines generated are not supported in Silverlight/WPF environment.&lt;br /&gt;Those lines will look like&lt;br /&gt;&lt;code&gt;&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;&amp;lt;transport&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;    &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code&gt;&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;&amp;lt;extendedprotectionpolicy&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;policyenforcement&lt;/span&gt;=&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&quot;Never&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;&amp;lt;/transport&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;There are some limitations for silverlight &amp;amp; WPF to use custombinding. You can read an article related to this at&lt;br /&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/cc896571%28VS.95%29.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/cc896571(VS.95).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Workaround:&lt;br /&gt;Those extra tags can be deleted or commented to run the application.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/3486024162489574005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/extendedprotectionpolicy-tag-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/3486024162489574005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/3486024162489574005'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/extendedprotectionpolicy-tag-problem.html' title='extendedProtectionPolicy tag problem: Workaround'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-4003339656169919304</id><published>2010-04-17T00:41:00.000-07:00</published><updated>2010-04-21T04:08:59.811-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Error #2104"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft JScript runtime error"/><category scheme="http://www.blogger.com/atom/ns#" term="MIME"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><title type='text'>Sys.InvalidOperationException: InitializeError Error #2104</title><content type='html'>I started development in silverlight recently. When everything is installed, i  just started with a test application and on running the site i got the following exception.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);font-size:85%;&quot; &gt;&lt;span style=&quot;font-family:arial;&quot;&gt;Microsoft JScript runtime error: Sys.InvalidOperationException: InitializeError error #2104 in control &#39;Xaml1&#39;: Could not download the Silverlight application. Check web server settings&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am surprised to see this error as all the required things are installed. But I missed one small thing. That is to add silverlight application MIME type to the web server(IIS). After adding this MIME type, my application run without any error.&lt;br /&gt;&lt;br /&gt;Steps to add MIME type in IIS6:&lt;br /&gt;1) Goto the silverlight web application/ website properties.&lt;br /&gt;2) Open HTTP Headers Tab and find MIME types region.&lt;br /&gt;3) Click MIME Type button and add new MIME type&lt;br /&gt;4) Type &lt;span style=&quot;color: rgb(0, 102, 0); font-weight: bold;&quot;&gt;.xap&lt;/span&gt; and &lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;application/x-silverlight-app&lt;/span&gt; as extension and MIME types respectively.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVHx06gpTAddGNu46FTPpC8e3Ais4brZkdy2nSv2tvMwisZGFhCLG1OeBPEk_25NdZWmn0wejKQW3sUGWZOkHHMREED7P4PQZJ_fJIdVFAdIbZGZP7SPHf7_wUKpSoGfyZg1shVDsdoeM/s1600/MIME.JPG&quot;&gt;&lt;img style=&quot;margin: 15px 0px 0px 15px; display: block; text-align: left; cursor: pointer; width: 300px; height: 320px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVHx06gpTAddGNu46FTPpC8e3Ais4brZkdy2nSv2tvMwisZGFhCLG1OeBPEk_25NdZWmn0wejKQW3sUGWZOkHHMREED7P4PQZJ_fJIdVFAdIbZGZP7SPHf7_wUKpSoGfyZg1shVDsdoeM/s320/MIME.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5462541559223299058&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;5) Save your settings. This will add silverlight mime type to the sever, so that our application run without any error.&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgo5HCmX5oPlGZlGgOBb8C5X28YQWCtrKL3TWKQNUon2Doy9bf-MjGElhnG1csc57qCk7f_9oBuaI7x162bwI-0CR4sBuFs7EOewk0KIfH3QdpJITRFmXFruljWVpgAGiBS9hIfXQqGo8/s1600/MIME.JPG&quot;&gt;&lt;br /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/4003339656169919304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/sysinvalidoperationexception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4003339656169919304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4003339656169919304'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/sysinvalidoperationexception.html' title='Sys.InvalidOperationException: InitializeError Error #2104'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVHx06gpTAddGNu46FTPpC8e3Ais4brZkdy2nSv2tvMwisZGFhCLG1OeBPEk_25NdZWmn0wejKQW3sUGWZOkHHMREED7P4PQZJ_fJIdVFAdIbZGZP7SPHf7_wUKpSoGfyZg1shVDsdoeM/s72-c/MIME.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-7979922633633644809</id><published>2010-04-07T04:48:00.000-07:00</published><updated>2010-04-07T04:58:27.433-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linq to SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Multi Join"/><title type='text'>Linq: Query for multiple join conditions in Linq to SQL</title><content type='html'>This is common to join a table with another on multiple conditions, Like&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-style: italic; font-family: arial;&quot;&gt;Select * from Customer c &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-style: italic; font-family: arial;&quot;&gt;Join Invoice i on c.CustomerID = i.CustomerID and c.CustomerTypeID = i.CustomerTypeID&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I need to write a Linq to SQL query for the same scenario. But the syntax for this query is a bit different to expect. The Linq query is as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: arial; font-style: italic; color: rgb(51, 51, 255);&quot;&gt;From c in &lt;span style=&quot;color: rgb(51, 0, 51);&quot;&gt;DataContext&lt;/span&gt;.Customers&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: arial; font-style: italic; color: rgb(51, 51, 255);&quot;&gt;Join i in &lt;span style=&quot;color: rgb(51, 0, 51);&quot;&gt;DataContext&lt;/span&gt;.Invoices on new { c.CustomerID, c.CustomerTypeID } equals new { i.CustomerID, i.CustomerTypeID }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;*DataContext in the above query should be replaced with actual datacontext name.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/7979922633633644809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/linq-query-for-multiple-join-conditions.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7979922633633644809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7979922633633644809'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/04/linq-query-for-multiple-join-conditions.html' title='Linq: Query for multiple join conditions in Linq to SQL'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-2031243582178447825</id><published>2010-03-30T06:54:00.000-07:00</published><updated>2010-03-30T07:05:11.123-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="DataFormatString"/><category scheme="http://www.blogger.com/atom/ns#" term="FormatSting"/><title type='text'>C# DataFormatStrings</title><content type='html'>It is common practice to show data in GridViews in so many applications. Some times we have to format the incoming data such as currency, decimals and dates. To achieve this, we need to use &quot;DataFormatString&quot;  property for GridColumn. There are some predefined format codes. They are as follows: &lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, sans-serif; font-size: 13px; color: rgb(41, 48, 59); &quot;&gt;&lt;div class=&quot;post-body entry-content&quot;&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1. This will display a text Price: followed by the numeric text in currency format&lt;br /&gt;Data Format String value : Price: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{0:C}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;Applied to numeric and decimal data types.&lt;br /&gt;The currency format is according to the culture info set in the web config file.&lt;br /&gt;&lt;br /&gt;2. Integers are displayed in a zero-padded field four characters wide.&lt;br /&gt;Data Format String value : &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{0:D4}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;Applied to integer datatype only.&lt;br /&gt;&lt;br /&gt;3. To show two decimal places&lt;br /&gt;Data Format String value : &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{0:N2}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;Applied to integer datatype only.&lt;br /&gt;&lt;br /&gt;4. To round the numbers to one decimal place and are zero padded for numbers less than three digits.&lt;br /&gt;Data Format String value : &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{0:000.0}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;Applied to numeric and decimal datatype only.&lt;br /&gt;&lt;br /&gt;5. Long Date format&lt;br /&gt;Data Format String value : &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{0:D}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;Applied to date and datetime datatype only.&lt;br /&gt;&lt;br /&gt;6. Short Date format&lt;br /&gt;Data Format String value : {0:d}&lt;br /&gt;Applied to date and datetime datatype only.&lt;br /&gt;&lt;br /&gt;7. Numeric Date format&lt;br /&gt;Data Format String value : &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{0:yy-MM-dd}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;Applied to date and datetime datatype only.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/2031243582178447825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/03/c-dataformatstrings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2031243582178447825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2031243582178447825'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/03/c-dataformatstrings.html' title='C# DataFormatStrings'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-8891895161156197811</id><published>2010-02-01T05:20:00.000-08:00</published><updated>2010-09-06T02:52:27.683-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dynamic"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamic columns"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamic data"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamic fields"/><category scheme="http://www.blogger.com/atom/ns#" term="Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Reporting Server 2005"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>How to: show dynamic columns in SQL server Reporting services</title><content type='html'>How to display dynamic columns in Reports?&lt;br /&gt;Let me explain what I mean dynamic here. I have a stored procedure which return some columns depending on User choice. In that case I dont have any clue about the columns which are in the report.&lt;br /&gt;&lt;br /&gt;In plain english, whatever dataset is coming from database, I need to display that information in a table or matrix. The dataset may contain 2columns or 25 columns. How to achieve this?&lt;br /&gt;After so much search I found an interesting property in SQL Server Reporting services for all Fields. There will be a property &#39;IsMissing&#39; for each Field in the Dataset we defined in the report. To achieve dynamic behavior, I Created a table with all possible columns and toggled the visibility of the columns depending on their IsMissing status.&lt;br /&gt;&lt;br /&gt;For each column in the table there will be a Visibility Expression set on Hide Property. For Example, say the column is binded to a column &#39;Name&#39; the details cell will have text Fields!Name.Value. The visibility expression for this column will be =IIF(Fields!Name.IsMissing,true,false). Now the report will show the columns selected in the stored procedure only.&lt;br /&gt;&lt;br /&gt;One Important thing to remember: When we are binding a dynamic dataset, SSRS dont have capability to detect the Fields present in the dataset. For this we need to specify the all possible fields in the Dataset, To do this follow the steps:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Goto Data tab in the report and open the dataset which returns dynamic columns&lt;/li&gt;&lt;li&gt;Click on the ... button besides the dataset to edit the dataset&lt;/li&gt;&lt;li&gt;A pop-up window for dataset will appear, in that window go to Fields tab&lt;/li&gt;&lt;li&gt;There we have to write all possible fields in the Dataset&lt;/li&gt;&lt;li&gt;Click OK and Preview your report&lt;/li&gt;&lt;/ul&gt;(If there are so many fields in the dataset it is very difficult to enter each column in the tab manually. I did face this, One shortcut way to do this is write dataset query so that it return all the required columns. The fields will be automatically filled. Now open the .rdl file in any text editor and change the Query part to actual query which return dynamic columns)</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/8891895161156197811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/02/how-to-show-dynamic-columns-in-sql.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/8891895161156197811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/8891895161156197811'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/02/how-to-show-dynamic-columns-in-sql.html' title='How to: show dynamic columns in SQL server Reporting services'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-7449388592668406760</id><published>2010-01-31T21:42:00.000-08:00</published><updated>2010-01-31T22:25:01.369-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Headings"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Reporting Server 2005"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><category scheme="http://www.blogger.com/atom/ns#" term="Vertical Header"/><category scheme="http://www.blogger.com/atom/ns#" term="Vertical Text"/><title type='text'>SSRS: Vertical Headings</title><content type='html'>&lt;span style=&quot;font-family:arial;&quot;&gt;This is one of the common requirement for most of the report developers. Many times we need to display table header vertically. When I came across this, I did a bit googling. But no where it is documented properly. Then I checked all the properies available for the Text box.&lt;br /&gt;Vertical text with reports can be done with one small property change. There will be a property called &#39;WritingMode&#39;. By default the writing mode will be lr-tb. If we change that to tb-lr the text in that text box will be written vertically.&lt;br /&gt;Follow the steps to get vertical headers:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Go to the Textbox in which you need Vertical Text&lt;/li&gt;&lt;li&gt;Press F4 or Goto Properties Window&lt;/li&gt;&lt;li&gt;Search for WritingMode Property and change the value to &#39;tb-lr&#39;&lt;/li&gt;&lt;/ul&gt;You can check your report preview for the changes.&lt;br /&gt;Happy reporting!!</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/7449388592668406760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/01/ssrs-vertical-headings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7449388592668406760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7449388592668406760'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2010/01/ssrs-vertical-headings.html' title='SSRS: Vertical Headings'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-5281944237579154229</id><published>2009-11-30T01:01:00.000-08:00</published><updated>2009-11-30T01:25:48.777-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DateTime"/><category scheme="http://www.blogger.com/atom/ns#" term="TSQL"/><title type='text'>Things to remember with Datetime Queries</title><content type='html'>I wrote some stored procedures to get data for my reports in last week. Most of the queries involve day&#39;s summary and  cumulative summary till the given date. After running the queries I observed that I am getting wrong results in all the datasets.&lt;br /&gt;After some analysis, I figured out my mistake. I have compared the date given directly with the date field in the table. The problem here is If I give &#39;11/30/2009&#39; as my input date, Database automatically adds the time part to that. So the input becomes &#39;11/30/2009 00:00:00:000&#39;. Whenever I compare the date the query always checks for the exact match. So I need to modify my queries to return correct data.&lt;br /&gt;Here is the modification:&lt;br /&gt;instead of comparing date directly... like &#39;date = @ReportDate&#39; or &#39;date &lt; @ReportDate&#39;, we should compare with the &#39;floor&#39; and &#39;ceil&#39; values for the given date. So the query has modified as &#39;&lt;span style=&quot;font-style: italic; color: rgb(0, 102, 0); font-weight: bold;font-size:85%;&quot; &gt;date between cast(floor(cast(@ReportDate as float))as datetime) and cast(ceiling(cast(@ReportDate as float))as datetime)&lt;/span&gt;&#39;. This query works and returns the required datarows. But here one point should be remembered, if we give the parameter with any date picker, It selects only the date and by default it will become &#39;givenDate 00:00:00:000&#39;. In this case the floor and ceil values for this date are same. So We need to correct our query once again. This modification is very simple and floor value is considered as a benchmark always. After this modification, the query will look like, &#39;&lt;span style=&quot;font-style: italic; color: rgb(0, 102, 0); font-weight: bold;font-size:85%;&quot; &gt;date between cast(floor(cast(@ReportDate as float))as datetime) and dateadd(hh,24,cast(floor(cast(@ReportDate as float))as datetime))&lt;/span&gt;&#39;. This last query will always return the correct set of results for a given date.&lt;br /&gt;&lt;br /&gt;I think this is known to many of the techies.. But useful to starter bees :)</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/5281944237579154229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/11/things-to-remember-with-datetime.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5281944237579154229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5281944237579154229'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/11/things-to-remember-with-datetime.html' title='Things to remember with Datetime Queries'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-523248226270693477</id><published>2009-11-25T08:52:00.000-08:00</published><updated>2009-11-30T01:24:45.191-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cumulative Totals"/><category scheme="http://www.blogger.com/atom/ns#" term="TSQL"/><title type='text'>Cumulative totals Query with T-SQL</title><content type='html'>The following query will be Very useful when one want to calculate the Cumulative total in SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;For Ex:&lt;br /&gt;Create Table TEST_DATA&lt;br /&gt;{&lt;br /&gt;ID Int NOT NULL,&lt;br /&gt;Amount Int NOT NULL&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if the table data is like&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;ID  Amount&lt;br /&gt;--- ------&lt;br /&gt;1     10&lt;br /&gt;2     20&lt;br /&gt;3     40&lt;br /&gt;4     50&lt;br /&gt;5     30&lt;br /&gt;&lt;br /&gt;select t1.ID, t1.Amount,&lt;br /&gt;(select sum(t2.Amount ) from &lt;/code&gt;TEST_DATA&lt;code&gt; as t2 where t2.ID &lt;= t1.ID) as Total from &lt;/code&gt;TEST_DATA&lt;code&gt; as t1&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:georgia;&quot;&gt;This Query will return the results as&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;ID  Amount Total&lt;br /&gt;--- ------ -----&lt;br /&gt;1     10     10&lt;br /&gt;2     20     30&lt;br /&gt;3     40     70&lt;br /&gt;4     50    120&lt;br /&gt;5     30    150&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:georgia;&quot;&gt;-Happy Querying :)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/523248226270693477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/11/cumulative-totals-query-with-t-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/523248226270693477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/523248226270693477'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/11/cumulative-totals-query-with-t-sql.html' title='Cumulative totals Query with T-SQL'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-4394757463064225555</id><published>2009-09-10T12:07:00.000-07:00</published><updated>2009-09-10T12:33:51.515-07:00</updated><title type='text'>Link tag in Content Page</title><content type='html'>Recently I faced a problem with attaching JavaScript and Stylesheet files from the Content Page.&lt;br /&gt;&lt;br /&gt;Generally all the stylesheets and Java script files are included in the Head section of the Master Page. But sometimes, we may need a javascript/stylesheet file in one particular page. Then it is better to load files only in that page to avoid un-necessary download for all the pages.&lt;br /&gt;&lt;br /&gt;When I have this requirement, I started including link tag in the content page. But I came to know that link tag can&#39;t work with content pages, when I check my page in the browser. Then I realized that the script and style tags should be used in Content pages. As, Writing long scripts and Styles in the page is not a good practice, I am not convinced with this option and serched for best solution.&lt;br /&gt;&lt;br /&gt;There are two solutions for this problem. The best solution is to create a content placeholder in the Head section of the master page and use that placeholder to add extra files in the page wherever needed;&lt;br /&gt;&lt;br /&gt;And another solution is to link the css and js files from the code behind. This involves creating a HtmlGenericControl with properties tagname, attributes and innerHtml in the page_Load event of the required page. We can select any of these two to fulfill the need.&lt;br /&gt;&lt;br /&gt;--Happy Programming :)</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/4394757463064225555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/09/link-tag-in-content-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4394757463064225555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/4394757463064225555'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/09/link-tag-in-content-page.html' title='Link tag in Content Page'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-5825528190790165354</id><published>2009-06-17T06:34:00.000-07:00</published><updated>2009-11-30T01:35:21.976-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IE8"/><category scheme="http://www.blogger.com/atom/ns#" term="Menu"/><category scheme="http://www.blogger.com/atom/ns#" term="white spaces in Menu"/><title type='text'>asp:menu fix for IE8 problem available</title><content type='html'>This is a popular problem with recently released browser IE8. Simple googling will give so many results consisting workarounds for this problem. The best way to set the things in IE8 is place the meta tag in all the master pages head section, for IE7 compatibility. This is legal and you can find this suggestion in many forums of ASP.Net. The magic meta tag is&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 128, 128);&quot;&gt; meta equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE7&quot;  (with in tags &lt;   /&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another workaround for this is to set the z-index of the menu control to a higher value like 100.&lt;br /&gt;&lt;br /&gt;Now, there is a solution for this behavior. Interestingly, this mis-functionality is due to a bug in asp.net framework, which is fixed now. Microsoft has release a patch to fix this issue and the patch is available for download at following address.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Windows 2000, XP, Server 2003:&lt;br /&gt;&lt;a href=&quot;http://code.msdn.microsoft.com/KB962351/Release/ProjectReleases.aspx?ReleaseId=2294&quot;&gt;http://code.msdn.microsoft.com/KB962351/Release/ProjectReleases.aspx?ReleaseId=2294&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Windows Vista, Server 2008:&lt;br /&gt;&lt;a href=&quot;http://code.msdn.microsoft.com/KB967535/Release/ProjectReleases.aspx?ReleaseId=2328&quot;&gt;http://code.msdn.microsoft.com/KB967535/Release/ProjectReleases.aspx?ReleaseId=2328&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You can fine more details about this issue and fixes &lt;a href=&quot;http://weblogs.asp.net/bleroy/archive/2009/03/23/asp-menu-fix-for-ie8-problem-available.aspx&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://code.msdn.microsoft.com/KB967535/Release/ProjectReleases.aspx?ReleaseId=2328&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/5825528190790165354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/aspmenu-fix-for-ie8-problem-available.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5825528190790165354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/5825528190790165354'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/aspmenu-fix-for-ie8-problem-available.html' title='asp:menu fix for IE8 problem available'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-2917508294037679900</id><published>2009-06-17T03:20:00.000-07:00</published><updated>2009-06-17T05:50:44.993-07:00</updated><title type='text'>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;)</title><content type='html'>Last Day I encountered this problem and spent nearly 2 hours for searching for the root cause. The root for this exception is server code block(&lt;% .. %&gt;) inside the master page. I need to read the value of a variable which runs at server from javascript. By default all my script tags are included in the head section of the master page. So, I have attached another script tag to fetch the required value in the head section, in which the server tags included. When I run my program, I got the exception &quot;The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;)&quot;.&lt;br /&gt;&lt;br /&gt;For troubleshooting, I started debugging the application. I observed that everything is working fine, but the master page where I added the script, is repeatedly loading. It went into some kind of infinite loop redirecting to itself. I still dont know the reason for this mis-behavior.&lt;br /&gt;&lt;br /&gt;The workaround for this is to replace the script tags with &lt;% %&gt; from head section to body. This will solve the problem and everything works as expected.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/2917508294037679900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/controls-collection-cannot-be-modified.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2917508294037679900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2917508294037679900'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/controls-collection-cannot-be-modified.html' title='The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;)'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-2792476526427758284</id><published>2009-06-17T02:51:00.000-07:00</published><updated>2009-06-17T03:08:37.303-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS hack"/><category scheme="http://www.blogger.com/atom/ns#" term="IE"/><title type='text'>Useful IE CSS hacks</title><content type='html'>Many of the developers feel pain to develop their applications in cross platform, especially when there is Internet Explorer 6. This is because, IE6 do not support some core css Styles like min-height. Also, Many times it is observed that IE renders the things a bit different compared to other browsers. The following are the useful hacks for developing websites in IE.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Min-Height Property in IE6:&lt;/span&gt;&lt;br /&gt;This is a very commonly used property to set the look and feel of the page. There is a workaround for this tag in IE6. Use the following styles in sequence:&lt;br /&gt;min-height: 600px;&lt;br /&gt;height:auto !important;&lt;br /&gt;height:600px;&lt;br /&gt;These lines can solve the problem of fixing min-height for ie6.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;IE6 specific functionality:&lt;/span&gt;&lt;br /&gt;Many times, IE6 require different styles from other browsers for constant look across the browsers. Then we have to define those properties two times, once for all the browsers and second for IE6. Many of the developers define a special css file for IE6 and will add that on checking the client browser. Another workaround for this is to add IE6 specific hack for all the properties.&lt;br /&gt;&lt;br /&gt;IE6 hack is to prefixing an underscore(_)  before the property. For Example,&lt;br /&gt;If we need the height of an object to 450px and in IE6 it is 430px then write these styles as&lt;br /&gt;&lt;br /&gt;height: 450px;&lt;br /&gt;_height:450px;&lt;br /&gt;&lt;br /&gt;Only IE6 can understood these properties and render the page. These hacks are handy while developing the web pages in a cross browser platform.&lt;br /&gt;&lt;br /&gt;Happy Programming.!!</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/2792476526427758284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/useful-ie-css-hacks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2792476526427758284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/2792476526427758284'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/useful-ie-css-hacks.html' title='Useful IE CSS hacks'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-572327697876814847.post-7809937657886686379</id><published>2009-06-17T02:50:00.001-07:00</published><updated>2009-06-17T02:50:58.464-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="session in SQL"/><title type='text'>How to Store Sessions in SQL Server</title><content type='html'>We can maintain the session for asp.net application in the following three ways.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Inproc : This will store the session in the memory of the web server. This is mostly used and will be lost when the application crashes. But the advantage with this is the performance. As the session is stored in the web server itself, this is very fast compared to other methods.&lt;/li&gt;&lt;li&gt;State Server: This will store the session in the memory of a machine, which is dedicated for the purpose of storing sessions. This is efficient and scalable.&lt;/li&gt;&lt;li&gt;SQL Server: This will store the session in SQL Server. To store a session in SQL Server, we need to configure the sql server. This is also efficient, scalable and secure implementation of storing a session.&lt;/li&gt;&lt;/ol&gt;Now Discuss about configuring the SQL server to store the state:&lt;br /&gt;&lt;br /&gt;This can be done by executing a simple file named &#39;aspnet_regsql.exe&#39;. This file is located in the .NET framework folder.&lt;br /&gt;&lt;br /&gt;Follow the steps to configure the Database server,&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open the command prompt and goto OperatingSystemDrive\WINDOWS\Microsoft.NET\Framework\v2.0.50727&lt;ul&gt;&lt;li&gt;Note: The file is available in v2 only. Though you are using Asp.net Framework v3 or v3.5 you need to goto 2.0.50727 only.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;As There wont be any change in the sql queries to create a database tables and stored procedure with the version of asp.net framework, They haven&#39;t provided with the file in v3 and v3.5 folder.(This is my understanding, the actual reason may be different)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;If you just type aspnet_regsql.exe and press enter, this will open a GUI to specify the Database server and the name of Database. If you don&#39;t specify any database name the default name will be &#39;sqldatadb&#39;.&lt;/li&gt;&lt;li&gt;This will create a database with tables and stored procedures, but the database is not yet ready to store the sessions.&lt;/li&gt;&lt;li&gt;For completing the configuration we need to run the command aspnet_regsql.exe -ssadd -sstype c -d &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;strong&gt;DATABASENAME&lt;/strong&gt;&lt;/span&gt; -E.(Give the Database Name if you specity any in step 2).&lt;/li&gt;&lt;li&gt;For more details related to options for this command can be found &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/x28wfk74.aspx&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;With this the database is configured to store the sessions. Though it is verymuch scalable and secure, this has performance issues when compared to &#39;inproc&#39; implementation.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 102, 102);&quot;&gt;Note:&lt;/span&gt; We can run step4 mentioned above in Visual Studio Command prompt to created the Database to store sessions in one shot.</content><link rel='replies' type='application/atom+xml' href='http://sivakrishnakuchi.blogspot.com/feeds/7809937657886686379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/how-to-store-sessions-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7809937657886686379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/572327697876814847/posts/default/7809937657886686379'/><link rel='alternate' type='text/html' href='http://sivakrishnakuchi.blogspot.com/2009/06/how-to-store-sessions-in-sql-server.html' title='How to Store Sessions in SQL Server'/><author><name>Siva Krishna Kuchi</name><uri>http://www.blogger.com/profile/14514851573328069828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKioV55vfBvo0JOrSqU1uVWo31eVFS3Z-a6tjNhSEbzrWvfobv82c94XCamjNgXRqXMhsuep6n-cQfni-KAVeFHO2MEgu3W67ccJ9Zi0k39WY9-vFIl0jdEmW9-BQNvA/s220/siva.jpg'/></author><thr:total>0</thr:total></entry></feed>