<?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-6416251170702933799</id><updated>2024-11-01T04:32:54.906-07:00</updated><category term="XSLT"/><category term="DataKey"/><category term="Generic list"/><category term="GridView"/><category term="Serialization"/><category term="Serialize Objects"/><category term="Anonymous"/><category term="Anonymous Method"/><category term="Arraylist"/><category term="BCP"/><category term="BinaryFormatter"/><category term="Browse Dialog Box"/><category term="CHECKIDENT"/><category term="Client IP address"/><category term="Control Binding"/><category term="DataContext Class Update"/><category term="DataGridView"/><category term="Disable"/><category term="Disable Save/Open Button Download Dialog box"/><category term="Dynamic columns"/><category term="Embed"/><category term="Event Logging"/><category term="Excel"/><category term="ExportToExcel"/><category term="Iteration in XSLT"/><category term="LINQ"/><category term="LINQ TO SQL UPDATE"/><category term="Named"/><category term="Named Method"/><category term="Numeric check with XSLT"/><category term="OnRowCommand"/><category term="RE SEED"/><category term="RESEED"/><category term="RadioButton"/><category term="RadioButtonList"/><category term="RowCommand Event"/><category term="SQL Bulk Copy"/><category term="SQL Objects"/><category term="SQL RESEED"/><category term="SQLBulkCopy"/><category term="SYS.OBJECTS"/><category term="Saving changes is not permitted. tables to be dropped and recreated"/><category term="Select SP&#39;s from DB"/><category term="Serialize and DeSerialize"/><category term="Windows Media Player"/><category term="Write to Event Viewer"/><category term="XSLT Conditional Looping"/><category term="XmlSerializer class"/><category term="XslCompiledTransform"/><category term="binding"/><category term="c#.net"/><category term="column styles"/><title type='text'>Dot Net Code Samples</title><subtitle type='html'>Dot net Sample codes, C#.net, ASP.net, VB.NET, Dot net Tips, Data grid, Grid View, Dot net Framework, SQL Server</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-3596595441093237870</id><published>2013-12-15T17:51:00.001-08:00</published><updated>2013-12-22T19:14:56.324-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Saving changes is not permitted. tables to be dropped and recreated"/><title type='text'>Saving changes is not permitted. The changes you have made require the following tables to be dropped and recreated...</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi Friends,&lt;br /&gt;
&lt;br /&gt;
If you see this error while you trying to save your table changes in sql server design mode,&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnZ8tuPqnhnsADSJIiXHR8sKezyLZKLU2Bp9DkDu58Hol8YrlmNOuTwxUm6I069iuSzd8LCKpZabq8T0QuBQLBCQN12A99-wcPGwFDAqo7BHfRFFi7WyN06dRXR4lKMQgSqOJczFjrA1I3/s1600/SqlSaveError.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;95&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnZ8tuPqnhnsADSJIiXHR8sKezyLZKLU2Bp9DkDu58Hol8YrlmNOuTwxUm6I069iuSzd8LCKpZabq8T0QuBQLBCQN12A99-wcPGwFDAqo7BHfRFFi7WyN06dRXR4lKMQgSqOJczFjrA1I3/s400/SqlSaveError.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Follow the below steps to solve this issue.&lt;br /&gt;
&lt;br /&gt;
Go to menu &quot;Tools--&amp;gt; Options&quot;&lt;br /&gt;
Select &quot;Designers&quot;&lt;br /&gt;
Uncheck the check box &quot;Prevent saving changes that require table re-creation&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBmB7AaqIEl_pIiAjEHUoCocMkt5O5kY-y2AzN4FJ_K4jKKSs1k6K2b9jjQKzV-subZfUOLyuil8Um9noQaNx_tIid8DG18z_20DyVxT_6V6qvHZ3q5kshzVjgFrF4D2Veu0B4dVzggsXM/s1600/Solution.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBmB7AaqIEl_pIiAjEHUoCocMkt5O5kY-y2AzN4FJ_K4jKKSs1k6K2b9jjQKzV-subZfUOLyuil8Um9noQaNx_tIid8DG18z_20DyVxT_6V6qvHZ3q5kshzVjgFrF4D2Veu0B4dVzggsXM/s400/Solution.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
Thank you&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/3596595441093237870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2013/12/saving-changes-is-not-permitted-changes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/3596595441093237870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/3596595441093237870'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2013/12/saving-changes-is-not-permitted-changes.html' title='Saving changes is not permitted. The changes you have made require the following tables to be dropped and recreated...'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnZ8tuPqnhnsADSJIiXHR8sKezyLZKLU2Bp9DkDu58Hol8YrlmNOuTwxUm6I069iuSzd8LCKpZabq8T0QuBQLBCQN12A99-wcPGwFDAqo7BHfRFFi7WyN06dRXR4lKMQgSqOJczFjrA1I3/s72-c/SqlSaveError.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-5553502886164679171</id><published>2011-12-09T01:10:00.000-08:00</published><updated>2011-12-09T01:38:04.908-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Numeric check with XSLT"/><category scheme="http://www.blogger.com/atom/ns#" term="XSLT"/><title type='text'>XSLT - Numeric Checking</title><content type='html'>Hi Friends,&lt;br /&gt;&lt;br /&gt;Here I would like to say about XSLT programming. &lt;br /&gt;The example mentioned below is for finding the numeric values contained in an xml file.&lt;br /&gt;&lt;br /&gt;For testing this example you need two files.&lt;br /&gt;&lt;br /&gt;1. XML file its name should be &quot;Numbers.xml&quot;&lt;br /&gt;2. XSL file its name should be &quot;NumberCheck.xsl&quot;&lt;br /&gt;&lt;br /&gt;Copy these files to a folder and open the xml file in a browser.&lt;br /&gt;&lt;br /&gt;&quot;Numbers.xml&quot;&lt;br /&gt;---------------------&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; ?&amp;gt;&lt;br /&gt;&amp;lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;NumberCheck.xsl&quot; ?&amp;gt;&lt;br /&gt;&amp;lt;Numbers&amp;gt;&lt;br /&gt; &amp;lt;Number&amp;gt;&lt;br /&gt;  &amp;lt;Value&amp;gt;11&amp;lt;/Value&amp;gt;&lt;br /&gt; &amp;lt;/Number&amp;gt;&lt;br /&gt; &amp;lt;Number&amp;gt;&lt;br /&gt;  &amp;lt;Value&amp;gt;12&amp;lt;/Value&amp;gt;&lt;br /&gt; &amp;lt;/Number&amp;gt;&lt;br /&gt; &amp;lt;Number&amp;gt;&lt;br /&gt;  &amp;lt;Value&amp;gt;DD&amp;lt;/Value&amp;gt;&lt;br /&gt; &amp;lt;/Number&amp;gt;&lt;br /&gt; &amp;lt;Number&amp;gt;&lt;br /&gt;  &amp;lt;Value&amp;gt;23&amp;lt;/Value&amp;gt;&lt;br /&gt; &amp;lt;/Number&amp;gt;&lt;br /&gt; &amp;lt;Number&amp;gt;&lt;br /&gt;  &amp;lt;Value&amp;gt;33&amp;lt;/Value&amp;gt;&lt;br /&gt; &amp;lt;/Number&amp;gt;&lt;br /&gt; &amp;lt;Number&amp;gt;&lt;br /&gt;  &amp;lt;Value&amp;gt;FF&amp;lt;/Value&amp;gt;&lt;br /&gt; &amp;lt;/Number&amp;gt;&lt;br /&gt; &amp;lt;Number&amp;gt;&lt;br /&gt;  &amp;lt;Value&amp;gt;VV&amp;lt;/Value&amp;gt;&lt;br /&gt; &amp;lt;/Number&amp;gt;&lt;br /&gt;&amp;lt;/Numbers&amp;gt;&lt;br /&gt;&lt;br /&gt;&quot;NumberCheck.xsl&quot;&lt;br /&gt;---------------------------&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&amp;gt;&lt;br /&gt;&amp;lt;xsl:template match=&quot;Numbers&quot;&amp;gt; &lt;br /&gt;    &amp;lt;TABLE&amp;gt;&lt;br /&gt;      &amp;lt;xsl:for-each select=&quot;Number&quot;&amp;gt; &lt;br /&gt; &amp;lt;xsl:choose&amp;gt;&lt;br /&gt; &amp;lt;xsl:when test=&#39;number(Value)&#39;&amp;gt;&lt;br /&gt;  &amp;lt;TR&amp;gt;&lt;br /&gt;             &amp;lt;TD&amp;gt;&lt;br /&gt;               I am a numeric value : &amp;lt;xsl:value-of select=&quot;Value&quot; /&amp;gt;&lt;br /&gt;             &amp;lt;/TD&amp;gt;&lt;br /&gt;         &amp;lt;/TR&amp;gt; &lt;br /&gt; &amp;lt;/xsl:when&amp;gt;&lt;br /&gt; &amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;  &amp;lt;TR&amp;gt;&lt;br /&gt;             &amp;lt;TD&amp;gt;&lt;br /&gt;               I am not a numeric value : &amp;lt;xsl:value-of select=&quot;Value&quot; /&amp;gt;&lt;br /&gt;             &amp;lt;/TD&amp;gt;&lt;br /&gt;         &amp;lt;/TR&amp;gt; &lt;br /&gt; &amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt; &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:for-each&amp;gt; &lt;br /&gt;    &amp;lt;/TABLE&amp;gt; &lt;br /&gt;  &amp;lt;/xsl:template&amp;gt; &lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;&lt;br /&gt;In this example the xslt function &amp;lt;xsl:when test=&#39;number(Value)&#39;&amp;gt; will help you to find the given value is a numeric or not&lt;br /&gt;&lt;br /&gt;its out put will be like this&lt;br /&gt;&lt;br /&gt;I am a numeric value : 11 &lt;br /&gt;I am a numeric value : 12 &lt;br /&gt;I am not a numeric value : DD &lt;br /&gt;I am a numeric value : 23 &lt;br /&gt;I am a numeric value : 33 &lt;br /&gt;I am not a numeric value : FF &lt;br /&gt;I am not a numeric value : VV</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/5553502886164679171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/12/xslt-numeric-checking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5553502886164679171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5553502886164679171'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/12/xslt-numeric-checking.html' title='XSLT - Numeric Checking'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-6908347880932933807</id><published>2011-10-12T05:25:00.000-07:00</published><updated>2011-10-12T05:57:20.815-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Select SP&#39;s from DB"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Objects"/><category scheme="http://www.blogger.com/atom/ns#" term="SYS.OBJECTS"/><title type='text'>SQL Query for selecting database objects</title><content type='html'>1. SQL Query for selecting database objects&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SELECT * FROM SYS.OBJECTS&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;2. SQL Query for selecting database Stored Procedurers&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SELECT * FROM SYS.OBJECTS WHERE TYPE = &#39;P&#39; ORDER BY NAME ASC&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3. SQL Query for selecting database Tables&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SELECT * FROM SYS.OBJECTS WHERE TYPE = &#39;U&#39; ORDER BY NAME ASC&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;4.SQL Query for selecting database Functions&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SELECT * FROM SYS.OBJECTS WHERE TYPE = &#39;FN&#39; ORDER BY NAME ASC&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;5.SQL Query for selecting database Primary Keys&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SELECT * FROM SYS.OBJECTS WHERE TYPE = &#39;PK&#39; ORDER BY NAME ASC&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/6908347880932933807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/10/sql-query-for-selecting-database.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/6908347880932933807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/6908347880932933807'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/10/sql-query-for-selecting-database.html' title='SQL Query for selecting database objects'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-7426396721902518349</id><published>2011-05-19T05:33:00.000-07:00</published><updated>2011-05-19T05:36:14.618-07:00</updated><title type='text'>Play a video file in HTML</title><content type='html'>&amp;lt;object classid=&#39;CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95&#39; id=&#39;player&#39; width=&#39;150&#39;&lt;br /&gt;            height=&#39;150&#39; standby=&#39;Please wait while the object is loaded...&#39;&amp;gt;&lt;br /&gt;            &amp;lt;param name=&#39;url&#39; value=&#39;D:\Experiments\clock.avi&#39; /&amp;gt;&lt;br /&gt;            &amp;lt;param name=&#39;src&#39; value=&#39;D:\Experiments\clock.avi&#39; /&amp;gt;&lt;br /&gt;            &amp;lt;param name=&#39;AutoStart&#39; value=&#39;false&#39; /&amp;gt;&lt;br /&gt;            &amp;lt;param name=&#39;Balance&#39; value=&#39;0&#39; /&amp;gt;              //-100 is fully left, 100 is fully right.&lt;br /&gt;            &amp;lt;param name=&#39;CurrentPosition&#39; value=&#39;0&#39; /&amp;gt;      //Position in seconds when starting.&lt;br /&gt;            &amp;lt;param name=&#39;showcontrols&#39; value=&#39;true&#39; /&amp;gt;      //Show play/stop/pause controls.&lt;br /&gt;            &amp;lt;param name=&#39;enablecontextmenu&#39; value=&#39;true&#39; /&amp;gt; //Allow right-click.&lt;br /&gt;            &amp;lt;param name=&#39;fullscreen&#39; value=&#39;true&#39; /&amp;gt;        //Start in full screen or not.&lt;br /&gt;            &amp;lt;param name=&#39;mute&#39; value=&#39;false&#39; /&amp;gt;&lt;br /&gt;            &amp;lt;param name=&#39;PlayCount&#39; value=&#39;1&#39; /&amp;gt;            //Number of times the content will play.&lt;br /&gt;            &amp;lt;param name=&#39;rate&#39; value=&#39;1.0&#39; /&amp;gt;               //0.5=Slow, 1.0=Normal, 2.0=Fast&lt;br /&gt;            &amp;lt;param name=&#39;uimode&#39; value=&#39;custom&#39; /&amp;gt;          // full, mini, custom, none, invisible&lt;br /&gt;            &amp;lt;param name=&#39;showdisplay&#39; value=&#39;false&#39; /&amp;gt;      //Show or hide the name of the file.&lt;br /&gt;            &amp;lt;param name=&#39;volume&#39; value=&#39;50&#39; /&amp;gt;              // 0=lowest, 100=highest&lt;br /&gt;        &amp;lt;/object&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/7426396721902518349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/05/play-video-file-in-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7426396721902518349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7426396721902518349'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/05/play-video-file-in-html.html' title='Play a video file in HTML'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-3780446019255759287</id><published>2011-05-10T00:27:00.000-07:00</published><updated>2011-05-10T02:09:43.898-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BCP"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Bulk Copy"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLBulkCopy"/><title type='text'>SQL Bulk Copy</title><content type='html'>SQL Bulk Copy is for moving data from one Table to another. This can be from a single server or between different servers (Source and destination are different servers).&lt;br /&gt;SqlBulk copy class can be used to write data only to sql server tables. Any data source can be used for loading data as long as the data can be loaded to a Data Table or read with an IDataReader instance.&lt;br /&gt;In The example mentioned below, I am using Oracle Table as source and Sql Server Table as destination. Also DataReader is using to fetch data from oracle.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SQL Bulk Copy Example &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;        public void BulkCopyMethod()&lt;br /&gt;        {&lt;br /&gt;            string oracleConnectionString = &quot;Data Source=SERVICENAME;User Id=USERNAME;Password=PASSWORD;&quot;;&lt;br /&gt;            string sqlConnectionString = &quot;Data Source=DATASOURCE;Initial Catalog=DATABASENAME;Connect Timeout=0;User ID=USERNAME;Pwd=PASSWORD;&quot;;&lt;br /&gt;            string oracleSelectStatement = &quot;SELECT EmployeeID,EmployeeName,EmployeeAge,EmployeePlace,EmployeePin,EmployeePhoneNum FROM EmployeeData&quot;;&lt;br /&gt;&lt;br /&gt;            using (OracleConnection oracleConn = new OracleConnection(oracleConnectionString))&lt;br /&gt;            {&lt;br /&gt;                oracleConn.Open();&lt;br /&gt;                OracleCommand employeeCommand = new OracleCommand(oracleSelectStatement, oracleConn);&lt;br /&gt;                OracleDataReader employeeReader = employeeCommand.ExecuteReader();&lt;br /&gt;&lt;br /&gt;                using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString))&lt;br /&gt;                {&lt;br /&gt;                    bulkCopy.DestinationTableName = &quot;dbo.tblEmployee&quot;;&lt;br /&gt;                    bulkCopy.ColumnMappings.Add(&quot;EmployeeID&quot;, &quot;Id&quot;);&lt;br /&gt;                    bulkCopy.ColumnMappings.Add(&quot;EmployeeName&quot;, &quot;Emp_Name&quot;);&lt;br /&gt;                    bulkCopy.ColumnMappings.Add(&quot;EmployeeAge&quot;, &quot;Emp_Age&quot;);&lt;br /&gt;                    bulkCopy.ColumnMappings.Add(&quot;EmployeePlace&quot;, &quot;Emp_Place&quot;);&lt;br /&gt;                    bulkCopy.ColumnMappings.Add(&quot;EmployeePin&quot;, &quot;Emp_Pin&quot;);&lt;br /&gt;                    bulkCopy.ColumnMappings.Add(&quot;EmployeePhoneNum&quot;, &quot;Emp_Phone&quot;);&lt;br /&gt;&lt;br /&gt;                    try&lt;br /&gt;                    {&lt;br /&gt;                        bulkCopy.WriteToServer(employeeReader);&lt;br /&gt;                    }&lt;br /&gt;                    catch (Exception ex)&lt;br /&gt;                    {&lt;br /&gt;                        throw ex;&lt;br /&gt;                    }&lt;br /&gt;                    finally&lt;br /&gt;                    {&lt;br /&gt;                        bulkCopy.Close();&lt;br /&gt;                        employeeReader.Close();&lt;br /&gt;                        employeeCommand.Dispose();&lt;br /&gt;                        oracleConn.Close();&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;For more info:- http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/3780446019255759287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/05/sql-bulk-copy.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/3780446019255759287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/3780446019255759287'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/05/sql-bulk-copy.html' title='SQL Bulk Copy'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-5670291776432659581</id><published>2011-04-25T02:11:00.001-07:00</published><updated>2011-05-09T05:57:30.254-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Generic list"/><category scheme="http://www.blogger.com/atom/ns#" term="Serialize and DeSerialize"/><title type='text'>How to Serialize and DeSerialize a Generic List</title><content type='html'>private void button1_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            List&amp;lt;Employee&amp;gt; emps = new List&amp;lt;Employee&amp;gt;();&lt;br /&gt;            emps.Add(new Employee(&quot;1&quot;, &quot;Sabu&quot;));&lt;br /&gt;            emps.Add(new Employee(&quot;2&quot;, &quot;John&quot;));&lt;br /&gt;            emps.Add(new Employee(&quot;3&quot;, &quot;Tom&quot;));&lt;br /&gt;            emps.Add(new Employee(&quot;4&quot;, &quot;George&quot;));&lt;br /&gt;            string serializedXmlString = XmlSerialize(emps);&lt;br /&gt;            List&amp;lt;Employee&amp;gt; deserializedEmps = XmlDeserialize(serializedXmlString);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;//XmlSerialize method&lt;br /&gt;        public string XmlSerialize(List&amp;lt;Employee&amp;gt; emps)&lt;br /&gt;        {&lt;br /&gt;            System.Xml.Serialization.XmlSerializer xmlSer = new System.Xml.Serialization.XmlSerializer(emps.GetType());&lt;br /&gt;            StringWriter textWriter = new StringWriter();&lt;br /&gt;            xmlSer.Serialize(textWriter, emps);&lt;br /&gt;            xmlSer = null;&lt;br /&gt;            return textWriter.ToString();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//XmlDeserialize method&lt;br /&gt;        public List&amp;lt;Employee&amp;gt; XmlDeserialize(String data)&lt;br /&gt;        {&lt;br /&gt;            System.Xml.Serialization.XmlSerializer xmlSer = new System.Xml.Serialization.XmlSerializer(typeof(List&amp;lt;Employee&amp;gt;));&lt;br /&gt;            TextReader reader = new StringReader(data);&lt;br /&gt;            object obj = xmlSer.Deserialize(reader);&lt;br /&gt;            return (List&amp;lt;Employee&amp;gt;)obj;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Employee Class with Serializable attribute&lt;br /&gt;&lt;br /&gt;[Serializable]&lt;br /&gt;    public class Employee&lt;br /&gt;    {&lt;br /&gt;        public Employee()&lt;br /&gt;        {&lt;br /&gt;            ID = &quot;&quot;;&lt;br /&gt;            Name = &quot;&quot;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Employee(String id, String name)&lt;br /&gt;        {&lt;br /&gt;            ID = id;&lt;br /&gt;            Name = name;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        public string ID { get; set; }&lt;br /&gt;        public string Name { get; set; }&lt;br /&gt;    }</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/5670291776432659581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/04/how-to-serialize-and-deserialize.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5670291776432659581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5670291776432659581'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/04/how-to-serialize-and-deserialize.html' title='How to Serialize and DeSerialize a Generic List'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-8499822545654617526</id><published>2011-04-25T00:14:00.000-07:00</published><updated>2011-04-25T02:01:31.505-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CHECKIDENT"/><category scheme="http://www.blogger.com/atom/ns#" term="RE SEED"/><category scheme="http://www.blogger.com/atom/ns#" term="RESEED"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL RESEED"/><title type='text'>SQL Table Reseeding</title><content type='html'>For Reseeding an Identity column use this statement.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;DBCC CHECKIDENT (Employee, RESEED, 0)&lt;/b&gt;&lt;br /&gt;Employee is the TABLE NAME. After the execution of this statement identity value will start from 1...&lt;br /&gt;&lt;br /&gt;if you want to start from 11, execute statement like &lt;br /&gt;&lt;b&gt;DBCC CHECKIDENT (Employee, RESEED, 10)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DBCC means Database Console Commands.&lt;br /&gt;this command statements are grouped in to several categories&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Maintenance statements - Maintenance tasks on a database, index, or filegroup.  &lt;br /&gt;&lt;li&gt;Miscellaneous statements -  Miscellaneous tasks such as enabling row-level locking or removing a dynamic-link library (DLL) from memory. &lt;br /&gt;&lt;li&gt;Status statements - Status checks. &lt;br /&gt;&lt;li&gt;Validation statements - Validation operations on a database, table, index, catalog, filegroup, system tables, or allocation of database pages. &lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;For more info&lt;br /&gt;1. http://msdn.microsoft.com/en-us/library/aa258281(v=sql.80).aspx&lt;br /&gt;2. http://msdn.microsoft.com/en-us/library/aa258817(v=sql.80).aspx</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/8499822545654617526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/04/sql-table-reseeding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/8499822545654617526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/8499822545654617526'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2011/04/sql-table-reseeding.html' title='SQL Table Reseeding'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-9217730968414782158</id><published>2010-12-06T02:28:00.000-08:00</published><updated>2010-12-06T05:09:19.480-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DataKey"/><category scheme="http://www.blogger.com/atom/ns#" term="GridView"/><category scheme="http://www.blogger.com/atom/ns#" term="OnRowCommand"/><title type='text'>How to get DataKey in GridView&#39;s OnRowCommand event</title><content type='html'>/// &amp;lt;summary&amp;gt;&lt;br /&gt;        ///  Handle grid Employee row command&lt;br /&gt;        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;        /// &amp;lt;param name=&quot;sender&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;        /// &amp;lt;param name=&quot;e&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;        protected void grdEmployee_OnRowCommand(object sender, GridViewCommandEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (e.CommandName == &quot;Details&quot;)&lt;br /&gt;            {&lt;br /&gt;                GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;&lt;br /&gt;                int index       = row.RowIndex;&lt;br /&gt;                int EmployeeID = Convert.ToInt32(grdEmployee.DataKeys[index].Value);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;font-weight:bold;&quot;&gt;Here “e.CommandSource” is the Clicked LinkButton and NamingContainer is its Parent Control. So that will be the GridViewRow. Here we can easily find the DataKey. Here in my Example EmployeeID is the DataKey&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:GridView ID=&quot;grdEmployee&quot; runat=&quot;server&quot; &lt;br /&gt;EmptyDataText=&quot;No Employee Available.&quot;&lt;br /&gt;Width=&quot;100%&quot; AllowPaging=&quot;True&quot;&lt;br /&gt;PageSize=&quot;10&quot; OnRowDeleting=&quot;grdEmployee_RowDeleting&quot; OnPageIndexChanging=&quot;grdEmployee_PageIndexChanging&quot;&lt;br /&gt;DataKeyNames=&quot;EmployeeID&quot; &lt;br /&gt;OnRowCommand=&quot;grdEmployee_OnRowCommand&quot;&amp;gt;&lt;br /&gt;&amp;lt;Columns&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField HeaderText=&quot;Employee Code&quot; DataField=&quot;EmployeeCode&quot;&amp;gt;&lt;br /&gt;&amp;lt;/asp:BoundField&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField HeaderText=&quot;Employee Name&quot; DataField=&quot;EmployeeName&quot;&amp;gt;&lt;br /&gt;&amp;lt;/asp:BoundField&amp;gt;&lt;br /&gt;&amp;lt;asp:TemplateField HeaderStyle-HorizontalAlign=&quot;Left&quot;&amp;gt;&lt;br /&gt;&amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;asp:LinkButton ID=&quot;lbtnDelete&quot; runat=&quot;server&quot; CausesValidation=&quot;false&quot; CommandName=&quot;Delete&quot; Text=&quot;Delete&quot;&amp;gt;&amp;lt;/asp:LinkButton&amp;gt;&lt;br /&gt;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;&amp;lt;asp:TemplateField HeaderStyle-HorizontalAlign=&quot;Left&quot;&amp;gt;&lt;br /&gt;&amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;asp:LinkButton ID=&quot;lnkDetails&quot; runat=&quot;server&quot; CausesValidation=&quot;false&quot; CommandName=&quot;Details&quot; Text=&quot;View Details&quot;&amp;gt;&amp;lt;/asp:LinkButton&amp;gt;&lt;br /&gt;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:TemplateField&amp;gt;&lt;br /&gt;&amp;lt;/Columns&amp;gt;&lt;br /&gt;&amp;lt;/asp:GridView&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/9217730968414782158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/12/how-to-get-datakey-in-gridviews.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/9217730968414782158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/9217730968414782158'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/12/how-to-get-datakey-in-gridviews.html' title='How to get DataKey in GridView&#39;s OnRowCommand event'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-5042673444305133043</id><published>2010-12-03T00:36:00.000-08:00</published><updated>2010-12-03T03:20:38.286-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="RadioButton"/><category scheme="http://www.blogger.com/atom/ns#" term="RadioButtonList"/><title type='text'>Difference between RadioButtonList and RadioButton</title><content type='html'>&lt;b&gt;Difference between RadioButtonList and RadioButton&lt;/b&gt;&lt;br /&gt;1. &lt;b&gt;RadioButtonList&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;RadioButtonList  is a single control with a list of RadioButtons.&lt;br /&gt;This is derived from  ListControl class. So this will work similar to other list controls like ListBox, DropDownList and CheckBoxList.  &lt;br /&gt;For giving a caption for buttons you can use the Text property. You cannot insert a text in between two buttons. &lt;br /&gt;Using the “SelectedIndexChanged” event you will get the selected buttons value (“RadioButtonList1.SelectedValue”). &lt;br /&gt;It is easy to bind this to a DataSource.&lt;br /&gt;private void Bind()&lt;br /&gt;{&lt;br /&gt;RadioButtonList1.DataSource = dsEmployees;&lt;br /&gt;RadioButtonList1.DataTextField = &quot;EmployeeName&quot;;&lt;br /&gt;RadioButtonList1.DataValueField = &quot;EmployeeID&quot;;&lt;br /&gt;RadioButtonList1.DataBind();&lt;br /&gt;}&lt;br /&gt;If you are using HTML &lt;br /&gt;&amp;lt;asp:RadioButtonList ID=&quot;RadioButtonList1&quot; runat=&quot;server&quot; &lt;br /&gt;            RepeatDirection=&quot;Horizontal&quot; &lt;br /&gt;onselectedindexchanged=&quot;RadioButtonList1_SelectedIndexChanged&quot;&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem Text=&quot;Male&quot; Value=&quot;1&quot; &amp;gt;&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem Text=&quot;Female&quot; Value=&quot;2&quot; &amp;gt;&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;/asp:RadioButtonList&amp;gt;&lt;br /&gt;&lt;br /&gt;2. &lt;b&gt;RadioButton&lt;/b&gt;&lt;br /&gt;“”RadioButton” is a single control, it is derived from “CheckBox” Class. You have to set the GroupName property to identify a group. Also the event handler for the event “CheckedChanged” will help us to do some job. Another one thing is you have to write separate handlers for each radio button.&lt;br /&gt;&lt;br /&gt;For e.g.: &lt;br /&gt;&amp;lt;asp:RadioButton ID=&quot;RadioButton1&quot; runat=&quot;server&quot; GroupName=&quot;Gender&quot; &lt;br /&gt;            AutoPostBack=&quot;true&quot; oncheckedchanged=&quot;RadioButton1_CheckedChanged&quot; Text=&quot;Male&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;asp:RadioButton ID=&quot;RadioButton2&quot; runat=&quot;server&quot; GroupName=&quot;Gender&quot; &lt;br /&gt;            AutoPostBack=&quot;true&quot; oncheckedchanged=&quot;RadioButton2_CheckedChanged&quot; Text=&quot;Female&quot; /&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/5042673444305133043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/12/difference-between-radiobuttonlist-and.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5042673444305133043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5042673444305133043'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/12/difference-between-radiobuttonlist-and.html' title='Difference between RadioButtonList and RadioButton'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-7298680999987011328</id><published>2010-10-29T06:10:00.000-07:00</published><updated>2010-10-29T06:29:22.052-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel"/><category scheme="http://www.blogger.com/atom/ns#" term="ExportToExcel"/><category scheme="http://www.blogger.com/atom/ns#" term="XslCompiledTransform"/><category scheme="http://www.blogger.com/atom/ns#" term="XSLT"/><title type='text'>Format Excel file using XSLT, XslCompiledTransform</title><content type='html'>See the  sample code for creating an Excel file formatted with the help of XSLT file.&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void button1_Click(object sender, EventArgs e)&lt;br /&gt;      {&lt;br /&gt;          ExportToExcel(GetDataSet(), &quot;Employees.xslt&quot;, &quot;c:\\Employees.xls&quot;);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;Method to create a dataset for writing to excel     &lt;br /&gt;---------------------------------------------------------&lt;br /&gt;&lt;br /&gt;private DataSet GetDataSet()&lt;br /&gt;      {&lt;br /&gt;          DataSet ds = new DataSet();&lt;br /&gt;          DataTable dtEmployees = new DataTable(&quot;Employees&quot;);&lt;br /&gt;          DataColumn colEmpID = new DataColumn(&quot;EmpID&quot;);&lt;br /&gt;          DataColumn colEmpName = new DataColumn(&quot;EmpName&quot;);&lt;br /&gt;          DataColumn colAge = new DataColumn(&quot;Age&quot;);&lt;br /&gt;          DataColumn colLocation = new DataColumn(&quot;Location&quot;);&lt;br /&gt;          DataColumn colDesignation = new DataColumn(&quot;Designation&quot;);&lt;br /&gt;          dtEmployees.Columns.AddRange(new DataColumn[] { colEmpID, colEmpName, colAge, colLocation, colDesignation });&lt;br /&gt;&lt;br /&gt;          DataRow dr = dtEmployees.NewRow();&lt;br /&gt;          dr[colEmpID] = &quot;E001&quot;;&lt;br /&gt;          dr[colEmpName] = &quot;George&quot;;&lt;br /&gt;          dr[colAge] = &quot;45&quot;;&lt;br /&gt;          dr[colLocation] = &quot;USA&quot;;&lt;br /&gt;          dr[colDesignation] = &quot;PM&quot;;&lt;br /&gt;          dtEmployees.Rows.Add(dr);&lt;br /&gt;&lt;br /&gt;          dr = dtEmployees.NewRow();&lt;br /&gt;          dr[colEmpID] = &quot;E002&quot;;&lt;br /&gt;          dr[colEmpName] = &quot;James&quot;;&lt;br /&gt;          dr[colAge] = &quot;30&quot;;&lt;br /&gt;          dr[colLocation] = &quot;INDIA&quot;;&lt;br /&gt;          dr[colDesignation] = &quot;TL&quot;;&lt;br /&gt;          dtEmployees.Rows.Add(dr);&lt;br /&gt;       &lt;br /&gt;          dr = dtEmployees.NewRow();&lt;br /&gt;          dr[colEmpID] = &quot;E002&quot;;&lt;br /&gt;          dr[colEmpName] = &quot;Mary&quot;;&lt;br /&gt;          dr[colAge] = &quot;35&quot;;&lt;br /&gt;          dr[colLocation] = &quot;UK&quot;;&lt;br /&gt;          dr[colDesignation] = &quot;Developer&quot;;&lt;br /&gt;          dtEmployees.Rows.Add(dr);&lt;br /&gt;&lt;br /&gt;          ds.Tables.Add(dtEmployees);&lt;br /&gt;          return ds;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Method to create  a XSLT formatted excel file&lt;br /&gt;---------------------------------------------------------&lt;br /&gt;&lt;br /&gt;public bool ExportToExcel(DataSet ds, string xsltPath, string pathToSave)&lt;br /&gt;      {&lt;br /&gt;          try&lt;br /&gt;          {&lt;br /&gt;              XmlDataDocument xmlDoc = new XmlDataDocument();&lt;br /&gt;              xmlDoc.LoadXml(ds.GetXml());&lt;br /&gt;              XslCompiledTransform xsl = new XslCompiledTransform();&lt;br /&gt;              xsl.Load(xsltPath);&lt;br /&gt;              StreamWriter strWriter = new StreamWriter(pathToSave);&lt;br /&gt;              xsl.Transform(xmlDoc, null, strWriter);&lt;br /&gt;              strWriter.Flush();&lt;br /&gt;              return true;&lt;br /&gt;          }&lt;br /&gt;          catch (Exception ex)&lt;br /&gt;          {&lt;br /&gt;              throw ex;&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Save the below mentioned XSLT in a file with name &quot;Employees.xslt&quot; in &quot;C&quot; drive to run the sample&lt;br /&gt;---------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version=&quot;1.0&quot;&lt;br /&gt;&lt;br /&gt;xmlns=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot;&lt;br /&gt;xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&lt;br /&gt;xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot;&lt;br /&gt;xmlns:user=&quot;urn:my-scripts&quot;&lt;br /&gt;xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot;&lt;br /&gt;xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;&lt;br /&gt;xmlns:ss=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot;&lt;br /&gt;xmlns:ms=&quot;urn:schemas-microsoft-com:xslt&quot;&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;lt;xsl:template match=&quot;NewDataSet&quot;&amp;gt;&lt;br /&gt;  &amp;lt;Workbook xmlns=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot;&lt;br /&gt;  xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot;&lt;br /&gt;  xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;&lt;br /&gt;  xmlns:ss=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot;&lt;br /&gt;  xmlns:html=&quot;http://www.w3.org/TR/REC-html40&quot;&amp;gt;&lt;br /&gt;    &amp;lt;Styles&amp;gt;&lt;br /&gt;      &amp;lt;Style ss:ID=&quot;s21&quot;&amp;gt;&lt;br /&gt;        &amp;lt;Font ss:FontName=&quot;Arial&quot; ss:Size=&quot;10&quot; ss:Bold=&quot;1&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;Alignment ss:Horizontal=&quot;Left&quot; ss:Vertical=&quot;Bottom&quot;/&amp;gt;&lt;br /&gt;      &amp;lt;/Style&amp;gt;&lt;br /&gt;      &amp;lt;Style ss:ID=&quot;s22&quot;&amp;gt;&lt;br /&gt;        &amp;lt;Font ss:FontName=&quot;MS Sans Serif&quot; ss:Size=&quot;10&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;Alignment ss:Horizontal=&quot;Left&quot; ss:Vertical=&quot;Bottom&quot;/&amp;gt;&lt;br /&gt;      &amp;lt;/Style&amp;gt;&lt;br /&gt;      &amp;lt;Style ss:ID=&quot;s25&quot;&amp;gt;&lt;br /&gt;        &amp;lt;Font ss:Color=&quot;Red&quot; ss:FontName=&quot;MS Sans Serif&quot; ss:Size=&quot;10&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;Alignment ss:Horizontal=&quot;Left&quot; ss:Vertical=&quot;Bottom&quot;/&amp;gt;&lt;br /&gt;      &amp;lt;/Style&amp;gt;&lt;br /&gt;    &amp;lt;/Styles&amp;gt;&lt;br /&gt;    &amp;lt;Worksheet&amp;gt;&lt;br /&gt;      &amp;lt;xsl:attribute name=&quot;ss:Name&quot;&amp;gt;Employees List&amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;      &amp;lt;Table&amp;gt;&lt;br /&gt;        &amp;lt;Column ss:Width=&quot;50&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;Column ss:Width=&quot;50&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;Column ss:Width=&quot;30&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;Column ss:Width=&quot;90&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;xsl:apply-templates select=&quot;NewDataSet&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;Row&amp;gt;&lt;br /&gt;          &amp;lt;Cell ss:StyleID=&quot;s21&quot;&amp;gt;&lt;br /&gt;            &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;Name&amp;lt;/Data&amp;gt;&lt;br /&gt;          &amp;lt;/Cell&amp;gt;&lt;br /&gt;          &amp;lt;Cell ss:StyleID=&quot;s21&quot;&amp;gt;&lt;br /&gt;            &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;Employee ID&amp;lt;/Data&amp;gt;&lt;br /&gt;          &amp;lt;/Cell&amp;gt;&lt;br /&gt;          &amp;lt;Cell ss:StyleID=&quot;s21&quot;&amp;gt;&lt;br /&gt;            &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;Age&amp;lt;/Data&amp;gt;&lt;br /&gt;          &amp;lt;/Cell&amp;gt;&lt;br /&gt;          &amp;lt;Cell ss:StyleID=&quot;s21&quot;&amp;gt;&lt;br /&gt;            &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;Location&amp;lt;/Data&amp;gt;&lt;br /&gt;          &amp;lt;/Cell&amp;gt;&lt;br /&gt;          &amp;lt;Cell ss:StyleID=&quot;s21&quot;&amp;gt;&lt;br /&gt;            &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;Designation&amp;lt;/Data&amp;gt;&lt;br /&gt;          &amp;lt;/Cell&amp;gt;&lt;br /&gt;        &amp;lt;/Row&amp;gt;&lt;br /&gt;        &amp;lt;xsl:for-each select=&quot;Employees&quot;&amp;gt;&lt;br /&gt;          &amp;lt;Row&amp;gt;&lt;br /&gt;            &amp;lt;Cell ss:StyleID=&quot;s22&quot;&amp;gt;&lt;br /&gt;              &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;&lt;br /&gt;                &amp;lt;xsl:value-of select=&quot;EmpID&quot;/&amp;gt;&lt;br /&gt;              &amp;lt;/Data&amp;gt;&lt;br /&gt;            &amp;lt;/Cell&amp;gt;&lt;br /&gt;            &amp;lt;Cell ss:StyleID=&quot;s22&quot;&amp;gt;&lt;br /&gt;              &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;&lt;br /&gt;                &amp;lt;xsl:value-of select=&quot;EmpName&quot;/&amp;gt;&lt;br /&gt;              &amp;lt;/Data&amp;gt;&lt;br /&gt;            &amp;lt;/Cell&amp;gt;&lt;br /&gt;            &amp;lt;Cell ss:StyleID=&quot;s22&quot;&amp;gt;&lt;br /&gt;              &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;&lt;br /&gt;                &amp;lt;xsl:value-of select=&quot;Age&quot;/&amp;gt;&lt;br /&gt;              &amp;lt;/Data&amp;gt;&lt;br /&gt;            &amp;lt;/Cell&amp;gt;&lt;br /&gt;            &amp;lt;Cell ss:StyleID=&quot;s22&quot;&amp;gt;&lt;br /&gt;              &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;&lt;br /&gt;                &amp;lt;xsl:value-of select=&quot;Location&quot;/&amp;gt;&lt;br /&gt;              &amp;lt;/Data&amp;gt;&lt;br /&gt;            &amp;lt;/Cell&amp;gt;&lt;br /&gt;            &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;              &amp;lt;xsl:when test=&quot;Designation=&#39;PM&#39;&quot;&amp;gt;&lt;br /&gt;                &amp;lt;Cell ss:StyleID=&quot;s25&quot;&amp;gt;&lt;br /&gt;                  &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;&lt;br /&gt;                    &amp;lt;xsl:value-of select=&quot;Designation&quot;/&amp;gt;&lt;br /&gt;                  &amp;lt;/Data&amp;gt;&lt;br /&gt;                &amp;lt;/Cell&amp;gt;&lt;br /&gt;              &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;              &amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;                &amp;lt;Cell ss:StyleID=&quot;s22&quot;&amp;gt;&lt;br /&gt;                  &amp;lt;Data ss:Type=&quot;String&quot;&amp;gt;&lt;br /&gt;                    &amp;lt;xsl:value-of select=&quot;Designation&quot;/&amp;gt;&lt;br /&gt;                  &amp;lt;/Data&amp;gt;&lt;br /&gt;                &amp;lt;/Cell&amp;gt;&lt;br /&gt;              &amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;            &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;          &amp;lt;/Row&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:for-each&amp;gt;&lt;br /&gt;      &amp;lt;/Table&amp;gt;&lt;br /&gt;    &amp;lt;/Worksheet&amp;gt;&lt;br /&gt;  &amp;lt;/Workbook&amp;gt;&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/7298680999987011328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/format-excel-file-using-xslt.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7298680999987011328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7298680999987011328'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/format-excel-file-using-xslt.html' title='Format Excel file using XSLT, XslCompiledTransform'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-2199200389707818929</id><published>2010-10-13T23:35:00.000-07:00</published><updated>2010-12-07T00:49:45.401-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Browse Dialog Box"/><category scheme="http://www.blogger.com/atom/ns#" term="Disable"/><category scheme="http://www.blogger.com/atom/ns#" term="Disable Save/Open Button Download Dialog box"/><title type='text'>Disable Save/Open Button in ASP.NET Download Dialog box</title><content type='html'>Code Behind&lt;br /&gt;&lt;br /&gt;protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;      {&lt;br /&gt;          Response.Clear();&lt;br /&gt;          Response.Charset = &quot;&quot;;&lt;br /&gt;          Response.Cache.SetCacheability(HttpCacheability.NoCache);&lt;br /&gt;          Response.ContentType = &quot;application/vnd.ms-excel&quot;;&lt;br /&gt;          Response.AddHeader(&quot;content-disposition&quot;, &quot;attachment;filename=sample.xls&quot;);&lt;br /&gt;          Response.Write(&quot;Hello World&quot;);&lt;br /&gt;          Response.End();&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;HTML Page&lt;br /&gt;&lt;br /&gt;To disable Save button, write this meta tag&lt;br /&gt;&amp;lt;head runat=&quot;server&quot;&amp;gt;&lt;br /&gt;  &amp;lt;meta name=&quot;DownloadOptions&quot; content=&quot;nosave&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt;To disable Open button, write this meta tag&lt;br /&gt;&amp;lt;head runat=&quot;server&quot;&amp;gt;&lt;br /&gt;  &amp;lt;meta name=&quot;DownloadOptions&quot; content=&quot;noopen&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/2199200389707818929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/disable-saveopen-button-in-aspnet.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2199200389707818929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2199200389707818929'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/disable-saveopen-button-in-aspnet.html' title='Disable Save/Open Button in ASP.NET Download Dialog box'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-6759377411666789511</id><published>2010-10-08T02:48:00.000-07:00</published><updated>2010-10-08T02:55:45.790-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DataKey"/><category scheme="http://www.blogger.com/atom/ns#" term="GridView"/><category scheme="http://www.blogger.com/atom/ns#" term="RowCommand Event"/><title type='text'>DataKey from a GridView RowCommand Event</title><content type='html'>Method to get DataKey from a GridView RowCommand Event&lt;br /&gt;&lt;br /&gt;protected void grdEmployees_RowCommand(object sender, GridViewCommandEventArgs e)&lt;br /&gt;      {&lt;br /&gt;          if (e.CommandName == &quot;Select&quot;)&lt;br /&gt;          {&lt;br /&gt;              GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;&lt;br /&gt;              int index = row.RowIndex;&lt;br /&gt;              int employeeID = Convert.ToInt32(grdEmployees.DataKeys[index].Value);&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;For this eg: There should be GridView Control with a TemplateField and that should contain a Linkbutton with CommandName=&quot;Select&quot;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/6759377411666789511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/method-to-get-datakey-from-gridview.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/6759377411666789511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/6759377411666789511'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/method-to-get-datakey-from-gridview.html' title='DataKey from a GridView RowCommand Event'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-8512454705215570750</id><published>2010-10-08T02:42:00.000-07:00</published><updated>2010-10-08T02:43:43.158-07:00</updated><title type='text'>SQL Query to Get SP and Text from DB</title><content type='html'>SELECT  sysobjects.name, syscomments.text&lt;br /&gt;FROM    sysobjects JOIN    syscomments ON   &lt;br /&gt;sysobjects.id = syscomments.id&lt;br /&gt;WHERE   xtype=&#39;P&#39;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/8512454705215570750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/sql-query-to-get-sp-and-text-from-db.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/8512454705215570750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/8512454705215570750'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/sql-query-to-get-sp-and-text-from-db.html' title='SQL Query to Get SP and Text from DB'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-8832991646363109454</id><published>2010-10-08T02:32:00.000-07:00</published><updated>2010-11-02T02:10:04.681-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#.net"/><category scheme="http://www.blogger.com/atom/ns#" term="Event Logging"/><category scheme="http://www.blogger.com/atom/ns#" term="Write to Event Viewer"/><title type='text'>Write to Event Viewer</title><content type='html'>/// &amp;lt;summary&amp;gt;&lt;br /&gt;/// Method to write Errors to Event viewer&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;/// &amp;lt;param name=&quot;message&quot;&amp;gt;message&amp;lt;/param&amp;gt;&lt;br /&gt;static void WriteToEventViewer(string message)&lt;br /&gt;     {&lt;br /&gt;         string sSource = &quot;Sample&quot;;&lt;br /&gt;         string sLog = &quot;MyApplication&quot;;&lt;br /&gt;&lt;br /&gt;         if (!EventLog.SourceExists(sSource))&lt;br /&gt;{&lt;br /&gt;             EventLog.CreateEventSource(sSource, sLog);&lt;br /&gt;}&lt;br /&gt;         EventLog.WriteEntry(sSource, message,&lt;br /&gt;&lt;br /&gt;EventLogEntryType.Error);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;for more information refer this&lt;br /&gt;http://msdn.microsoft.com/en-us/library/xzwc042w.aspx</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/8832991646363109454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/method-to-write-errors-to-event-viewer.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/8832991646363109454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/8832991646363109454'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/method-to-write-errors-to-event-viewer.html' title='Write to Event Viewer'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-2590330004333487775</id><published>2010-10-08T02:22:00.000-07:00</published><updated>2010-10-08T02:26:58.509-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Client IP address"/><title type='text'>Get Client Machine IP Address</title><content type='html'>/// &amp;lt;summary&amp;gt;&lt;br /&gt; /// Method to get Client IP number&lt;br /&gt; /// &amp;lt;/summary&amp;gt;&lt;br /&gt; /// &amp;lt;returns&amp;gt;IP Address&amp;lt;/returns&amp;gt;&lt;br /&gt; private string GetIPNumber()&lt;br /&gt; {&lt;br /&gt;     return Request.UserHostAddress;&lt;br /&gt; }</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/2590330004333487775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/get-client-machine-ip-address.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2590330004333487775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2590330004333487775'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/10/get-client-machine-ip-address.html' title='Get Client Machine IP Address'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-7197774861590199650</id><published>2010-07-09T04:54:00.000-07:00</published><updated>2010-07-09T05:16:27.866-07:00</updated><title type='text'>Dynamic SQL Query Building</title><content type='html'>Create SQL Table&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[Employee](&lt;br /&gt;[ID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[Name] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[Address] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[Phone] [varchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[Pin] [int] NULL,&lt;br /&gt;CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED&lt;br /&gt;(&lt;br /&gt;[ID] ASC&lt;br /&gt;)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;&lt;br /&gt;Insert Data in to Employee Table&lt;br /&gt;&lt;br /&gt;INSERT INTO Employee([Name],[Address],[Phone],[Pin])VALUES(&#39;Sabu&#39;,&#39;Cochin&#39;,&#39;9876543210&#39;,682030)&lt;br /&gt;INSERT INTO Employee([Name],[Address],[Phone],[Pin])VALUES(&#39;Arun&#39;,&#39;TVM&#39;,&#39;9876543210&#39;,789456)&lt;br /&gt;INSERT INTO Employee([Name],[Address],[Phone],[Pin])VALUES(&#39;Rahul&#39;,&#39;BGLR&#39;,&#39;1472583690&#39;,456782)&lt;br /&gt;INSERT INTO Employee([Name],[Address],[Phone],[Pin])VALUES(&#39;Ann&#39;,&#39;DELHI&#39;,&#39;1234566985&#39;,256314)&lt;br /&gt;INSERT INTO Employee([Name],[Address],[Phone],[Pin])VALUES(&#39;Vipin&#39;,&#39;Cochin&#39;,&#39;5852369641&#39;,682020)&lt;br /&gt;&lt;br /&gt;Procedure for searching for Employees&lt;br /&gt;---------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;set ANSI_NULLS ON&lt;br /&gt;set QUOTED_IDENTIFIER ON&lt;br /&gt;go&lt;br /&gt;CREATE PROCEDURE pr_SearchEmployee&lt;br /&gt;-- Add the parameters for the stored procedure here&lt;br /&gt;@EmployeeName varchar(20)&lt;br /&gt;,@EmployeeAddress nvarchar(50)&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;-- SET NOCOUNT ON added to prevent extra result sets from&lt;br /&gt;-- interfering with SELECT statements.&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;-- Insert statements for procedure here&lt;br /&gt;DECLARE @searchQuery varchar(300)&lt;br /&gt;SET @searchQuery = &#39;SELECT [ID]&lt;br /&gt;,[Name]&lt;br /&gt;,[Address]&lt;br /&gt;,[Phone]&lt;br /&gt;,[Pin]&lt;br /&gt;FROM Employee WHERE &#39;&lt;br /&gt;IF len(@EmployeeName) &gt; 0&lt;br /&gt;BEGIN&lt;br /&gt;SET @searchQuery = @searchQuery + &#39;[Name] LIKE &#39; + char(39) + &#39;%&#39; + @EmployeeName + &#39;%&#39; + char(39)&lt;br /&gt;END&lt;br /&gt;ELSE IF len(@EmployeeAddress) &gt; 0&lt;br /&gt;BEGIN&lt;br /&gt;SET @searchQuery = @searchQuery + &#39;[Address] LIKE &#39; + char(39) + &#39;%&#39; + @EmployeeAddress + &#39;%&#39; + char(39)&lt;br /&gt;END&lt;br /&gt;EXEC (@searchQuery)&lt;br /&gt;END&lt;br /&gt;---------------------------------------------------------------------------&lt;br /&gt;Execute Procedure&lt;br /&gt; EXEC pr_SearchEmployee &#39;&#39;,&#39;Cochin&#39;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/7197774861590199650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/07/dynamic-sql-query-building.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7197774861590199650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7197774861590199650'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/07/dynamic-sql-query-building.html' title='Dynamic SQL Query Building'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-5011821363978751821</id><published>2010-06-02T00:56:00.000-07:00</published><updated>2010-06-02T01:10:00.808-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Embed"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Media Player"/><title type='text'>Embed Windows Mediaplayer in a Web Page</title><content type='html'>&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;HTML&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;HEAD&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;TITLE&amp;gt;Embed Media player&amp;lt;/TITLE&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;/HEAD&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;BODY&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;OBJECT id=&quot;media1&quot; CLASSID=&quot;CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6&quot; type=&quot;application/x-oleobject&quot;   width=&quot;300&quot; height=&quot;300&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM NAME=&quot;URL&quot; VALUE=&quot;intro.wmv&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM NAME=&quot;ENABLED&quot; VALUE=&quot;True&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM NAME=&quot;AUTOSTART&quot; VALUE=&quot;False&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM name=&quot;PLAYCOUNT&quot; value=&quot;2&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM name=&quot;VOLUME&quot; value=&quot;50&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM NAME=&quot;MUTE&quot; VALUE=&quot;False&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM NAME=&quot;FULLSCREEN&quot; VALUE=&quot;FALSE&quot;&amp;gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;PARAM name=&quot;UIMODE&quot; value=&quot;full&quot;&amp;gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;/OBJECT&amp;gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;/BODY&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;&amp;lt;/HTML&amp;gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/5011821363978751821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/06/embed-windows-mediaplayer-in-web-page.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5011821363978751821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/5011821363978751821'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/06/embed-windows-mediaplayer-in-web-page.html' title='Embed Windows Mediaplayer in a Web Page'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-7331772157725681577</id><published>2010-02-22T20:18:00.000-08:00</published><updated>2010-02-28T21:22:34.852-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Anonymous"/><category scheme="http://www.blogger.com/atom/ns#" term="Anonymous Method"/><category scheme="http://www.blogger.com/atom/ns#" term="Named"/><category scheme="http://www.blogger.com/atom/ns#" term="Named Method"/><title type='text'>Anonymous Methods Vs Named Methods</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;create a console application in c#.net and copy this&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;namespace ConsoleApplication1&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;//Declaring a delegate&lt;br /&gt;delegate void Display(String text);&lt;br /&gt;&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;//Anonymous method&lt;br /&gt;Display d = delegate(String s)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(s + &quot;Anonymous method&quot;);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;//Calling anonymous method&lt;br /&gt;d(&quot;I am calling &quot;);&lt;br /&gt;&lt;br /&gt;d = new Display(Program.Foo);&lt;br /&gt;&lt;br /&gt;//Calling named method&lt;br /&gt;d(&quot;I am calling &quot;);&lt;br /&gt;&lt;br /&gt;Console.ReadLine();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/// Named method&lt;br /&gt;public static void Foo(String text)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(text + &quot;Named Method.&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You cannot use a &quot;ref&quot; or &quot;out&quot; variable inside an anonymous method.&lt;br /&gt;If you are using a variable that is declared outside the anonymous method is called &lt;span&gt;&quot;outer&quot;            or &quot;captured&quot; variables of the anonymous method.&lt;br /&gt;&lt;br /&gt;eg:-&lt;br /&gt;string outside = &quot;I am captured&quot;;&lt;br /&gt;//Anonymous method&lt;br /&gt;Display d = delegate(String s)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(s + &quot;Anonymous method &quot; + outside);&lt;br /&gt;};&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/7331772157725681577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/anonymous-methods-vs-named-methods.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7331772157725681577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7331772157725681577'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/anonymous-methods-vs-named-methods.html' title='Anonymous Methods Vs Named Methods'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-2342770799194749466</id><published>2010-02-21T21:18:00.000-08:00</published><updated>2010-06-11T01:17:55.475-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Iteration in XSLT"/><category scheme="http://www.blogger.com/atom/ns#" term="XSLT"/><category scheme="http://www.blogger.com/atom/ns#" term="XSLT Conditional Looping"/><title type='text'>Conditional Loop In XSLT</title><content type='html'>&lt;span style=&quot;color:#000000;&quot;&gt;XML &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;--------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;&lt;br /&gt;&amp;lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;test.xslt&quot; ?&amp;gt;&lt;br /&gt;&amp;lt;Root&amp;gt;&lt;br /&gt;&amp;lt;Title&amp;gt;Looping function example&amp;lt;/Title&amp;gt;&lt;br /&gt;&amp;lt;Limit&amp;gt;10&amp;lt;/Limit&amp;gt;&lt;br /&gt;&amp;lt;/Root&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;XSLT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;----------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:stylesheet version=&quot;1.0&quot;xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; &amp;gt;&lt;br /&gt;&amp;lt;xsl:template match=&quot;/&quot;&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;html&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;head&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;title&amp;gt; &amp;lt;xsl:value-of select=&quot;Root/Title&quot; /&amp;gt; &amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/head&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;!--CALLING FUNCTION --&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;h3&amp;gt;&amp;lt;xsl:value-of select=&quot;Root/Title&quot; /&amp;gt;&amp;lt;/h3&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:call-template name=&quot;LoopingFunc&quot;&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:with-param name=&quot;limit&quot; select=&quot;Root/Limit&quot; /&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/xsl:call-template&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/body&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;!--LOOPING FUNCTION --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:template name=&quot;LoopingFunc&quot;&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:param name=&quot;limit&quot;/&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:if test=&quot;$limit &amp;gt; 0&quot;&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:value-of select=&quot;$limit&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/h5&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:call-template name=&quot;LoopingFunc&quot;&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;xsl:with-param name=&quot;limit&quot; select=&quot;$limit - 1&quot; /&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/xsl:call-template&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/xsl:if&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Out put&lt;br /&gt;----------------&lt;br /&gt;Looping function example&lt;br /&gt;10&lt;br /&gt;9&lt;br /&gt;8&lt;br /&gt;7&lt;br /&gt;6&lt;br /&gt;5&lt;br /&gt;4&lt;br /&gt;3&lt;br /&gt;2&lt;br /&gt;1</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/2342770799194749466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/conditional-loop-in-xslt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2342770799194749466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2342770799194749466'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/conditional-loop-in-xslt.html' title='Conditional Loop In XSLT'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-1839531817606574515</id><published>2010-02-18T20:56:00.001-08:00</published><updated>2010-02-28T21:24:43.421-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="binding"/><category scheme="http://www.blogger.com/atom/ns#" term="Control Binding"/><title type='text'>Enable and Disable a Control by Binding to another Control</title><content type='html'>&lt;span id=&quot;ctl00_ContentPlaceHolder1_lblDescription&quot;  style=&quot;color:DarkBlue;&quot;&gt;&lt;br /&gt;You can Set the Enable Property of a control by binding that control to another control.&lt;br /&gt;&lt;br /&gt;How to Achieve this?&lt;br /&gt;&lt;br /&gt;See this code snippet.This is a Windows Application Project with C# language.&lt;br /&gt;To test this code you should have a TextBox named &quot;txtName&quot; and a CheckBox named &quot;chk&quot;.&lt;br /&gt;&lt;br /&gt;In the form load event write this&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span id=&quot;ctl00_ContentPlaceHolder1_lblDescription&quot;  style=&quot;color:DarkBlue;&quot;&gt;&lt;pre&gt;txtName.DataBindings.Add(&quot;Enabled&quot;, chk, &quot;Checked&quot;);&lt;/pre&gt;&lt;/span&gt;&lt;span id=&quot;ctl00_ContentPlaceHolder1_lblDescription&quot;  style=&quot;color:DarkBlue;&quot;&gt;Execute code and check and uncheck CheckBox. So that you can find the TextBox&#39;s property changing.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/1839531817606574515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/enable-and-disable-control-by-binding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/1839531817606574515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/1839531817606574515'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/enable-and-disable-control-by-binding.html' title='Enable and Disable a Control by Binding to another Control'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-1919365819071428286</id><published>2010-02-18T20:52:00.000-08:00</published><updated>2010-02-28T21:25:52.399-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BinaryFormatter"/><category scheme="http://www.blogger.com/atom/ns#" term="Serialization"/><category scheme="http://www.blogger.com/atom/ns#" term="Serialize Objects"/><title type='text'>Serialize Objects using BinaryFormatter</title><content type='html'>&lt;span id=&quot;ctl00_ContentPlaceHolder1_lblDescription&quot;  style=&quot;color:DarkBlue;&quot;&gt;Serialization is the process of converting an object to a format that can be transfer through a network or can be save to a location(file or DB).&lt;br /&gt;The serialized data contains the object&#39;s informations like Version,Culture,PublicKeyToken,Type etc.&lt;br /&gt;Deserialization is the reverse process of serialization, that is reconstructing the object from the serialized state to its original state.&lt;br /&gt;&lt;br /&gt;Here is an eg:&lt;br /&gt;&lt;br /&gt;A class &quot;Employee&quot; and its collection class &quot;Employees&quot;. I marked these classes as Serializable with the [Serializable] attribute.&lt;br /&gt;and also i am using BinaryFormatter to Serialize and Deserialize this object.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void button1_Click&lt;br /&gt;(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Employees emps = new Employees();&lt;br /&gt;emps.Add(new Employee(&quot;1&quot;, &quot;Sabu&quot;));&lt;br /&gt;emps.Add(new Employee(&quot;2&quot;, &quot;Litson&quot;));&lt;br /&gt;&lt;br /&gt;String pth = @&quot;E:\Test.dat&quot;;&lt;br /&gt;Serialize(emps, pth);&lt;br /&gt;Deserialize(pth);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void Serialize(Employees emps, String filename)&lt;br /&gt;{&lt;br /&gt;System.IO.Stream ms = File.OpenWrite(filename);&lt;br /&gt;System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =&lt;br /&gt;new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();&lt;br /&gt;formatter.Serialize(ms, emps);&lt;br /&gt;ms.Flush();&lt;br /&gt;ms.Close();&lt;br /&gt;ms.Dispose();&lt;br /&gt;formatter = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void Deserialize(String filename)&lt;br /&gt;{&lt;br /&gt;System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =&lt;br /&gt;new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();&lt;br /&gt;object obj = formatter.Deserialize(File.Open(filename, FileMode.Open));&lt;br /&gt;Employees emps = (Employees)obj;&lt;br /&gt;MessageBox.Show(emps[1].Name);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Classes&lt;br /&gt;[Serializable]&lt;br /&gt;public class Employee&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public Employee(String id, String name)&lt;br /&gt;{&lt;br /&gt;_ID = id;&lt;br /&gt;_Name = name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private String _ID = String.Empty;&lt;br /&gt;private String _Name = String.Empty;&lt;br /&gt;&lt;br /&gt;public String ID&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _ID;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_ID = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String Name&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _Name;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_Name = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[Serializable]&lt;br /&gt;public class Employees:CollectionBase&lt;br /&gt;{&lt;br /&gt;//Constructor&lt;br /&gt;public Employees()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Add function&lt;br /&gt;public void Add(T objT)&lt;br /&gt;{&lt;br /&gt;this.List.Add(objT);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Indexer&lt;br /&gt;public T this[int i]&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return (T) this.List[i];&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;this.List.Add(value);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/1919365819071428286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/serialize-objects-using-binaryformatter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/1919365819071428286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/1919365819071428286'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/serialize-objects-using-binaryformatter.html' title='Serialize Objects using BinaryFormatter'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-2713275981721549235</id><published>2010-02-18T20:26:00.000-08:00</published><updated>2010-02-28T21:26:42.842-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Serialization"/><category scheme="http://www.blogger.com/atom/ns#" term="Serialize Objects"/><category scheme="http://www.blogger.com/atom/ns#" term="XmlSerializer class"/><title type='text'>Serialize Objects using XmlSerializer class</title><content type='html'>&lt;span id=&quot;ctl00_ContentPlaceHolder1_lblDescription&quot;  style=&quot;color:DarkBlue;&quot;&gt;&lt;yoono-highlight onmouseout=&quot;___yoonoLink.onYoonoOut(this)&quot; onmouseover=&quot;___yoonoLink.onYoonoOver(event,this)&quot; onclick=&quot;___yoonoLink.onYoonoClick(this)&quot; keywords=&quot;Xml&quot; class=&quot;yoono-link-hover yoono-link-active-link&quot;&gt;Xml&lt;/yoono-highlight&gt; Serialization&lt;br /&gt;--------------------------------------&lt;br /&gt;Serialization is the process of converting an object to a format that can be transfer through a network or can be save to a location(file or DB).&lt;br /&gt;The serialized data contains the object&#39;s informations like Version,Culture,PublicKeyToken,Type etc.&lt;br /&gt;Deserialization is the reverse process of serialization, that is reconstructing the object from the serialized state to its original state.&lt;br /&gt;&lt;br /&gt;Here is an eg:&lt;br /&gt;&lt;br /&gt;A class &quot;Employee&quot; and its collection class &quot;Employees&quot;. I marked these classes as Serializable with the [Serializable] attribute.&lt;br /&gt;and also i am using XmlSerializer class to Serialize and Deserialize this object.&lt;br /&gt;&lt;br /&gt;private void button1_Click&lt;br /&gt;(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Employees&lt;employee&gt; emps = new Employees&lt;employee&gt;();&lt;br /&gt;emps.Add(new Employee(&quot;1&quot;, &quot;Sabu&quot;));&lt;br /&gt;emps.Add(new Employee(&quot;2&quot;, &quot;Litson&quot;));&lt;br /&gt;&lt;br /&gt;String pth = @&quot;E:\Test.xml&quot;;&lt;br /&gt;XmlSerialize(emps, pth);&lt;br /&gt;XmlDeserialize(pth);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void XmlSerialize(Employees&lt;employee&gt; emps, String filename)&lt;br /&gt;{&lt;br /&gt;System.IO.Stream ms = File.OpenWrite(filename);&lt;br /&gt;System.Xml.Serialization.XmlSerializer xmlSer = new System.Xml.Serialization.XmlSerializer(emps.GetType());&lt;br /&gt;xmlSer.Serialize(ms, emps);&lt;br /&gt;ms.Flush();&lt;br /&gt;ms.Close();&lt;br /&gt;ms.Dispose();&lt;br /&gt;xmlSer = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void XmlDeserialize(String filename)&lt;br /&gt;{&lt;br /&gt;System.Xml.Serialization.XmlSerializer xmlSer =&lt;br /&gt;new System.Xml.Serialization.XmlSerializer(typeof(Employees&lt;employee&gt;));&lt;br /&gt;FileStream fs = new FileStream(filename, FileMode.Open);&lt;br /&gt;object obj = xmlSer.Deserialize(fs);&lt;br /&gt;Employees&lt;employee&gt; emps = (Employees&lt;employee&gt;)obj;&lt;br /&gt;MessageBox.Show(emps[1].Name);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Classes&lt;br /&gt;&lt;br /&gt;[Serializable]&lt;br /&gt;public class Employee&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public Employee(String id, String name)&lt;br /&gt;{&lt;br /&gt;_ID = id;&lt;br /&gt;_Name = name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private String _ID = String.Empty;&lt;br /&gt;private String _Name = String.Empty;&lt;br /&gt;&lt;br /&gt;public String ID&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _ID;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_ID = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String Name&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _Name;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_Name = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[Serializable]&lt;br /&gt;public class Employees&lt;t&gt;:CollectionBase&lt;br /&gt;{&lt;br /&gt;//Constructor&lt;br /&gt;public Employees()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Add function&lt;br /&gt;public void Add(T objT)&lt;br /&gt;{&lt;br /&gt;this.List.Add(objT);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Indexer&lt;br /&gt;public T this[int i]&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return (T) this.List[i];&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;this.List.Add(value);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/t&gt;&lt;/employee&gt;&lt;/employee&gt;&lt;/employee&gt;&lt;/employee&gt;&lt;/employee&gt;&lt;/employee&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/2713275981721549235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/serialize-objects-using-xmlserializer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2713275981721549235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2713275981721549235'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/serialize-objects-using-xmlserializer.html' title='Serialize Objects using XmlSerializer class'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-2569705814022388077</id><published>2010-02-18T20:18:00.000-08:00</published><updated>2010-02-28T21:27:36.651-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="column styles"/><category scheme="http://www.blogger.com/atom/ns#" term="DataGridView"/><category scheme="http://www.blogger.com/atom/ns#" term="Dynamic columns"/><title type='text'>DataGridView - Dynamically Seting up column styles</title><content type='html'>#region Person Class&lt;br /&gt;public class Person&lt;br /&gt;{&lt;br /&gt;private String _code = String.Empty;&lt;br /&gt;private String _name = String.Empty;&lt;br /&gt;private String _address = String.Empty;&lt;br /&gt;private String _faxNo = String.Empty;&lt;br /&gt;private String _contactPerson = String.Empty;&lt;br /&gt;&lt;br /&gt;public int ID&lt;br /&gt;{&lt;br /&gt;get { return _id; }&lt;br /&gt;set { _id = value; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String Code&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _code;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_code = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String Name&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _name;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_name = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String Address&lt;br /&gt;{&lt;br /&gt;get { return _address; }&lt;br /&gt;set { _address = value; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String FaxNo&lt;br /&gt;{&lt;br /&gt;get { return _faxNo; }&lt;br /&gt;set { _faxNo = value; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String ContactPerson&lt;br /&gt;{&lt;br /&gt;get { return _contactPerson; }&lt;br /&gt;set { _contactPerson = value; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void Fill(DataRow drPerson)&lt;br /&gt;{&lt;br /&gt;if (drPerson != null)&lt;br /&gt;{&lt;br /&gt;this.Code =&lt;br /&gt;drPerson[&quot;code&quot;].ToString();&lt;br /&gt;this.Name =&lt;br /&gt;drPerson[&quot;name&quot;].ToString();&lt;br /&gt;this.Address =&lt;br /&gt;drPerson[&quot;address&quot;].ToString();&lt;br /&gt;this.FaxNo =&lt;br /&gt;drPerson[&quot;faxno&quot;].ToString();&lt;br /&gt;this.ContactPerson =&lt;br /&gt;drPerson[&quot;contactperson&quot;].ToString();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public List GetAllPersons()&lt;br /&gt;{&lt;br /&gt;List persons = new List();&lt;br /&gt;DataTable dtPerson = new DataTable();&lt;br /&gt;&lt;br /&gt;using (SqlConnection conn = DataHelper.GetConnection())&lt;br /&gt;{&lt;br /&gt;using (SqlCommand comm = new SqlCommand())&lt;br /&gt;{&lt;br /&gt;comm.Connection = conn;&lt;br /&gt;String getQuery = &quot;SELECT id,code,name,address,&quot; +&lt;br /&gt;&quot;faxno,contactperson FROM person ORDER BY name&quot;;&lt;br /&gt;comm.CommandText = getQuery;&lt;br /&gt;comm.CommandType = CommandType.Text;&lt;br /&gt;SqlDataAdapter da = new SqlDataAdapter();&lt;br /&gt;daConst.SelectCommand = comm;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;connConst.Open();&lt;br /&gt;daConst.Fill(dtPerson);&lt;br /&gt;&lt;br /&gt;if (dtPerson.Rows.Count &lt; 1)&lt;br /&gt;{&lt;br /&gt;foreach (DataRow drPerson in dtPerson.Rows)&lt;br /&gt;{&lt;br /&gt;Person objPerson = new Person();&lt;br /&gt;objPerson.Fill(drPerson);&lt;br /&gt;persons.Add(objClient);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{ throw ex; }&lt;br /&gt;finally&lt;br /&gt;{ comm.Dispose(); }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return persons;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#region &quot;Form Events&quot;&lt;br /&gt;private void FormView_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;SetupGrid();&lt;br /&gt;dgvPersons.DataSource = Person.GetAllPersons();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#region SetupGrid&lt;br /&gt;///&lt;br /&gt;/// SetupGrid&lt;br /&gt;///&lt;br /&gt;private void SetupGrid()&lt;br /&gt;{&lt;br /&gt;DataGridViewTextBoxColumn colCode = new DataGridViewTextBoxColumn();&lt;br /&gt;colCode.HeaderText = &quot;Code&quot;;&lt;br /&gt;colCode.DataPropertyName = &quot;Code&quot;;&lt;br /&gt;colCode.Width = 50;&lt;br /&gt;&lt;br /&gt;DataGridViewTextBoxColumn colName = new DataGridViewTextBoxColumn();&lt;br /&gt;colName.HeaderText = &quot;Name&quot;;&lt;br /&gt;&lt;br /&gt;colName.DataPropertyName = &quot;Name&quot;;&lt;br /&gt;colName.Width = 250;&lt;br /&gt;&lt;br /&gt;DataGridViewTextBoxColumn colAddressDet = new DataGridViewTextBoxColumn();&lt;br /&gt;colAddressDet.HeaderText = &quot;Address&quot;;&lt;br /&gt;colAddressDet.DataPropertyName = &quot;Address&quot;;&lt;br /&gt;colAddressDet.Width = 300;&lt;br /&gt;&lt;br /&gt;DataGridViewTextBoxColumn colFaxNo = new DataGridViewTextBoxColumn();&lt;br /&gt;colFaxNo.HeaderText = &quot;FaxNo&quot;;&lt;br /&gt;colFaxNo.DataPropertyName = &quot;FaxNo&quot;;&lt;br /&gt;colFaxNo.Width = 50;&lt;br /&gt;&lt;br /&gt;DataGridViewTextBoxColumn colContactPerson = new DataGridViewTextBoxColumn();&lt;br /&gt;colContactPerson.HeaderText = &quot;ContactPerson&quot;;&lt;br /&gt;colContactPerson.DataPropertyName = &quot;ContactPerson&quot;;&lt;br /&gt;colContactPerson.Width = 100;&lt;br /&gt;&lt;br /&gt;DataGridViewButtonColumn colEdit = new DataGridViewButtonColumn();&lt;br /&gt;colEdit.HeaderText = &quot;Edit&quot;;&lt;br /&gt;colEdit.FlatStyle = FlatStyle.Flat;&lt;br /&gt;colEdit.UseColumnTextForButtonValue = true;&lt;br /&gt;colEdit.Text = &quot;Edit&quot;;&lt;br /&gt;colEdit.Width = 50;&lt;br /&gt;&lt;br /&gt;DataGridViewButtonColumn colDelete = new DataGridViewButtonColumn();&lt;br /&gt;colDelete.HeaderText = &quot;Delete&quot;;&lt;br /&gt;colDelete.FlatStyle = FlatStyle.Flat;&lt;br /&gt;colDelete.UseColumnTextForButtonValue = true;&lt;br /&gt;colDelete.Text = &quot;Delete&quot;;&lt;br /&gt;colDelete.Width = 60;&lt;br /&gt;&lt;br /&gt;dgvClients.Columns.AddRange(new DataGridViewColumn[]&lt;br /&gt;{ colCode, colName, colAddressDet, colFaxNo,&lt;br /&gt;colContactPerson, colEdit, colDelete });&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;#endregion</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/2569705814022388077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/datagridview-dynamically-seting-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2569705814022388077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/2569705814022388077'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/datagridview-dynamically-seting-up.html' title='DataGridView - Dynamically Seting up column styles'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-125057672529050012</id><published>2010-02-18T20:03:00.000-08:00</published><updated>2011-05-09T06:02:16.954-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arraylist"/><category scheme="http://www.blogger.com/atom/ns#" term="Generic list"/><title type='text'>Difference between Arraylist and Generic List</title><content type='html'>//Arraylist - Arraylist accept values as object&lt;br /&gt;//So i can give any type of data in to that.&lt;br /&gt;//Here in this eg: an arraylist object accepting&lt;br /&gt;//values like String,int,decimal, char and a custom object&lt;br /&gt;&lt;br /&gt;Employee emp = new Employee(&quot;2&quot;, &quot;Litson&quot;);&lt;br /&gt;ArrayList arr = new ArrayList();&lt;br /&gt;arr.Add(&quot;Sabu&quot;);&lt;br /&gt;arr.Add(234);&lt;br /&gt;arr.Add(45.236);&lt;br /&gt;arr.Add(emp);&lt;br /&gt;arr.Add(&#39;s&#39;);&lt;br /&gt;//This process is known as boxing&lt;br /&gt;&lt;br /&gt;//To get inserted vales from arraylist we have to specify the index.&lt;br /&gt;//So it will return that values as object.&lt;br /&gt;//we have to cast that value from object to its original type.&lt;br /&gt;&lt;br /&gt;String name = (String)arr[0];&lt;br /&gt;int num = (int)arr[1];&lt;br /&gt;decimal dec = (decimal)arr[2];&lt;br /&gt;Employee em = (Employee)arr[3];&lt;br /&gt;char c = (char)arr[4];&lt;br /&gt;//This process that is converting from object to its original type is known as unboxing&lt;br /&gt;//------------------------------------------------------------------------------------&lt;br /&gt;//Generic List&lt;br /&gt;//List&lt;&gt;&lt;br /&gt;&lt;br /&gt;//Main advantage of Generic List is we can specify the type of data we are going to insert in to&lt;br /&gt;//List. So that we can avoid boxing and unboxing&lt;br /&gt;//Eg:&lt;br /&gt;List&amp;lt;string&amp;gt; strLst = new List&amp;lt;string&amp;gt;();&lt;br /&gt;strLst.Add(&quot;Sabu&quot;);//Here List accepting values as String only&lt;br /&gt;strLst.Add(&quot;Litson&quot;);&lt;br /&gt;strLst.Add(&quot;Sabu&quot;);&lt;br /&gt;strLst.Add(&quot;Sabu&quot;);&lt;br /&gt;&lt;br /&gt;List&amp;lt;int&amp;gt; intLst = new List&amp;lt;int&amp;gt;();&lt;br /&gt;intLst.Add(12);//Here List accepting values as int only&lt;br /&gt;intLst.Add(14);&lt;br /&gt;intLst.Add(89);&lt;br /&gt;intLst.Add(34);&lt;br /&gt;&lt;br /&gt;List&amp;lt;decimal&amp;gt; decLst = new List&amp;lt;decimal&amp;gt;();&lt;br /&gt;decLst.Add(2.5M);//Here List accepting values as deciaml only&lt;br /&gt;decLst.Add(14.4587m);&lt;br /&gt;decLst.Add(89.258m);&lt;br /&gt;decLst.Add(34.159m);&lt;br /&gt;&lt;br /&gt;List&amp;lt;Employee&amp;gt; empLst = new List&amp;lt;Employee&amp;gt;();&lt;br /&gt;empLst.Add(new Employee(&quot;1&quot;, &quot;Sabu&quot;));//Here List accepting Employee Objects only&lt;br /&gt;empLst.Add(new Employee(&quot;2&quot;, &quot;Mahesh&quot;));&lt;br /&gt;empLst.Add(new Employee(&quot;3&quot;, &quot;Sajith&quot;));&lt;br /&gt;empLst.Add(new Employee(&quot;4&quot;, &quot;Binu&quot;));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//To get values from Generic List&lt;br /&gt;String nme = strLst[0]; //No need of casting&lt;br /&gt;int nm = intLst[0];&lt;br /&gt;Decimal decVal = decLst[0];&lt;br /&gt;Employee empVal = empLst[0];&lt;/employee&gt;&lt;/employee&gt;&lt;/decimal&gt;&lt;/decimal&gt;&lt;/int&gt;&lt;/int&gt;&lt;/string&gt;&lt;/string&gt;</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/125057672529050012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/arraylist-arraylist-accept-values-as.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/125057672529050012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/125057672529050012'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/arraylist-arraylist-accept-values-as.html' title='Difference between Arraylist and Generic List'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6416251170702933799.post-7154712143859726060</id><published>2010-02-18T19:53:00.000-08:00</published><updated>2010-02-28T21:00:30.650-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DataContext Class Update"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ TO SQL UPDATE"/><title type='text'>Linq to SQL Update Method</title><content type='html'>//Creating Employee DataContext object&lt;br /&gt;EmployeeDBDataContext db = new EmployeeDBDataContext();&lt;br /&gt;&lt;br /&gt;//Selecting an employee to update his name and address&lt;br /&gt;emp = db.Employees.Single(e =&gt; e.EmpID == 1);&lt;br /&gt;emp.Name = &quot;Sabu&quot;;&lt;br /&gt;emp.Address = &quot;Cochin&quot;;&lt;br /&gt;&lt;br /&gt;//Submitting changes&lt;br /&gt;db.SubmitChanges();</content><link rel='replies' type='application/atom+xml' href='http://mytipsfordotnet.blogspot.com/feeds/7154712143859726060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/linq-to-sql-update-method.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7154712143859726060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6416251170702933799/posts/default/7154712143859726060'/><link rel='alternate' type='text/html' href='http://mytipsfordotnet.blogspot.com/2010/02/linq-to-sql-update-method.html' title='Linq to SQL Update Method'/><author><name>Sabu Alex</name><uri>http://www.blogger.com/profile/16920661575671959051</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8YpZ7xkiLdUGYpZdHjinLFxhDbaklJOiYNg3OM1HAGm-P25VdoniMPQZCV6QIxz72QyKvQPM5B3J3HhTqiltRthzqqQgIUfhr9_LAj1jDa_-XZp_B_SNhXSUB9OJLuPC_e38P6LgHHzTl8gMW7-ioMWOPA1lOE3Y0aYnnFTmuUcgQw/s220/PXL_20230325_114153716.jpg'/></author><thr:total>1</thr:total></entry></feed>