<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>My Tech Journal</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/sundararajan/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/sundararajan/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:44:31 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Deploying DB Projects - using Microsoft VSDB GDR – Part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/sundararajan/deploying-db-projects-using-microsoft-vsdb-gdr-part-1</link>
      <pubDate>Fri, 16 Jan 2009 08:25:00 GMT</pubDate>
      <dc:creator><![CDATA[susubram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sundararajan/2009/01/16/deploying-db-projects-using-microsoft-vsdb-gdr-part-1/</guid>
      <description><![CDATA[This is a series of posts where I will share with everyone about my experiences with Microsoft...]]></description>
      <content:encoded><![CDATA[<P>This is a series of posts where I will share with everyone about my experiences with Microsoft VSDB&nbsp; for Visual Studio 2008 - GDR Edition.</P>
<P>To know what is VSDB Pro visit <A href="https://msdn.microsoft.com/en-us/library/aa833253(VS.80).aspx" mce_href="https://msdn.microsoft.com/en-us/library/aa833253(VS.80).aspx">https://msdn.microsoft.com/en-us/library/aa833253(VS.80).aspx</A></P>
<P>1. Setting up a Database Project for&nbsp; existing database</P>
<P>2. Establishing Database References</P>
<P>3. Building the Project</P>
<P>4. setting up the project for Deployment</P>
<P><STRONG>Setting up a Database Project for existing Database:</STRONG></P>
<P>1. Open Visual Studio 2008</P>
<P>2. Select File –&gt; New Project</P>
<P>3. Select DatabaseProjects –&gt; SQL Server &lt;Version&gt; –&gt; SQL Server &lt;version&gt; Wizard and Click OK</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_2.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_2.png" mce_href="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb.png" width=331 height=215 mce_src="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb.png"></A> </P>
<P>4.&nbsp; A New Wizard opens—&gt; click on the Next in the first Welcome Screen .</P>
<P>5.&nbsp; Project Properties –&gt;&nbsp; Specify the options as Below And click Next.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_4.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_4.png" mce_href="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_4.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_1.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_1.png" width=405 height=174 mce_src="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_1.png"></A> </P>
<P>6. Database Options –&gt; Select the appropriate Database options in the screen as below and click Next</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_6.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_6.png" mce_href="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_6.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_2.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_2.png" width=370 height=199 mce_src="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_2.png"></A> </P>
<P>7.&nbsp; Import Database Schema –&gt; </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a. Select Import the DataBase Schema Checkbox</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b. Create a New connection to the database that needs to be imported and specify the connection string </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c.&nbsp; Select the Appropriate Import Options as shown in the screen below and Click Next</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_8.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_8.png" mce_href="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_8.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_3.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_3.png" width=365 height=222 mce_src="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_3.png"></A> </P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">&nbsp;</P>
<P>8. Configure Build/Deploy options:- This specifies the settings that needs to be applied for the Build/Deploy Options and then Click on Finish to Import the Database.</P>
<P>9. Once The project is successfully imported, the Project will be opened in Solution Explorer as below.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_10.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_10.png" mce_href="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_10.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_4.png" original-url="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_4.png" width=186 height=246 mce_src="https://blogs.msdn.com/blogfiles/sundararajan/WindowsLiveWriter/DeployingDBProjectsusingMicrosoftVSDBGDR_AA95/image_thumb_4.png"></A> </P>
<P>In the Next Post we will see how to Build the Database project successfully and&nbsp; Fix the Errors that we face on this initial Setup.</P>]]></content:encoded>
    </item>
    <item>
      <title>Freeze the columns in ASP.NEt Gridview</title>
      <link>https://docs.microsoft.com/archive/blogs/sundararajan/freeze-the-columns-in-asp-net-gridview</link>
      <pubDate>Sat, 03 Jan 2009 17:27:59 GMT</pubDate>
      <dc:creator><![CDATA[susubram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sundararajan/2009/01/03/freeze-the-columns-in-asp-net-gridview/</guid>
      <description><![CDATA[In case of datagrids with high number of columns, the datagrids can be made scrollable by placing it...]]></description>
      <content:encoded><![CDATA[<p>In case of datagrids with high number of columns, the datagrids can be made scrollable by placing it with in a div tag.</p>  <p>However , when the scrolling is enabled, in most business scenarios, in any row, all the data in the other column refers to one or two main columns often the leftmost column.</p>  <p>In this case when we scroll to the rightmost end, we lose the context. It would be nice if we could have a feature like the ones that we have in Microsoft Exce, where we can freeze certain columns.</p>  <p>Here is a simple way to do that.</p>  <p>The idea is to have the left property of each of the cells in that column fixed.</p>  <p>STEP 1: Add the Following CSS class to the .aspx file</p>  <blockquote>   <p>td.freezepane{     <br />text-align: left;      <br />border-width:0;      <br />background-color:White;      <br />position:relative;      <br />cursor: default;      <br />left:inherit;      <br />}</p> </blockquote>  <p>&#160;</p>  <p>STEP 2: Set the CSSClass property of the cells in the GridView RowDatabound event.</p>  <blockquote>   <p>protected void gvData_RowDataBound(object sender, GridViewRowEventArgs e)     <br />&#160; { </p>    <p>     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Row.Cells[1].CssClass = &quot;locked&quot;;      <br />&#160; }</p> </blockquote>  <p>And Thats it...&#160; the first column will remain freezed.   </p>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft Virtual Tech Days - India</title>
      <link>https://docs.microsoft.com/archive/blogs/sundararajan/microsoft-virtual-tech-days-india</link>
      <pubDate>Sun, 14 Sep 2008 10:09:59 GMT</pubDate>
      <dc:creator><![CDATA[susubram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sundararajan/2008/09/14/microsoft-virtual-tech-days-india/</guid>
      <description><![CDATA[It has been a long time since i have blogged. I promise myself every month that i should post...]]></description>
      <content:encoded><![CDATA[<p>It has been a long time since i have blogged. I promise myself every month that i should post certain blog posts but never keep them up. </p>  <p>After a long time, I have got a chance to present in a public Tech Event. I will be presenting on ASP.Net Dynamic Data in this virtual tech days (17-18-19 September 2008).&#160; I will be posting an update to this.</p>  <p>Log onto the Sessions @ <a title="https://www.connectwithlife.co.in/" href="https://www.connectwithlife.co.in/">https://www.connectwithlife.co.in/</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Inside String Concatenation</title>
      <link>https://docs.microsoft.com/archive/blogs/sundararajan/inside-string-concatenation</link>
      <pubDate>Mon, 21 Jul 2008 02:31:21 GMT</pubDate>
      <dc:creator><![CDATA[susubram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sundararajan/2008/07/21/inside-string-concatenation/</guid>
      <description><![CDATA[In this post we will discuss about how the concatenation happens when you call string.concat() and...]]></description>
      <content:encoded><![CDATA[<p>In this post we will discuss about how the concatenation happens when you call string.concat() and how the concatenation happens when you call Stringbuilder.Append().</p>  <p>Here I have analyzed it based on the Rotor .Net V2.0 code (some may not apply to .Net 1.1). </p>  <p>Generally, it is of the opinion that for any 2-4 strings use String.Concat() and for more than 4 strings use stringbuilder.Append(). The only difference that the string builder brings in is that it reduces the number of string allocations during the append operation , thereby reducing the GC effort.</p>  <h2>How does a string concat work:-</h2>  <p>If two strings are passed as arguments, it will find out the length of the resultant string, allocate memory for it and then copy these strings one by one.</p>  <p>If more than 4 strings are passed, it will consider it as an array of strings to be concatenated, spin through the array elements to find out the length of the resultant string. Then it allocates the memory for the resultant string and copies the strings one by one into that memory location.</p>  <p>For the C# code below:-</p>  <blockquote>   <p>string s1=“hello”;     <br />string s2=“world”;      <br />string s3=” My”;      <br />string s4=” Program”;</p> </blockquote>  <blockquote>   <p>string result = s1+s2+s3+s4;</p> </blockquote>  <p>it generates the IL code as</p>  <blockquote>   <p>IL_0001: ldstr “hello”</p>    <p>IL_0006: stloc.0</p>    <p>IL_0007: ldstr “world”</p>    <p>IL_000c: stloc.1</p>    <p>IL_000d: ldstr ” My”</p>    <p>IL_0012: stloc.2</p>    <p>IL_0013: ldstr ” Program”</p>    <p>IL_0018: stloc.3</p>    <p>IL_0019: ldloc.0</p>    <p>IL_001a: ldloc.1</p>    <p>IL_001b: ldloc.2</p>    <p>IL_001c: ldloc.3</p>    <p>IL_001d: call string [mscorlib]System.String::Concat(string,</p>    <p>string,</p>    <p>string,</p>    <p>string)</p> </blockquote>  <p>Now when the concatenation changes to</p>  <blockquote>   <p>string result = s1+s2+s3+s4+s1+s2;</p> </blockquote>  <p>The IL code results in a call to the overload method of concat.</p>  <p>call string [mscorlib]System.String::Concat(string[])</p>  <p>This is a fastest way of concatenating strings. And thisworks perfectly fine for small number of strings. Then when do we go for stringBuilder.?</p>  <p>You should go for Stringbuilder when you are not sure of how many concatenations are going to happen. i.e., when the string concatenation is going to happen in a loop.</p>  <p><strong>String Concatenation:-</strong></p>  <p>String.Concat(string,string) </p>  <ol>   <li>     <p>The inputs are string_A, string_B;</p>   </li>    <li>     <p>Total length of the result string = Length(string_A)+ length(String_b);</p>   </li>    <li>     <p>Call Fast allocate string. What it does is take in the length and allocates memory in the heap and returns a string which is there in that memory.</p>   </li>    <li>     <p>Then it calls the FillStringChecked function. It takes 3 parameters.</p>      <ol>       <li>         <p>The end result string</p>       </li>        <li>         <p>Destination position</p>       </li>        <li>         <p>Source string</p>       </li>     </ol>   </li>    <li>     <p>First string A is put in to the result. Then String b is copied into this result from the position length(StringA)</p>   </li>    <li>     <p>This happens in the following way</p>   </li> </ol>  <p><u><strong>String.Cs</strong></u></p>  <blockquote>   <p>fixed(char *pDest = &amp;dest.m_firstChar)</p>    <p>fixed (char *pSrc = &amp;src.m_firstChar) {</p>    <p>wstrcpy(pDest + destPos, pSrc, length);</p>    <p>}</p> </blockquote>  <p>pDest contains the address of the first character of the string ‘dest’.</p>  <p>pSrc contains the address of the first character of the string ‘src’.</p>  <ol>   <li>     <p>Here fixed key word is used so that , garbage collector does not move the string object when it is half way through the concat operation. This is called pinning and this can be used when the method is marked unsafe.</p>   </li> </ol>  <p><strong>String Builder:-</strong></p>  <p>String builder class represents a mutable string. It is convenient for situations in which it is desirable to modify a string, perhaps by removing, replacing or inserting characters without creating a new string subsequent to each modification.</p>  <p><strong>What happens when you call the constructor of String Builder:-</strong></p>  <blockquote>   <p>stringBuilder strbConcatenation = new stringBuilder(string);</p> </blockquote>  <p>It allocates a memory space of 16 characters by default. However you can initialize the capacity of the string. The max capacity that can be allocated is 2147483647. ( this is nothing but Int32.MaxValue)</p>  <p>Now if the passed on string length is greater than the capacity then the capacity =capacity * 2. This ensures that there is a predicted growth rate. Then the Memory of that capacity is allocated. Then the input string is copied into the start of the new allocated memory and returns the reference to the memory space.</p>  <p><strong>Now what happens when you call StringBuilder.Append(value) :-</strong></p>  <p>Stringbuilder maintains the reference to the allocated memory space. Now it will find out if the value can be appended in place in the same memory space. If it can be allocated in the same memory space, then the wstrcpy happens.</p>  <p>What if the string builder does not have enough space to accommodate the newly concatenated string?.</p>  <p>In that case, it has to allocate a new memory space, copy the old string and also the new string. All this happens in the fixed regions of memory or pinned memory. This is the reason, that providing an optimal capacity when instantiating the string builder, reduces the number of new allocations. This will dramatically improve the performance as the number of garbage collections will be less.</p>  <p>This is more explicit from the SSCLI code</p>  <blockquote>   <p>if (NeedsAllocation(currentString,requiredLength)) {</p>    <p>// here it allocates more memory and gets a new string.</p>    <p>String newString = GetNewString(currentString,requiredLength);</p>    <p>newString.AppendInPlace(value,currentLength);</p>    <p>ReplaceString(tid,newString);</p>    <p>} else {</p>    <p>// the append is carried out in place.</p>    <p>currentString.AppendInPlace(value,currentLength);</p>    <p>ReplaceString(tid,currentString);</p>    <p>}</p> </blockquote>  <p><strong>Conclusion:-</strong></p>  <ol>   <li>     <p>String builder gives an edge in the performance by the way that it is not going to make more Allocations often and deallocations.</p>   </li>    <li>     <p>String concat is good for small string because the way it concats is pretty much faster when compared to string builder except for the memory allocation overhead and the time required for that memory allocation.</p>   </li> </ol>  <p>&#160;</p>  <p><font color="#004000">Disclaimer : All the information mentioned in the post are my own and it does not reflect any opinion of my company .</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Namaste…….</title>
      <link>https://docs.microsoft.com/archive/blogs/sundararajan/namaste</link>
      <pubDate>Mon, 21 Jul 2008 02:25:20 GMT</pubDate>
      <dc:creator><![CDATA[susubram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sundararajan/2008/07/21/namaste/</guid>
      <description><![CDATA[Finally, I have decided to start blogging in MSDN Blogs. I’m a SDE working with Microsoft R&amp;D...]]></description>
      <content:encoded><![CDATA[<p>Finally, I have decided to start blogging in MSDN Blogs. I’m a SDE working with Microsoft R&amp;D India Pvt Ltd., I work on .Net and SQL 2000/2005 applications. I will be writing about C# .Net/ ASP.Net &amp; AJAX / WCF. </p>]]></content:encoded>
    </item>
  </channel>
</rss>