<?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-1169934094086970873</id><updated>2024-11-05T18:58:00.993-08:00</updated><category term="C Sharp Programming"/><category term="ADO.Net"/><category term="Windows Forms"/><category term="asp.net"/><category term=".Net Framework"/><category term="MVC"/><category term="Advanced .Net Programming"/><category term="Assemby in .Net"/><category term="DataGridView"/><category term="Nework Programming"/><category term="Performance Issues"/><category term="VB.Net Programming"/><category term=".Net Remoting"/><category term="Audio And Video Playback"/><category term="Diagonostics"/><category term="GDI+"/><category term="LINQ"/><category term="Windows Phone Development"/><category term="message for members"/><title type='text'>DotNet Experts</title><subtitle type='html'>Solutions For .Net Programming Related Problems </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-5978893449594665715</id><published>2014-04-14T11:15:00.002-07:00</published><updated>2018-05-24T11:22:50.828-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Forms"/><title type='text'>Drag-and-Drop Operation in Windows Forms</title><content type='html'>&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: &quot;ca-pub-7299483718634296&quot;,
          enable_page_level_ads: true
     });
&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 1.167; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Drag-and-Drop Operation in Windows Forms&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;To perform drag-and-drop operations within Windows-based applications you must handle a series of events, most notably the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;DragEnter&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;DragLeave&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;, and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;DragDrop&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;events. By working with the information available in the event arguments of these events, you can easily facilitate drag-and-drop operations.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;To Start The Drag Operation&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
All drag-and-drop operations begin with dragging. The functionality to enable data to be collected when dragging begins is implemented in the&amp;nbsp;DoDragDrop&amp;nbsp;method.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
In the following example, the&amp;nbsp;MouseDown&amp;nbsp;event is used to start the drag operation because it is the most intuitive (most drag-and-drop actions begin with the mouse button being depressed). However, remember that any event could be used to initiate a drag-and-drop procedure.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;In the&amp;nbsp;MouseDown&amp;nbsp;event for the control where the drag will begin, use the&amp;nbsp;&lt;strong&gt;DoDragDrop&lt;/strong&gt;&amp;nbsp;method to set the data to be dragged and the allowed effect dragging will have. For more information, see&amp;nbsp;Data&amp;nbsp;and&amp;nbsp;AllowedEffect.&lt;/li&gt;
&lt;li&gt;The following example shows how to initiate a drag operation. The control where the drag begins is a&amp;nbsp;Button&amp;nbsp;control, the data being dragged is the string representing the&amp;nbsp;Text&amp;nbsp;property of the&amp;nbsp;Button&amp;nbsp;control, and the allowed effects are either copying or moving.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; button1_MouseDown(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, 
System.Windows.Forms.MouseEventArgs e)
{
   button1.DoDragDrop(button1.Text, DragDropEffects.Copy | 
      DragDropEffects.Move);
}&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;h3 class=&quot;procedureSubHeading&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.231em; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
To perform a drop&lt;/h3&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;Once you have begun dragging data from a location on a Windows Form or control, you will naturally want to drop it somewhere. The cursor will change when it crosses an area of a form or control that is correctly configured for dropping data. Any area within a Windows Form or control can be made to accept dropped data by setting the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;AllowDrop&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;property and handling the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;DragEnter&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;DragDrop&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;events.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Set the&amp;nbsp;AllowDrop&amp;nbsp;property to true.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
In the&amp;nbsp;&lt;strong&gt;DragEnter&lt;/strong&gt;&amp;nbsp;event for the control where the drop will occur, ensure that the data being dragged is of an acceptable type (in this case,&amp;nbsp;Text). The code then sets the effect that will happen when the drop occurs to a value in the&amp;nbsp;DragDropEffects&amp;nbsp;enumeration.&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 18px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; textBox1_DragEnter(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, 
System.Windows.Forms.DragEventArgs e)
{
   &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (e.Data.GetDataPresent(DataFormats.Text)) 
      e.Effect = DragDropEffects.Copy;
   &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;
      e.Effect = DragDropEffects.None;
}&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
In the&amp;nbsp;DragDrop&amp;nbsp;event for the control where the drop will occur, use the&amp;nbsp;GetData&amp;nbsp;method to retrieve the data being dragged.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
In the example below, a&amp;nbsp;TextBox&amp;nbsp;control is the control being dragged to (where the drop will occur). The code sets the&amp;nbsp;Text&amp;nbsp;property of the&amp;nbsp;TextBox&amp;nbsp;control equal to the data being dragged.&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; textBox1_DragDrop(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, 
System.Windows.Forms.DragEventArgs e)
{
   textBox1.Text = e.Data.GetData(DataFormats.Text).ToString();
}&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/5978893449594665715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/04/drag-and-drop-operation-in-windows-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5978893449594665715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5978893449594665715'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/04/drag-and-drop-operation-in-windows-forms.html' title='Drag-and-Drop Operation in Windows Forms'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-5174235829312499396</id><published>2014-04-12T13:08:00.000-07:00</published><updated>2014-04-12T13:08:20.354-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Advanced .Net Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><title type='text'>The Concept Of Generics In .Net With C# And VB.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;The Detailed Description Of Generics In .Net&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;h2 class=&quot;dtH1&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Generic Type :&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;A generic type is a type that uses generic type parameters. For example, the type LinkedList&lt;k&gt;, defined as:&lt;/k&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;C#&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;public class LinkedList&lt;k&gt;
{...}&lt;/k&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;b&gt;VB.Net&lt;/b&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;Public Class LinkedList(Of K, T)
    ...
End Class&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;h2 class=&quot;dtH1&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Generic Type Parameter :&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;A generic type parameter is the place holder a generic type uses. For example, the generic type LinkedList&lt;k&gt;, defined as:&lt;/k&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;C#&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;public class LinkedList&lt;k&gt;
{...}&lt;/k&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;b&gt;VB.Net&lt;/b&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;Public Class LinkedList(Of K, T)
    ...
End Class&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;Some more description about generics:&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding-bottom: 5px; padding-top: 5px; text-align: left; white-space: normal;&quot;&gt;
Constructed Type :&amp;nbsp;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;A constructed type is any generic type that has at least one type argument.&lt;/span&gt;&lt;/div&gt;
&lt;h2 class=&quot;dtH1&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open Constructed Type :&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;A open constructed type is any generic type that which contains at least one type parameter used as a type argument&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;Closed Constructed Type :&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; white-space: normal;&quot;&gt;A closed constructed type is a generic type that which contains no type parameters as type arguments.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;h2 class=&quot;dtH1&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.769em; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
Initialize a Generic Type Parameter&lt;/h2&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;When declaring a generic type, you need to specify the types that will replace the type parameters in the declaration. These are known as type arguments to the generic type. Type arguments are simply types.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;You need to specify which types to use for K, the list&#39;s key, and T, the data items stored in the list. You specify the types in two places: when declaring the list&#39;s variable and when instantiating it:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;b&gt;C#&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;LinkedList&lt;int string=&quot;&quot;&gt; list = new LinkedList&lt;int string=&quot;&quot;&gt;();
list.AddHead(123,&quot;ABC&quot;);&lt;/int&gt;&lt;/int&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;b&gt;VB.Net&lt;/b&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;Dim list As New LinkedList(Of Integer, String)
list.AddHead(123, &quot;ABC&quot;)&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;h2 class=&quot;dtH1&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Constraints in Generics:&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
Constraints allow additional contextual information to be added to the type parameters of generic types. The constraints limit the range of types that are allowed to be used as type arguments, but at the same time, they add information about those type parameters. Constraints ensure that the type arguments specified by the client code are compatible with the generic type parameters the generic type itself uses. Meaning, constraints prevent the client from specifying types as type arguments that do not offer the methods, properties, or members of the generic type parameters that the generic type relies upon.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
After applying a constraint you get IntelliSense reflecting the constraints when using the generic type parameter, such as suggesting methods or members from the base type.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
Derivation constraint indicates to the compiler that the generic type parameters derives from a base type such an interface or a particular base class.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
You can provide constraints for every generic type parameter that your class declares. You can have a base class constraint, meaning, stipulating that the generic type parameter derives from a particular base class:&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
However, you can only use one base class at most in a constraint because neither C#, Visual Basic or managed C++ support multiple inheritance of implementation. Obviously, the base class you constrain to cannot be a sealed class, and the compiler enforces that. In addition, you cannot constrain System.Delegate or System.Array as a base class.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
You can constrain both a base class and one or more interfaces, but the base class must appear first in the derivation constraint list.You can combine the default constructor constraint with derivation constraints, provided the default constructor constraint appears last in the constraint list.&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/5174235829312499396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/04/the-concept-of-generics-in-net-with-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5174235829312499396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5174235829312499396'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/04/the-concept-of-generics-in-net-with-c.html' title='The Concept Of Generics In .Net With C# And VB.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-8246757487693372899</id><published>2014-04-12T12:43:00.000-07:00</published><updated>2014-04-12T12:43:24.113-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADO.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="Advanced .Net Programming"/><title type='text'>Auto-Generate Wrapper Classes for Stored Procedures Using the AutoSproc Tool</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Auto-Generate Wrapper Classes for Stored Procedures Using the AutoSproc Tool&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;The essence of the idea behind&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;AutoSproc&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;is for the developer to define methods on an interface that correspond to the stored procedures that exist in a database. These interface methods are abstract at the time of program compilation, but receive an implementation at runtime from a code generation assembly the client program references, named AutoSproc.dll. At the heart of this assembly there is a publicly callable static (shared) method called&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;SprocFactory.CreateInstance()&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;. A key parameter that must be passed when making a call to this method is type information for an interface. The primary function of this method is to dynamically fabricate a class that implements the designated interface and to return an instance of that class to the caller. As an example, consider the following stored procedure definition:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;CREATE PROCEDURE upAddTwoNumbers
@a int,
@b int,
@result int output
AS
select @result = @a+@b&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Given this definition, the interface would be defined in Visual Basic .NET as follows:&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Public Interface IMath
    Inherits ISprocBase
    Function upAddTwoNumbers(ByVal a As Integer, _
      ByVal b As Integer, _
      ByRef result As Integer) As Integer
End Interface&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;ISprocBase&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;adds three properties to your deriving interface:&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Public Interface ISprocBase
   Property Connection() as IDbConnection
   Property AutoClose () as Boolean
   Property Transaction () as IDbTransaction
End Interface&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The Connection property is the means by which one passes the database connection to the code generated class at runtime.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;div style=&quot;line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; text-align: left; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ISprocBase.AutoClose Property&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; text-align: left; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;The&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;AutoClose&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;property on the interface can be used to toggle this feature on and off dynamically at runtime during the lifetime of the application.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; text-align: left; white-space: normal;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 class=&quot;dtH1&quot; style=&quot;font-weight: normal; line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;ISprocBase.Transaction Property&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;line-height: 17.549999237060547px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;It is often the case that a local transaction is used to protect multiple operations carried out against a database. To facilitate this, a transaction property is defined on the base interface. Its usage is fairly straightforward: Use the database connection to begin the transaction (&lt;b&gt;IDbConnection.BeginTransaction()&lt;/b&gt;), feed the transaction to the transaction property on the code generated class, make one or more transacted stored procedure calls then either commit / abort or rollback the transaction (&lt;b&gt;IDbTransaction.Commit()&lt;/b&gt;/&amp;nbsp;&lt;b&gt;Abort()&lt;/b&gt;&amp;nbsp;/&amp;nbsp;&lt;b&gt;Rollback()&lt;/b&gt;).&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;It is important to note that if&amp;nbsp;&lt;b&gt;AutoClose&lt;/b&gt;&amp;nbsp;is set to true, then the transaction will exhibit potentially undesirable auto commit behavior because closing the database connection implicitly attempts to commit the transaction. It is recommended that if the Transaction property is being used then&amp;nbsp;&lt;b&gt;AutoClose&lt;/b&gt;&amp;nbsp;is set to false.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;h2 class=&quot;dtH1&quot; style=&quot;font-weight: normal; line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;SprocFactory.CreateInstance() Method Overloads&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;There are four overloaded&amp;nbsp;&lt;b&gt;SprocFactory.CreateInstance()&lt;/b&gt;&amp;nbsp;methods offered, only one of which is strictly necessary (the second one). The other three are offered as a convenience to the developer for seeding&amp;nbsp;&lt;b&gt;Connection&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;AutoClose&lt;/b&gt;&amp;nbsp;properties at creation time. It should be noted that overloads not providing an&amp;nbsp;&lt;b&gt;AutoClose&lt;/b&gt;&amp;nbsp;parameter (the first and third) will configure it to true by default.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding-bottom: 15px;&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px; white-space: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Public Shared Function CreateInstance (ByVal itf as Type, _
ByVal prov as DBProvider) _
as Object&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;2.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Public Shared Function CreateInstance (ByVal itf as Type, _
ByVal prov as DBProvider, _
                  autoClose as Boolean) as Object &lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;3&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Public Shared Function CreateInstance (ByVal itf as Type, _
ByVal conn as IDbConnection) _
as Object&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;4.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Public Shared Function CreateInstance (ByVal itf as Type, _
ByVal conn as IDbConnection, _
                  ByVal autoClose as Boolean) _
                  as Object&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;The&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;DBProvider&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;enumeration is the means by which the user configures the code generation layer to emit an implementation. For this release, only SQL Server and OleDb managed providers are available. If the user elects to use the third or fourth&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;CreateInstance()&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;method then the database provider type is inferred by the code generation layer from the&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;IDbConnection&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;parameter, thus making a&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;DBProvider&lt;/b&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;enumeration parameter unnecessary.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/8246757487693372899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/04/auto-generate-wrapper-classes-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8246757487693372899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8246757487693372899'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/04/auto-generate-wrapper-classes-for.html' title='Auto-Generate Wrapper Classes for Stored Procedures Using the AutoSproc Tool'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-8123193794048553301</id><published>2014-03-30T10:04:00.001-07:00</published><updated>2014-03-30T10:04:46.944-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="GDI+"/><title type='text'>Drawing in .Net With GDI+</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-size: x-large;&quot;&gt;Drawing in .Net With GDI+&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;GDI+ is an application programming interface (API) that forms the subsystem of the Microsoft Windows XP operating system.&amp;nbsp;GDI+&amp;nbsp;is responsible for displaying information on screens and printers. As its name suggests, GDI+ is the successor to GDI, the Graphics Device Interface included with earlier versions of Windows.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;The GDI+&amp;nbsp;API is exposed through a set of classes deployed as managed code. This set of classes is called the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;parameter&quot; style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; font-style: italic; line-height: 18px;&quot;&gt;managed class interface&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;to GDI+. The following namespaces make up the managed class interface:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;b&gt;System.Drawing:&lt;/b&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;The&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;Graphics&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;class provides methods for drawing to the display device. Classes such as&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;Rectangle&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;Point&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;encapsulate GDI+ primitives. The&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;Pen&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;class is used to draw lines and curves, while classes derived from the abstract class&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;Brush&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;are used to fill the interiors of shapes.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;Classes&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;Bitmap&lt;/b&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes. A&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;i&gt;Bitmap&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;is an object used to work with images defined by pixel data.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Brush&lt;/b&gt;:&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Defines objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Brushes:&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Brushes for all the standard colors. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;BufferedGraphics:&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Provides a graphics buffer for double buffering.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;BufferedGraphicsContext:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Provides methods for creating graphics buffers that can be used for double buffering.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;ColorConverter:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts colors from one data type to another. Access this class through the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;ColorTranslator :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Translates colors to and from GDI+&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;i&gt;Color&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;structures. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Font :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;FontConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;i&gt;Font&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;objects from one data type to another.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;FontConverter&lt;span xmlns=&quot;&quot;&gt;.&lt;/span&gt;FontNameConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Infrastructure.&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;i&gt;FontConverter&lt;span xmlns=&quot;&quot;&gt;.&lt;/span&gt;FontNameConverter&lt;/i&gt;&amp;nbsp;is a type converter that is used to convert a font name to and from various other representations.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;FontConverter&lt;span xmlns=&quot;&quot;&gt;.&lt;/span&gt;FontUnitConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Infrastructure.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts font units to and from other unit types.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;FontFamily :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Graphics :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Encapsulates a GDI+ drawing surface. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Icon :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Represents a Windows icon, which is a small bitmap image used to represent an object. Icons can be thought of as transparent bitmaps, although their size is determined by the system.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;IconConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts an&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Icon&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object from one data type to another. Access this class through the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Image :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;An abstract base class that provides functionality for the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Bitmap&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Metafile&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;descended classes.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;ImageAnimator :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Animates an image that has time-based frames.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;ImageConverter:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;ImageConverter&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;is a class that can be used to convert&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Image&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;objects from one data type to another. Access this class through the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;ImageFormatConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;ImageFormatConverter&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;is a class that can be used to convert&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;ImageFormat&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;objects from one data type to another. Access this class through the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Pen:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Defines an object used to draw lines and curves. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Pens :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Pens for all the standard colors. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;PointConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Point&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object from one data type to another. Access this class through the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;PointConverter :&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Point&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object from one data type to another. Access this class through the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;RectangleConverter:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts rectangles from one data type to another. Access this class through the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;Region :&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SizeConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;The&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;SizeConverter&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;class is used to convert from one data type to another. Access this class through the&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TypeDescriptor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SizeFConverter :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Converts&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;SizeF&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;objects from one type to another.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SolidBrush :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Defines a brush of a single color. Brushes are used to fill graphics shapes, such as rectangles, ellipses, pies, polygons, and paths. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;StringFormat :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SystemBrushes :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Each property of the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;SystemBrushes&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;class is a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;SolidBrush&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;that is the color of a Windows display element.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SystemColors :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Each property of the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;SystemColors&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;class is a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;structure that is the color of a Windows display element.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SystemFonts :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Specifies the fonts used to display text in Windows display elements.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SystemIcons :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Each property of the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;SystemIcons&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;class is an&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Icon&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object for Windows system-wide icons. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;SystemPens :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Each property of the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;SystemPens&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;class is a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Pen&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;that is the color of a Windows display element and that has a width of 1 pixel.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;TextureBrush :&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Each property of the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;TextureBrush&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;class is a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Brush&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&amp;nbsp;object that uses an image to fill the interior of a shape. This class cannot be inherited.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;&lt;b&gt;ToolboxBitmapAttribute :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;Allows you to specify an icon to represent a control in a container, such as the Microsoft Visual Studio Form Designer.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/8123193794048553301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/drawing-in-net-with-gdi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8123193794048553301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8123193794048553301'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/drawing-in-net-with-gdi.html' title='Drawing in .Net With GDI+'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-3571446548902677895</id><published>2014-03-30T09:01:00.000-07:00</published><updated>2014-03-30T09:01:02.234-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DataGridView"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Forms"/><title type='text'>Formating in DataGridView</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;To Set Alternating Row Styles for the Windows Forms DataGridView Control&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;With the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;DataGridView&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;control, you can specify complete style information for alternating rows. This enables you use style characteristics like foreground color and font, in addition to background color, to differentiate alternating rows.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.RowsDefaultCellStyle.BackColor = Color.Bisque;
&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor =
    Color.Beige;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;div style=&quot;line-height: 1.167; margin-top: 0px; text-align: left; white-space: normal;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.167; margin-top: 0px; text-align: left; white-space: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; text-align: left; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;To specify the font used by DataGridView cells&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; text-align: left; white-space: normal;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Set the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;Font&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;property of a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;DataGridViewCellStyle&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: #d9ead3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.DefaultCellStyle.Font = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Font(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Verdana&quot;&lt;/span&gt;, 15);&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;h3 class=&quot;procedureSubHeading&quot; style=&quot;font-size: 1.231em; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;To specify the foreground and background colors of DataGridView cells&lt;/span&gt;&lt;/h3&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;Set the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;ForeColor&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;BackColor&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;properties of a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;DataGridViewCellStyle&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.DefaultCellStyle.ForeColor = Color.Blue;
&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.DefaultCellStyle.BackColor = Color.Beige;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;h3 class=&quot;procedureSubHeading&quot; style=&quot;line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;To specify the foreground and background colors of selected DataGridView cells&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;ul style=&quot;font-size: 13px; line-height: 17.549999237060547px; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;Set the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;SelectionForeColor&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;SelectionBackColor&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;properties of a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&lt;i&gt;DataGridViewCellStyle&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.DefaultCellStyle.SelectionForeColor = Color.Yellow;
&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.DefaultCellStyle.SelectionBackColor = Color.Black;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;div style=&quot;line-height: 1.167; margin-top: 0px; text-align: left; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;Use the Row Template to Customize Rows in the Windows Forms DataGridView Control&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
The&amp;nbsp;&lt;i&gt;DataGridView&lt;/i&gt;&amp;nbsp;control uses the row template as a basis for all rows that it adds to the control either through data binding or when you call theDataGridViewRowCollection&lt;span xmlns=&quot;&quot;&gt;.&lt;/span&gt;Add&amp;nbsp;method without specifying an existing row to use.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
The row template gives you greater control over the appearance and behavior of rows than the&amp;nbsp;&lt;i&gt;RowsDefaultCellStyle&amp;nbsp;&lt;/i&gt;property provides. With the row template, you can set &lt;i&gt;anyDataGridViewRow&amp;nbsp;&lt;/i&gt;properties, including&amp;nbsp;&lt;i&gt;DefaultCellStyle&lt;/i&gt;.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
There are some situations where you must use the row template to achieve a particular effect. For example, row height information cannot be stored in a&amp;nbsp;&lt;i&gt;DataGridViewCellStyle&lt;/i&gt;, so you must use a row template to change the default height used by all rows. The row template is also useful when you create your own classes derived from&amp;nbsp;&lt;i&gt;DataGridViewRow&amp;nbsp;&lt;/i&gt;and you want your custom type used when new rows are added to the control.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Set properties on the object retrieved from the&amp;nbsp;&lt;i&gt;DataGridView&lt;/i&gt;&lt;span xmlns=&quot;&quot;&gt;.&lt;/span&gt;&lt;i&gt;RowTemplate&amp;nbsp;&lt;/i&gt;property.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;DataGridViewRow row = &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.RowTemplate;
row.DefaultCellStyle.BackColor = Color.Bisque;
row.Height = 35;
row.MinimumHeight = 20;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.167; margin-top: 0px; text-align: left; white-space: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/3571446548902677895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/formating-in-datagridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/3571446548902677895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/3571446548902677895'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/formating-in-datagridview.html' title='Formating in DataGridView'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-965536206051839941</id><published>2014-03-30T08:37:00.001-07:00</published><updated>2014-03-30T09:01:41.598-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DataGridView"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Forms"/><title type='text'>Change the Border and Gridline Styles in the Windows Forms DataGridView Control</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;line-height: 1.167; margin-top: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;To Change the Border and Gridline Styles in the Windows Forms DataGridView Control&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;With the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;DataGridView&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;control, you can customize the appearance of the control&#39;s border and gridlines to improve the user experience. You can modify the gridline color and the control border style in addition to the border styles for the cells within the control. You can also apply different cell border styles for ordinary cells, row header cells, and column header cells.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3 class=&quot;procedureSubHeading&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.231em; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px;&quot;&gt;
To change the gridline color programmatically&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Set the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;GridColor&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;property.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.GridColor = Color.Blue;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;h3 class=&quot;procedureSubHeading&quot; style=&quot;line-height: 17.549999237060547px; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;To change the border style of the entire DataGridView control programmatically&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;ul style=&quot;font-family: Consolas, Courier, monospace !important; line-height: 17.549999237060547px; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;Set the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;BorderStyle&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;property to one of the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;BorderStyle&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;enumeration values.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;h3 class=&quot;procedureSubHeading&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.231em; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px; white-space: normal;&quot;&gt;
To change the border styles for DataGridView cells programmatically&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;Set the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;CellBorderStyle&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;RowHeadersBorderStyle&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;, and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;ColumnHeadersBorderStyle&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; white-space: normal;&quot;&gt;&amp;nbsp;properties.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.CellBorderStyle =
    DataGridViewCellBorderStyle.None;
&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.RowHeadersBorderStyle =
    DataGridViewHeaderBorderStyle.Single;
&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.dataGridView1.ColumnHeadersBorderStyle =
    DataGridViewHeaderBorderStyle.Single;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/965536206051839941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/change-border-and-gridline-styles-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/965536206051839941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/965536206051839941'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/change-border-and-gridline-styles-in.html' title='Change the Border and Gridline Styles in the Windows Forms DataGridView Control'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-660224955410584128</id><published>2014-03-30T04:43:00.002-07:00</published><updated>2014-03-30T04:43:46.491-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net Framework"/><title type='text'>Configure an Application to Support .NET Framework 4 or 4.5</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Application Configuration to Support .Net Framework 4 or 4.5&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px;&quot;&gt;All apps that host the common language runtime (CLR) need to start, or&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;parameter&quot; style=&quot;color: #2a2a2a; font-style: italic; line-height: 18px;&quot;&gt;activate&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px;&quot;&gt;, the CLR in order to run managed code. Typically, a .NET Framework app runs on the version of the CLR that it was built on, but you can change this behavior for desktop apps by using an application configuration file (sometimes referred to as an app.config file). However, you cannot change the default activation behavior for Windows Store apps or Windows Phone apps by using an application configuration file.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style=&quot;margin: 0px; padding-bottom: 5px; padding-top: 5px; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;To configure your app to run on the .NET Framework 4 or 4.5&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Add or locate the configuration file for the .NET Framework project. The configuration file for an app is in the same directory and has the same name as the app, but has a .config extension. For example, for an app named MyExecutable.exe, the application configuration file is named MyExecutable.exe.config.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;To add a configuration file, on the Visual Studio menu bar, choose&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;Project&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;Add New Item&lt;/span&gt;. Choose&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;General&lt;/span&gt;&amp;nbsp;from the left pane, and then choose&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;Configuration File&lt;/span&gt;. Name the configuration file&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;appName&lt;/span&gt;.exe.config. These menu choices are not available for Windows Store app or Windows phone app projects, because you cannot change the activation policy on those platforms.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Add the&amp;nbsp;&lt;supportedruntime&gt;&amp;nbsp;element as follows to the application configuration file:&lt;/supportedruntime&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17.549999237060547px;&quot;&gt;&lt;configuration&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;  &lt;startup&gt;
    &lt;supportedruntime version=&quot;&amp;lt;version&amp;gt;&quot;&gt;
  &lt;/supportedruntime&gt;&lt;/startup&gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;li&gt;&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
where&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;&lt;version&gt;&lt;/version&gt;&lt;/span&gt;&amp;nbsp;specifies the CLR version that aligns with the .NET Framework version that your app supports. Use the following strings:&lt;/div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
.NET Framework 1.0: &quot;v1.0.3705&quot;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
.NET Framework 1.1: &quot;v1.1.4322&quot;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
.NET Framework 2.0, 3.0, and 3.5: &quot;v2.0.50727&quot;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
.NET Framework 4 and 4.5 (including point releases such as 4.5.1): &quot;v4.0&quot;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
You can add multiple&amp;nbsp;&lt;supportedruntime&gt;&amp;nbsp;elements, listed in order of preference, to specify support for multiple versions of the .NET Framework.&lt;/supportedruntime&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/660224955410584128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/configure-application-to-support-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/660224955410584128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/660224955410584128'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/configure-application-to-support-net.html' title='Configure an Application to Support .NET Framework 4 or 4.5'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-4633224666254867344</id><published>2014-03-29T20:04:00.000-07:00</published><updated>2014-03-29T20:04:12.700-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net Programming"/><title type='text'>Introduction to Yield Statement in VB.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;The Yield Statement in VB.Net&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Yield&lt;/span&gt;&amp;nbsp;statement returns one element of a collection at a time. The&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Yield&lt;/span&gt;&amp;nbsp;statement is included in an iterator function or&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Get&lt;/span&gt;&amp;nbsp;accessor, which perform custom iterations over a collection.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;You consume an iterator function by using a&amp;nbsp;For Each...Next Statement (Visual Basic)&amp;nbsp;or a LINQ query. Each iteration of the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;For Each&lt;/span&gt;&amp;nbsp;loop calls the iterator function. When a&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Yield&lt;/span&gt;&amp;nbsp;statement is reached in the iterator function,&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;expression&lt;/span&gt;&amp;nbsp;is returned, and the current location in code is retained. Execution is restarted from that location the next time that the iterator function is called.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;An implicit conversion must exist from the type of&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;expression&lt;/span&gt;&amp;nbsp;in the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Yield&lt;/span&gt;&amp;nbsp;statement to the return type of the iterator.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;You can use an&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Exit Function&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Return&lt;/span&gt;&amp;nbsp;statement to end the iteration.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&quot;Yield&quot; is not a reserved word and has special meaning only when it is used in an&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Iterator&lt;/span&gt;&amp;nbsp;function or&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Get&lt;/span&gt;&amp;nbsp;accessor.&lt;/span&gt;&lt;/div&gt;
&lt;h3 class=&quot;subHeading&quot; style=&quot;font-size: 1.231em; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Iterator Functions and Get Accessors&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;subsection&quot; style=&quot;line-height: 17.549999237060547px;&quot;&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The declaration of an iterator function or&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Get&lt;/span&gt;&amp;nbsp;accessor must meet the following requirements:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-size: 13px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;It must include an&amp;nbsp;Iterator&amp;nbsp;modifier.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The return type must be&amp;nbsp;IEnumerable,&amp;nbsp;IEnumerable&lt;span xmlns=&quot;&quot;&gt;&amp;lt;&lt;/span&gt;T&lt;span xmlns=&quot;&quot;&gt;&amp;gt;&lt;/span&gt;,&amp;nbsp;IEnumerator, or&amp;nbsp;IEnumerator&lt;span xmlns=&quot;&quot;&gt;&amp;lt;&lt;/span&gt;T&lt;span xmlns=&quot;&quot;&gt;&amp;gt;&lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;It cannot have any&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;ByRef&lt;/span&gt;&amp;nbsp;parameters.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;An iterator function can be an anonymous function. For more information&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;An iterator function cannot occur in an event, instance constructor, static constructor, or static destructor.&lt;/span&gt;&lt;/div&gt;
&lt;h3 class=&quot;subHeading&quot; style=&quot;font-size: 1.231em; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Exception Handling in Yield&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;subsection&quot;&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Yield&lt;/span&gt;&amp;nbsp;statement can be inside a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Try&lt;/span&gt;&amp;nbsp;block of a&amp;nbsp;Try...Catch...Finally Statement (Visual Basic). A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Try&lt;/span&gt;&amp;nbsp;block that has a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Yield&lt;/span&gt;&amp;nbsp;statement can have&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Catch&lt;/span&gt;&amp;nbsp;blocks, and can have a&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Finally&lt;/span&gt;&amp;nbsp;block.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Yield&lt;/span&gt;&amp;nbsp;statement cannot be inside a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Catch&lt;/span&gt;&amp;nbsp;block or a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Finally&lt;/span&gt;&amp;nbsp;block.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;If the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;For Each&lt;/span&gt;&amp;nbsp;body (outside of the iterator function) throws an exception, a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Catch&lt;/span&gt;&amp;nbsp;block in the iterator function is not executed, but a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Finally&lt;/span&gt;&amp;nbsp;block in the iterator function is executed. A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Catch&lt;/span&gt;&amp;nbsp;block inside an iterator function catches only exceptions that occur inside the iterator function.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;b&gt;An Example:&lt;/b&gt;&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; Main()
    &lt;span style=&quot;color: blue;&quot;&gt;For&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Each&lt;/span&gt; number &lt;span style=&quot;color: blue;&quot;&gt;In&lt;/span&gt; Power(2, 8)
        Console.Write(number &amp;amp; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot; &quot;&lt;/span&gt;)
    &lt;span style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;&amp;nbsp;
    &lt;span style=&quot;color: green;&quot;&gt;&#39; Output: 2 4 8 16 32 64 128 256&lt;/span&gt;
    Console.ReadKey()
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&amp;nbsp;

&lt;span style=&quot;color: blue;&quot;&gt;Private&lt;/span&gt; Iterator &lt;span style=&quot;color: blue;&quot;&gt;Function&lt;/span&gt; Power(
&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; base &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Integer&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; highExponent &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Integer&lt;/span&gt;) _
&lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.Collections.Generic.IEnumerable(Of&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Integer&lt;/span&gt;)

    &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; result = 1

    &lt;span style=&quot;color: blue;&quot;&gt;For&lt;/span&gt; counter = 1 &lt;span style=&quot;color: blue;&quot;&gt;To&lt;/span&gt; highExponent
        result = result * base
        Yield result
    &lt;span style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;&amp;nbsp;
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/4633224666254867344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/introduction-to-yield-statement-in-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4633224666254867344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4633224666254867344'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/introduction-to-yield-statement-in-vbnet.html' title='Introduction to Yield Statement in VB.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-5087113859331059685</id><published>2014-03-29T19:53:00.002-07:00</published><updated>2014-03-29T19:53:28.088-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net Programming"/><title type='text'>Introduction to SyncLock Statement in VB.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;The SyncLock statement in VB.Net&lt;/b&gt;&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;SyncLock in VB.Net&lt;/b&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;statement ensures that multiple threads do not execute the statement block at the same time.&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;prevents each thread from entering the block until no other thread is executing it.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The most common use of&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;is to protect data from being updated by more than one thread simultaneously. If the statements that manipulate the data must go to completion without interruption, put them inside a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;A statement block protected by an exclusive lock is sometimes called a&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;critical section&lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Branching. You cannot branch into a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block from outside the block.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Lock Object Value. The value of&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;lockobject&lt;/span&gt;&amp;nbsp;cannot be&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Nothing&lt;/span&gt;. You must create the lock object before you use it in a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;statement.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;You cannot change the value of&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;lockobject&lt;/span&gt;&amp;nbsp;while executing a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block. The mechanism requires that the lock object remain unchanged.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;You can&#39;t use the&amp;nbsp;Await&amp;nbsp;operator in a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;How SyncLock Statement works in vb.net&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Mechanism. When a thread reaches the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;statement, it evaluates the&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;lockobject&lt;/span&gt;&amp;nbsp;expression and suspends execution until it acquires an exclusive lock on the object returned by the expression. When another thread reaches the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;statement, it does not acquire a lock until the first thread executes the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;End SyncLock&lt;/span&gt;statement.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Protected Data. If&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;lockobject&lt;/span&gt;&amp;nbsp;is a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Shared&lt;/span&gt;&amp;nbsp;variable, the exclusive lock prevents a thread in any instance of the class from executing the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block while any other thread is executing it. This protects data that is shared among all the instances.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;If&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;lockobject&lt;/span&gt;&amp;nbsp;is an instance variable (not&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Shared&lt;/span&gt;), the lock prevents a thread running in the current instance from executing the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block at the same time as another thread in the same instance. This protects data maintained by the individual instance.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Acquisition and Release. A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block behaves like a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Try...Finally&lt;/span&gt;&amp;nbsp;construction in which the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Try&lt;/span&gt;&amp;nbsp;block acquires an exclusive lock on&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;lockobject&lt;/span&gt;&amp;nbsp;and the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Finally&lt;/span&gt;block releases it. Because of this, the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block guarantees release of the lock, no matter how you exit the block. This is true even in the case of an unhandled exception.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Framework Calls. The&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;block acquires and releases the exclusive lock by calling the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Enter&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Exit&lt;/span&gt;&amp;nbsp;methods of the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Monitor&lt;/span&gt;&amp;nbsp;class in the&amp;nbsp;System.Threadingnamespace.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;he following example shows a class that maintains a simple list of messages. It holds the messages in an array and the last used element of that array in a variable. The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen;&quot;&gt;addMessage&lt;/span&gt;&amp;nbsp;procedure increments the last element and stores the new message. Those two operations are protected by the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;End SyncLock&lt;/span&gt;statements, because once the last element has been incremented, the new message must be stored before any other thread can increment the last element again.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;If the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen;&quot;&gt;simpleMessageCollection&lt;/span&gt;&amp;nbsp;class shared one list of messages among all its instances, the variables&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen;&quot;&gt;messageCollection&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen;&quot;&gt;messageseEnd&lt;/span&gt;&amp;nbsp;would be declared as&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Shared&lt;/span&gt;. In this case, the variable&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen;&quot;&gt;msgLock&lt;/span&gt;&amp;nbsp;should also be&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Shared&lt;/span&gt;, so that there would be a single lock object used by every instance.&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Class&lt;/span&gt; simpleMessageCollection
    &lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt; messagesCollection() &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt; = &lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt;(100) {}
    &lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt; messagesEnd &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Integer&lt;/span&gt; = -1
    &lt;span style=&quot;color: blue;&quot;&gt;Private&lt;/span&gt; msgLock &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Object&lt;/span&gt;&amp;nbsp;
    &lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; addMessage(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; newMsg &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt;)
        &lt;span style=&quot;color: blue;&quot;&gt;SyncLock&lt;/span&gt; msgLock
            messagesEnd += 1
            &lt;span style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; messagesEnd &amp;lt; messagesCollection.Length &lt;span style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;
                messagesCollection(messagesEnd) = newMsg
            &lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;If&lt;/span&gt;&amp;nbsp;
        &lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;SyncLock&lt;/span&gt;&amp;nbsp;
    &lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&amp;nbsp;
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Class&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/5087113859331059685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/introduction-to-synclock-statement-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5087113859331059685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5087113859331059685'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/introduction-to-synclock-statement-in.html' title='Introduction to SyncLock Statement in VB.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-6508734760070373555</id><published>2014-03-29T19:38:00.001-07:00</published><updated>2014-03-29T19:54:33.125-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><title type='text'>The using Keyword/Statement in C# and VB.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;All About using Keyword/Statement in C# and VB.Net&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; border: 0px; font-size: 15px; margin: 0px; outline: none; padding: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: verdana, geneva;&quot;&gt;I&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;n C#,&amp;nbsp;&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;using&lt;/em&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/strong&gt;Keyword&amp;nbsp; can be used in two different ways and are hence referred to differently.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; text-align: justify;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-size: 15px; margin-bottom: 10px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;As&amp;nbsp;a Directive&lt;/span&gt;&lt;u&gt;&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;In&amp;nbsp; this usage, the &quot;&lt;em style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;using&lt;/em&gt;&quot; keyword can be used to&amp;nbsp;include a namespace&amp;nbsp; in your program.(Mostly used)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-size: 15px; margin-bottom: 10px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;As a&amp;nbsp;Statement&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;Using can also be used&amp;nbsp;in&amp;nbsp;a block of code to dispose a IDisposable objects.(less used).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-size: 15px; margin-bottom: 10px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Example&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-size: 15px; margin-bottom: 10px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;A simple and straightforward&amp;nbsp; approach to connect to a database server and read data would be-&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-size: 15px; margin-bottom: 10px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; color: navy; margin: 0px; outline: none; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; color: navy; margin: 0px; outline: none; padding: 0px;&quot;&gt;SqlConnection sqlconnection = new SqlConnection(connectionString);&lt;br /&gt;&amp;nbsp; SqlDataReader reader = null;&lt;br /&gt;&amp;nbsp; SqlCommand cmd = new SqlCommand(commandString.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; color: navy; margin: 0px; outline: none; padding: 0px;&quot;&gt;sqlconnection&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; color: navy; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;sqlconnection&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; color: navy; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;.Open();&lt;br /&gt;&amp;nbsp; reader = cmd.ExecuteReader();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (reader.Read())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Do&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; reader.Close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;sqlconnection&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; color: navy; margin: 0px; outline: none; padding: 0px;&quot;&gt;.Close();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-size: 15px; margin-bottom: 10px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; color: navy; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; style=&quot;background-color: white; color: black; font-size: 15px; text-align: justify; width: 100%px;&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;
&lt;tr&gt;&lt;td&gt;&lt;div class=&quot;about&quot; style=&quot;border: 0px; margin: 0px; outline: none; padding: 5px 0px 0px; width: 590px;&quot;&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;However, the above given code may generate error.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;If any exception occurs inside while block it throws exception&amp;nbsp;the&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&amp;nbsp;connection.close()&amp;nbsp;process will not executed due to the exception.To avoid this situation, we can take the help of the try....catch... finally block&amp;nbsp;&amp;nbsp; by closing the connection inside the finally block or inside the catch block.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;div class=&quot;about&quot; style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px; width: 590px;&quot;&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&quot;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;Using&lt;/strong&gt;&quot; keyword takes the parameter of type&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;IDisposable&lt;/strong&gt;.Whenever you are using any&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;IDisposable&lt;/strong&gt;&amp;nbsp;type object you should use the &quot;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;using&lt;/strong&gt;&quot; keyword&amp;nbsp; to handle automatically when it should close or dispose. Internally using keyword calls the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;Dispose()&lt;/strong&gt;&amp;nbsp;method to dispose the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;IDisposable&lt;/strong&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;So the correct code would be :&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; color: navy; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;using(SqlConnection sqlconnection= new SqlConnection(connectionString) )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlCommand cmd = new SqlCommand(commandString, sqlconnection);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlconnection.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (SqlDataReader reader = cmd.ExecuteReader())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (reader.Read())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DO&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&amp;nbsp;In this code&amp;nbsp; if any exception occurs then dispose() will be called and connection will closed automatically.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 10px; outline: none; padding: 0px;&quot;&gt;
&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: Georgia, Times New Roman, serif; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h1 class=&quot;title&quot; style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-weight: normal; line-height: 1.167; margin-top: 0px; text-align: start;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: large;&quot;&gt;Using Statement in VB.Net&lt;/span&gt;&lt;/h1&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; text-align: start;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Sometimes your code requires an unmanaged resource, such as a file handle, a COM wrapper, or a SQL connection. A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block guarantees the disposal of one or more such resources when your code is finished with them. This makes them available for other code to use.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px; text-align: start;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Managed resources are disposed of by the .NET Framework garbage collector (GC) without any extra coding on your part. You do not need a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block for managed resources. However, you can still use a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block to force the disposal of a managed resource instead of waiting for the garbage collector.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px; text-align: start;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block has three parts: acquisition, usage, and disposal.&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px; text-align: start;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;Acquisition&lt;/span&gt;&amp;nbsp;means creating a variable and initializing it to refer to the system resource. The&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;statement can acquire one or more resources, or you can acquire exactly one resource before entering the block and supply it to the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;statement. If you supply&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;resourceexpression&lt;/span&gt;, you must acquire the resource before passing control to the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;statement.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;Usage&lt;/span&gt;&amp;nbsp;means accessing the resources and performing actions with them. The statements between&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;End Using&lt;/span&gt;&amp;nbsp;represent the usage of the resources.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;Disposal&lt;/span&gt;&amp;nbsp;means calling the&amp;nbsp;Dispose&amp;nbsp;method on the object in&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;resourcename&lt;/span&gt;. This allows the object to cleanly terminate its resources. The&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;End Using&lt;/span&gt;&amp;nbsp;statement disposes of the resources under the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block&#39;s control.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;How using statement works in VB.Net&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;A&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block behaves like a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Try&lt;/span&gt;...&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Finally&lt;/span&gt;&amp;nbsp;construction in which the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Try&lt;/span&gt;&amp;nbsp;block uses the resources and the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Finally&lt;/span&gt;&amp;nbsp;block disposes of them. Because of this, the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block guarantees disposal of the resources, no matter how you exit the block. This is true even in the case of an unhandled exception, except for a&amp;nbsp;StackOverflowException.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The scope of every resource variable acquired by the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;statement is limited to the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;block.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;If you specify more than one system resource in the&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;statement, the effect is the same as if you nested&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;blocks one within another.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;If&amp;nbsp;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;resourcename&lt;/span&gt;&amp;nbsp;is&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Nothing&lt;/span&gt;, no call to&amp;nbsp;Dispose&amp;nbsp;is made, and no exception is thrown.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: small;&quot;&gt;Example&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The following example creates a file that is named log.txt and writes two lines of text to the file. The example also reads that same file and displays the lines of text.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Because the&amp;nbsp;TextWriter&amp;nbsp;and&amp;nbsp;TextReader&amp;nbsp;classes implement the&amp;nbsp;IDisposable&amp;nbsp;interface, the code can use&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;statements to ensure that the file is correctly closed after the write and read operations.&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; WriteToFile()
    &lt;span style=&quot;color: blue;&quot;&gt;Using&lt;/span&gt; writer &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.IO.TextWriter = System.IO.File.CreateText(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;myfile.txt&quot;&lt;/span&gt;)
        writer.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;This is line one.&quot;&lt;/span&gt;)
        writer.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;This is line two.&quot;&lt;/span&gt;)
    &lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&amp;nbsp;

&lt;span style=&quot;color: blue;&quot;&gt;Private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; ReadFromFile()
    &lt;span style=&quot;color: blue;&quot;&gt;Using&lt;/span&gt; reader &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.IO.TextReader = System.IO.File.OpenText(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;log.txt&quot;&lt;/span&gt;)
        &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; line &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt;

        line = reader.ReadLine()
        &lt;span style=&quot;color: blue;&quot;&gt;Do&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Until&lt;/span&gt; line &lt;span style=&quot;color: blue;&quot;&gt;Is&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Nothing&lt;/span&gt;
            Console.WriteLine(line)
            line = reader.ReadLine()
        &lt;span style=&quot;color: blue;&quot;&gt;Loop&lt;/span&gt;&amp;nbsp;
    &lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Using&lt;/span&gt;&amp;nbsp;
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/6508734760070373555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/the-using-keywordstatement-in-c-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/6508734760070373555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/6508734760070373555'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/the-using-keywordstatement-in-c-and.html' title='The using Keyword/Statement in C# and VB.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-1742630037989646832</id><published>2014-03-27T09:12:00.000-07:00</published><updated>2014-03-27T09:12:21.367-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><title type='text'>C# Programming Fundamentals</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;C# Programming Fundamentals in Point wise Way&amp;nbsp;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
A complete program instruction is called a statement. Each statement ends with a semicolon (&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;;&lt;/span&gt;).&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
All objects, variables, and constants must have a specific type.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Most of the intrinsic types are used for working with numeric values. You will commonly use&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;int&lt;/span&gt;&amp;nbsp;for whole numbers and&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;double&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;float&lt;/span&gt;&amp;nbsp;for fractional values.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;char&lt;/span&gt;&amp;nbsp;type is used for holding a single character.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;bool&lt;/span&gt;&amp;nbsp;type can hold only the value true or false.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
A variable is an instance of a type. You initialize a variable by creating it with an assigned value.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
You can use the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;var&lt;/span&gt;&amp;nbsp;keyword to create a variable without a type, but only if you assign it immediately. The complier will determine the type of the variable from the value assigned.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
You can cast a value from one type to another as long as the compiler knows how to turn the original type into the cast-to type. If no information can be lost, you may cast from one type to another implicitly. If information may be lost, you must cast explicitly. You accomplish the cast by prefacing the variable with the name of the type you want to cast to, in parentheses.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
A constant is similar to a variable, but the value cannot be changed while the program is running. Literal constants are simply values used on their own. Symbolic constants, indicated with the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;const&lt;/span&gt;&amp;nbsp;keyword, are values with assigned names, which you use like variables, but the values cannot change.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
An enumeration is a value type that consists of a set of named constants.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
A string object holds a series of characters (such as a word or sentence). A string literal is simply text enclosed by double quotes. You can assign a string to a string variable, just as you would make any other assignment.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Extra whitespace (spaces, tabs, and newline characters) is ignored by the compiler, unless it appears within a string.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/1742630037989646832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/c-programming-fundamentals.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/1742630037989646832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/1742630037989646832'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/c-programming-fundamentals.html' title='C# Programming Fundamentals'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-5923842660554060710</id><published>2014-03-27T09:06:00.000-07:00</published><updated>2014-03-27T09:06:10.205-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><title type='text'>Introduction To The is and as Operator in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;The is and as Operator in C#&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Sometimes, however, you may not know at compile time whether an object supports a particular interface.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;The&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace; font-size: 13px; line-height: 18px;&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;operator lets us query whether an object implements an interface (or derives from a base class). The form of the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace; font-size: 13px; line-height: 18px;&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;operator is:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;if ( expression is type )&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;is&lt;/span&gt;&amp;nbsp;operator evaluates true if the&amp;nbsp;&lt;em class=&quot;replaceable&quot;&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;expression&lt;/span&gt;&lt;/em&gt;&amp;nbsp;(which must be a reference type, such as an instance of a class) can be safely cast to&amp;nbsp;&lt;em class=&quot;replaceable&quot;&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;type&lt;/span&gt;&lt;/em&gt;&amp;nbsp;without throwing an exception.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px; white-space: normal;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;as&lt;/span&gt;&amp;nbsp;operator is similar to&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;is&lt;/span&gt;, but it goes a step further. The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;as&lt;/span&gt;&amp;nbsp;operator tries to cast the object to the type, and if an exception would be thrown, it instead returns null:&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;ICompressible myCompressible = myObject as ICompressible
if ( myCompressible != null )&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;The&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; white-space: normal;&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;&amp;nbsp;operator is slightly less efficient than using&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; white-space: normal;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;, so the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; white-space: normal;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;&amp;nbsp;operator is slightly preferred over the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; white-space: normal;&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;&amp;nbsp;operator, except when you want to do the test but not actually do the cast (a rare situation).&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/5923842660554060710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/introduction-to-is-and-as-operator-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5923842660554060710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/5923842660554060710'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/introduction-to-is-and-as-operator-in-c.html' title='Introduction To The is and as Operator in C#'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-526326617406543404</id><published>2014-03-27T08:50:00.001-07:00</published><updated>2014-03-27T08:53:14.146-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADO.Net"/><title type='text'>A Brief Intoduction To ADO.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Here is the list of some basic points that will help you to understand ADO.Net and keep in mind about the basic features of ADO.Net&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
ADO.NET provides classes that allow you to retrieve and manipulate data from databases for use in your code.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
ADO.NET was designed to use a disconnected data architecture, meaning that information is retrieved and stored locally, to diminish use of resource-intensive database connections.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
A database is a structured repository of information, and a relational database is a database that organizes the data into tables.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The tables in relational databases are further divided into rows, where each row represents a single record, and columns, which represent categories of data.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The primary key in a table is a column containing values that are unique for each record in that table.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
A foreign key is a column that serves as the primary key for a different table, and helps to create one-to-many relationships among data in separate tables.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Normalization is the process of removing redundant information from records into separate tables, which reduces complexity and speeds up the retrieval process.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Constraints set limitations on data to avoid data conflicts and errors.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
SQL is a language commonly used to access and manipulate databases. The fundamental operation in SQL is the query.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Defining filters with a query allows you to retrieve specific subsets of information.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Using a join in a query allows you to retrieve data based on membership in more than one table.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataSet&lt;/span&gt;&amp;nbsp;object represents a subset of data retrieved from the database.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataSet&lt;/span&gt;&amp;nbsp;object contains a collection called&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;Tables&lt;/span&gt;, which in turn contains&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataTable&lt;/span&gt;&amp;nbsp;objects.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataTable&lt;/span&gt;&amp;nbsp;object contains a collection called&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;Columns&lt;/span&gt;, which contains&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataColumn&lt;/span&gt;&amp;nbsp;objects, and a collection called&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;Rows&lt;/span&gt;, which contains&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataRow&lt;/span&gt;&amp;nbsp;objects.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;Rows&lt;/span&gt;&amp;nbsp;collection allows you to examine the results of your query, usually by iterating over the collection with a loop.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataAdapter&lt;/span&gt;&amp;nbsp;is a class that forms a bridge between the database and the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataSet&lt;/span&gt;&amp;nbsp;class, using a connection string and a query string. The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataAdapter&lt;/span&gt;&amp;nbsp;can then be used to populate the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;DataSet&lt;/span&gt;&amp;nbsp;object using the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;color: darkgreen; font-family: Consolas, Courier, monospace;&quot;&gt;Fill( )&lt;/span&gt;&amp;nbsp;method.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/526326617406543404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/a-brief-intoduction-to-adonet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/526326617406543404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/526326617406543404'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/a-brief-intoduction-to-adonet.html' title='A Brief Intoduction To ADO.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-4142279161893636585</id><published>2014-03-25T10:45:00.001-07:00</published><updated>2014-03-25T10:45:39.136-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><title type='text'>Async Programming In C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;An Introduction to Async Programming In C#&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;The&amp;nbsp;&lt;/span&gt;Async&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&amp;nbsp;feature in Visual Studio 2012 RC makes it easy to invoke asynchronous methods.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;If a method marked with or&amp;nbsp;&lt;/span&gt;async&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&amp;nbsp;modifier, we can use the&amp;nbsp;&lt;/span&gt;await&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&amp;nbsp;operator in the method. When control reaches an await expression in the &lt;b&gt;&lt;i&gt;async &lt;/i&gt;&lt;/b&gt;method, control returns to the caller, and progress in the method is suspended until the awaited task completes. When the task is complete, execution can resume in the method.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;Using asynchronous methods instead of synchronous methods can provide benefits.&amp;nbsp; Asynchrony makes UI applications more responsive because the UI thread that launches that operation can perform other work.&amp;nbsp; Asynchrony also improves the scalability of server-based application by reducing the need for threads.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
&lt;strong&gt;What&#39;s the difference between asynchronous programming and using multiple threads to do parallel programming?&lt;/strong&gt;&lt;br /&gt;In synchronous programming, something doesn&#39;t happen until the last thing is done. There may not be any human delays for which Async may be useful, but there are much shorter delays. Think milliseconds. These often are I/O operations like waiting to retrieve something from the hard drive. There are a lot of short delays, so the milliseconds add up to mega-milliseconds, so people watch swirling donuts.&lt;/div&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
Using multiple threads and the Task Parallel Library can improve things. On a single core processor, while one thread is waiting to get something back from the hard drive, Windows may assign another thread to run on the processor. That makes the whole thing run faster. On multiple core processors, things are even better. Windows may assign one thread to run on one core, and another to run on another.&lt;/div&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/4142279161893636585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/async-programming-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4142279161893636585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4142279161893636585'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/async-programming-in-c.html' title='Async Programming In C#'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-8560563837863516812</id><published>2014-03-23T04:04:00.001-07:00</published><updated>2014-03-23T04:04:53.666-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Audio And Video Playback"/><title type='text'>Play All/Any Video Formats Including MKV,MP4,AVI,h264,BluRay DVD,MOV,WMV,DIVX,WebM etc.. With FFDShow</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;To Play All Video Formats MKV,AVI,DIVX,H642,WebM,Mov,BluRay DVD,MP4,MPEG1,MPEG2,WMV or any other video format on Windows XP/Windows Vista/Wndows 7/Windows 8 Without any codec pack.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px;&quot;&gt;There are many codec packs available like K-Lite,Combined Community Codec pack,Shark 007 Codec Pack but These codec packs take little bits of standalone decoders and chop them into their own application making them very difficult to know what you have installed and can create conflicts if set up incorrectly.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px;&quot;&gt;So we can setup our Own way to play video file using FFDshow.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px;&quot;&gt;&lt;b&gt;Why FFDShow&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin: 0px 1.5em 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;We can manage our decoders and splitters manually and update them ourrself as updates become available without bre&amp;nbsp;yaking your setup or having to go thru setting it up again. With Shark007 and CCCP you have to wait for the authors to release updates to continue using their packs if new features are released.&lt;/li&gt;
&lt;li style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FFDShow caters for “all” codecs required by any modern HTPC setup (video/audio/subtitles) and also offers some great post processing filters in order to improve on image quality and sound quality.&lt;/li&gt;
&lt;li style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;By installing only one decoder (FFDShow) you eliminate decoder conflicts which makes finding the root cause of a problem much easier to find. (Shark007 uses many different decoders, haali is not updated enough and doesn’t support subtitles in Win7)&lt;/li&gt;
&lt;li style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FFDShow using the Matroskasplitter allows for flawless playback of HD audio bitstreaming in MKV’s (providing your hardware allows this), which as we all know play natively in MediaBrowser (unlike .ts, .m2ts files ripped from BD discs)&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong&gt;What is FFDShow???&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
FFDShow is an excellent Decoder for Video formats, Audio formats and now incorporates DXVA 1.0 &amp;amp; 2.0 (Hardware Acceleration) decoding for h264 &amp;amp; VC-1 formats and copes with subtitles in WMP &amp;amp; MCE.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
3 Items are required to be installed in order to get almost all formats working on your HTPC flawlessly. Also the requirement to install the “Preferred FilterTweaker Tool”. This allows you to set up your decoder preferences to override Windows 7 Media Foundation.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
What we aim to do in this guide is to help setup what you might need to get your codecs working right, add post processing filters, resizing your movies to fill your screen. Also how to turn any 2.0 mp3 audio stream into full Dolby Digital 5.1 (AC3) output.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;b&gt;Which Things are Needed?&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
Firstly We will need to download and register Some filters. &amp;nbsp;The first being MP4Splitter (this allows native playing of Apple’s movie formats natively) and the second is the MatroskaSplitter (this is a much better MKV splitter than Haali and is constantly being improved on to work with FFDShow). To Play Flash Video .FLV File Smoothly We need FLVSplitter.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;b&gt;Now The Step Goes To Download And Installation:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
For 32 Bit System Download This:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 17.711999893188477px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://onedrive.live.com/redir?resid=5B4625859B3D192F!131&amp;amp;authkey=!AE6VRFwH5QClGPE&amp;amp;ithint=file%2c.rar&quot;&gt;https://onedrive.live.com/redir?resid=5B4625859B3D192F!131&amp;amp;authkey=!AE6VRFwH5QClGPE&amp;amp;ithint=file%2c.rar&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 17.711999893188477px;&quot;&gt;For 64 Bit&amp;nbsp;System&amp;nbsp;Download This:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 17.711999893188477px;&quot;&gt;&lt;a href=&quot;https://onedrive.live.com/redir?resid=5B4625859B3D192F%21132&quot;&gt;https://onedrive.live.com/redir?resid=5B4625859B3D192F%21132&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Now We have to&amp;nbsp;register&amp;nbsp;these filters Using &lt;b&gt;regsv32&lt;/b&gt; Command&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
First thing to note here is:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;u&gt;&lt;b&gt;Disable The UAC Before Registering these filters&lt;/b&gt;.&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
Download the latest FFDShow SVN Build From SourceFourge.Com.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;a href=&quot;http://sourceforge.net/projects/ffdshow-tryout/files/latest/download?source=directory&quot;&gt;http://sourceforge.net/projects/ffdshow-tryout/files/latest/download?source=directory&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
After download install ffdshow.&lt;/div&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/AVvXsEjL416Yl1-eYt52tLM0ewBSNX9yfoNJI5cvwSCVqLkBj_xNRDqfNOPTb1MM45sz1TZuQmYXL4msMgmjst3aynB9a8xIFen7j2GtCNYOIV3v3k3-Ze1GwICZ7MaCYWw6tO_6LZCgFS0kNXU/s1600/Install.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL416Yl1-eYt52tLM0ewBSNX9yfoNJI5cvwSCVqLkBj_xNRDqfNOPTb1MM45sz1TZuQmYXL4msMgmjst3aynB9a8xIFen7j2GtCNYOIV3v3k3-Ze1GwICZ7MaCYWw6tO_6LZCgFS0kNXU/s1600/Install.png&quot; height=&quot;245&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;b&gt;Now its time to configure the FFDShow Video And FFDShow Audio Decoder to do all the tasks:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;b&gt;configure FFDShow Video Decoder:&lt;/b&gt;&lt;/div&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/AVvXsEhMD1a_14G1NcpuaDqTz8JcSwqii3sc4ziurWI6pBpCYzllugfhKwwgtX2NeNuFmHpNyNWOhT5t7Ow2-RjrNbISO7HTjPQfo9vNX1XqGHBYU9w3YvUNsjUWUaJx7hfSDuEf0qudcOf8tEM/s1600/program.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMD1a_14G1NcpuaDqTz8JcSwqii3sc4ziurWI6pBpCYzllugfhKwwgtX2NeNuFmHpNyNWOhT5t7Ow2-RjrNbISO7HTjPQfo9vNX1XqGHBYU9w3YvUNsjUWUaJx7hfSDuEf0qudcOf8tEM/s1600/program.png&quot; height=&quot;110&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px;&quot;&gt;Select Video Decoder Configuration in start Menu ffdshow Folder:&lt;/span&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/AVvXsEhYXq9IzURxlPlgHB9VJNfx8X1vD2BLhds6SDcn6tSIHi4CuLAqgRT7xWQSzEe31ivakG4yoaEEivnyIkKSfomzGUrjhsq2qwmP_9gJa5Npu6HKjzFVAKnVtD71bMOv1GObIKmtr9tkEJE/s1600/codecs1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYXq9IzURxlPlgHB9VJNfx8X1vD2BLhds6SDcn6tSIHi4CuLAqgRT7xWQSzEe31ivakG4yoaEEivnyIkKSfomzGUrjhsq2qwmP_9gJa5Npu6HKjzFVAKnVtD71bMOv1GObIKmtr9tkEJE/s1600/codecs1.png&quot; height=&quot;333&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.711999893188477px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Select &lt;b&gt;&lt;i&gt;Codecs &lt;/i&gt;&lt;/b&gt;tab in left panel then right click any where on the grid showing formats decoder&lt;br /&gt;
and then select &lt;b&gt;&lt;i&gt;Set all stable formats to libavcodec&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/i&gt;this will enable all supported formats to libavcodec but for VP8,MPEG1,MPEG2,WMV and VC1 we have to enable it accordinglly like below:&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/AVvXsEi7UdFcpno0seJAeAxZfrCfbScDm5PEfp1VrXV4HT14ZqqLGEgXzL0Jq3pwEj3KKDCQD_ueqceZy3CCesjayO7hZ7RLsjIDT_JhcDhAjX4G3LDKTfaS6s0qY_rY9TSxEDKaIbxKXqtjz9M/s1600/codec2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7UdFcpno0seJAeAxZfrCfbScDm5PEfp1VrXV4HT14ZqqLGEgXzL0Jq3pwEj3KKDCQD_ueqceZy3CCesjayO7hZ7RLsjIDT_JhcDhAjX4G3LDKTfaS6s0qY_rY9TSxEDKaIbxKXqtjz9M/s1600/codec2.png&quot; height=&quot;333&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Re-size&amp;nbsp;The Video&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
resize is usefull when coupled with postprocessing filter we can resize and set the proper aspect ratio of our videos by using this property:&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/AVvXsEjIQCCICs61Pqt_hdiXM4s-96V-P2ZdESJrkTzsdOhJDPoX8NERfRKi_n0xPcoDQHzPRwru7X78QFFJ7NTf-KdS9E7AayJHCi8xngebvorC6a4y-d-N3x_qVOIOTja53DB-oqwHLeJtO3E/s1600/resize.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIQCCICs61Pqt_hdiXM4s-96V-P2ZdESJrkTzsdOhJDPoX8NERfRKi_n0xPcoDQHzPRwru7X78QFFJ7NTf-KdS9E7AayJHCi8xngebvorC6a4y-d-N3x_qVOIOTja53DB-oqwHLeJtO3E/s1600/resize.png&quot; height=&quot;337&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Post Processing Filter Setting:&lt;/b&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/AVvXsEg_WiW4_tqRZUBJSh3XHHBXjTCNzowPLJGS0PDAIm_Mtxkkwlmco5M2ooGCFbk71HR_ASW7SlrgOFJCIsbhnxlLng9e8tGDNosttle3_LXLwQAD1vRK1U6f0DnYSkFHJRPHrhF6seWPbM4/s1600/postprocessing...png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_WiW4_tqRZUBJSh3XHHBXjTCNzowPLJGS0PDAIm_Mtxkkwlmco5M2ooGCFbk71HR_ASW7SlrgOFJCIsbhnxlLng9e8tGDNosttle3_LXLwQAD1vRK1U6f0DnYSkFHJRPHrhF6seWPbM4/s1600/postprocessing...png&quot; height=&quot;337&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Check Automatic Quality Control , Also option for Apply Process whole image or only right half.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Setting of Win7DsFilterTweaker&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
After doing these settings we need to Configure to disable the Microsoft Video Decoder for this&lt;br /&gt;
we can use Win7DSFilterTweaker Tool.&lt;br /&gt;
&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/AVvXsEjPwCnXRxliCegL1_2-hY9o2sfPcAoi5PjuW90IMLmjbvVNl-n8Fy2oDBnqFH6jTn5Un4f052BM519Vzc4AxsCZg1KWy8zDxSUF1sIJ2Q53OG8YNkTFzl2ZS9NghGVBYWd2ySq6bNp6KQk/s1600/win71.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPwCnXRxliCegL1_2-hY9o2sfPcAoi5PjuW90IMLmjbvVNl-n8Fy2oDBnqFH6jTn5Un4f052BM519Vzc4AxsCZg1KWy8zDxSUF1sIJ2Q53OG8YNkTFzl2ZS9NghGVBYWd2ySq6bNp6KQk/s1600/win71.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
First to associate the video formats to ffdshow video decoder Click On Prefered decoders in aboove shown screen:&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/AVvXsEhPxmGEjC_RIBSDqtWVnuFO1tgL8kPG3TtGvgNe-jeZJf9sdCny94ArkU3qk19UTa5q9uwJ4AukW0my46MUawulo2Ay5I50n2Vk6-4xcgNX9VB_bxIxq8mriRhBwvaZWnXtIab_qJRDh5g/s1600/win72.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPxmGEjC_RIBSDqtWVnuFO1tgL8kPG3TtGvgNe-jeZJf9sdCny94ArkU3qk19UTa5q9uwJ4AukW0my46MUawulo2Ay5I50n2Vk6-4xcgNX9VB_bxIxq8mriRhBwvaZWnXtIab_qJRDh5g/s1600/win72.png&quot; height=&quot;232&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Then its time to disable windows audio and video decoders:&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/AVvXsEgr9RHy9HFu1DO_Uph7rK5HaPSfVcu9JRLG0dIcpcZH0tuyGD8WWCbTCQlkKtTFRMYnPddx0CaPwPus5Q2C_7tZmRc_Ic2CTzij-Zm-FVsj_B3R7tbqre1Af19p25pvH0hh8d7HA_UCx5Q/s1600/win73.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr9RHy9HFu1DO_Uph7rK5HaPSfVcu9JRLG0dIcpcZH0tuyGD8WWCbTCQlkKtTFRMYnPddx0CaPwPus5Q2C_7tZmRc_Ic2CTzij-Zm-FVsj_B3R7tbqre1Af19p25pvH0hh8d7HA_UCx5Q/s1600/win73.png&quot; height=&quot;320&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Now Disable The DMO&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/AVvXsEgQnHIYUWSKZte-BHe8ISdvGCtfYNvb_-JYOMqIC_MTU2Eu-Xj2Mhdy-M-PAKpCmeaowaLICxO-lRbd6c7NTBcMNMiqy49Ax_lY4vAz9P8cAsNER4twBNWsMDCpW_6ANRBj2T-7A94yocY/s1600/win74.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQnHIYUWSKZte-BHe8ISdvGCtfYNvb_-JYOMqIC_MTU2Eu-Xj2Mhdy-M-PAKpCmeaowaLICxO-lRbd6c7NTBcMNMiqy49Ax_lY4vAz9P8cAsNER4twBNWsMDCpW_6ANRBj2T-7A94yocY/s1600/win74.png&quot; height=&quot;318&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;After doing these settings now we can play any video format on our system.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/8560563837863516812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/play-allany-video-formats-including.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8560563837863516812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8560563837863516812'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/play-allany-video-formats-including.html' title='Play All/Any Video Formats Including MKV,MP4,AVI,h264,BluRay DVD,MOV,WMV,DIVX,WebM etc.. With FFDShow'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL416Yl1-eYt52tLM0ewBSNX9yfoNJI5cvwSCVqLkBj_xNRDqfNOPTb1MM45sz1TZuQmYXL4msMgmjst3aynB9a8xIFen7j2GtCNYOIV3v3k3-Ze1GwICZ7MaCYWw6tO_6LZCgFS0kNXU/s72-c/Install.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-7395031237281827144</id><published>2014-03-22T11:54:00.001-07:00</published><updated>2014-03-22T11:54:48.490-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LINQ"/><title type='text'>LINQ Query Expressions in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;div style=&quot;color: #222222; font-family: Calibri; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;LINQ Query Expressions in C#&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;color: #222222; font-family: Calibri; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #222222; font-family: Calibri; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Language-Integrated Query (LINQ) is the name for a set of technologies based on the integration of query capabilities directly into the C# language (also&amp;nbsp;in Visual Basic and potentially any other .NET language). With LINQ, a query is now a first-class language construct, just like classes, methods, events and so on.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #222222; font-family: Calibri; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #222222; font-family: Calibri; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;For a developer who writes queries, the most visible &quot;language-integrated&quot; part of LINQ is the query expression. Query expressions are written in a declarative&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;parameter&quot; style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; font-style: italic; line-height: 18px;&quot;&gt;query syntax&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;introduced in C# 3.0. By using query syntax, you can perform even complex filtering, ordering, and grouping operations on data sources with a minimum of code. You use the same basic query expression patterns to query and transform data in SQL databases, ADO.NET&amp;nbsp;Datasets, XML documents and streams, and .NET collections.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #222222; font-family: Calibri; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; MYLINQQueryExpressions
{
    &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Main()
    {

        &lt;span style=&quot;color: green;&quot;&gt;// Specify the data source.&amp;nbsp;&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;[] marks= &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;[] { 77, 110, 92, 125};

        &lt;span style=&quot;color: green;&quot;&gt;// Define the query expression.&lt;/span&gt;
        IEnumerable&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;gt; scoreQuery =
            &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; mark &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; marks
            &lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt; mark&amp;gt; 95
            &lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; mark;

        &lt;span style=&quot;color: green;&quot;&gt;// Execute the query.&amp;nbsp;&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; scoreQuery)
        {
            Console.Write(i + &lt;span style=&quot;color: #a31515;&quot;&gt;&quot; &quot;&lt;/span&gt;);
        }            
    }
}
&lt;span style=&quot;color: green;&quot;&gt;// Output: 110 125&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.549999237060547px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;h2 style=&quot;font-family: Consolas, Courier, monospace !important; line-height: 17.549999237060547px; overflow: auto; padding: 5px; text-align: left; word-wrap: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;How to Write LINQ Query Expressions &lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;b&gt;Guidelines to write LINQ Query Expressions&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Query expressions can be used to query and to transform data from any LINQ-enabled data source. For example, a single query can retrieve data from a SQL database, and produce an XML stream as output.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Query expressions are easy to master because they use many familiar C# language constructs.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The variables in a query expression are all strongly typed, although in many cases you do not have to provide the type explicitly because the compiler can infer it.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
A query is not executed until you iterate over the query variable in a&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;foreach&lt;/span&gt;&amp;nbsp;statement.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
At compile time, query expressions are converted to Standard Query Operator method calls according to the rules set forth in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. However, in most cases query syntax is more readable and concise.&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
As a rule when you write LINQ queries, we recommend that you use query syntax whenever possible and method syntax whenever necessary. There is no semantic or performance difference between the two different forms. Query expressions are often more readable than equivalent expressions written in method syntax.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Some query operations, such as&amp;nbsp;Count&amp;nbsp;or&amp;nbsp;Max, have no equivalent query expression clause and must therefore be expressed as a method call. Method syntax can be combined with query syntax in various ways.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Query expressions can be compiled to expression trees or to delegates, depending on the type that the query is applied to.&amp;nbsp;IEnumerable&lt;span xmlns=&quot;&quot;&gt;&amp;lt;&lt;/span&gt;T&lt;span xmlns=&quot;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;queries are compiled to delegates.&amp;nbsp;IQueryable&amp;nbsp;and&amp;nbsp;IQueryable&lt;span xmlns=&quot;&quot;&gt;&amp;lt;&lt;/span&gt;T&lt;span xmlns=&quot;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;queries are compiled to expression trees.&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/7395031237281827144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/linq-query-expressions-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/7395031237281827144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/7395031237281827144'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/linq-query-expressions-in-c.html' title='LINQ Query Expressions in C#'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-849491126702118925</id><published>2014-03-21T20:32:00.000-07:00</published><updated>2014-03-21T20:32:05.484-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net Framework"/><title type='text'>How to identify a computer that do not have .net framework</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;To Identify a computer that do not have .Net Framework:&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
1. In the configuration manager navigate to System Center Configuration Manager/Site Database/System Status/Status Message Query.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2. Right Click on All Status Message and Click On Show Messages.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3. In the All Status Messages dialog box enter the time period or date and time for which you want to check the status messages and then click OK.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4. All Status Messages are displayed in Status Message Viewer , click on the Component column and locate the status messages with a component named Desired Configuration Management.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
5. In The Message ID column , look for 11802 to identify the computer that logged to this message.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
6. For more information to this message Right Click a status message and select Detail.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
7.View the information in Status Message Details dialog box and then clock OK to close this dialog box or clock previous or next to view the details of other messages.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
8. Click OK to close Status Message Details dialog box and close the Status Message Viewer.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/849491126702118925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/how-to-identify-computer-that-do-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/849491126702118925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/849491126702118925'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/how-to-identify-computer-that-do-not.html' title='How to identify a computer that do not have .net framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-3074236053259732089</id><published>2014-03-21T20:01:00.000-07:00</published><updated>2014-03-21T20:01:05.613-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Sharp Programming"/><title type='text'>A Sample Client/Server Chat Program in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;How to make a sample client/server chat program in C# .Net&lt;/b&gt;&lt;/h2&gt;
This is the sample code for client part of chat program.&lt;br /&gt;
Client&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.IO;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.Net;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.&lt;/span&gt;&lt;a class=&quot;entity-ref&quot; href=&quot;http://www.developerfusion.com/t/threading/&quot; style=&quot;color: #4d97e0; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Threading&lt;/a&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using N = System.Net;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.Collections;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.Windows.Forms;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.ComponentModel;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.Runtime.InteropServices;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;class TalkUser {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;static Form talk;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;static N.Sockets.TcpClient TC;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;[DllImport(&quot;kernel32.dll&quot;)]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;private static extern void ExitProcess(int a);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public static void Main() {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk = new Form();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.Text = &quot;TalkUser - The OFFICIAL TalkServ Client&quot;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.Closing += new CancelEventHandler(talk_Closing);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.Controls.Add(new TextBox());&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.Controls[0].Dock = DockStyle.Fill;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.Controls.Add(new TextBox());&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.Controls[1].Dock = DockStyle.Bottom;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((TextBox)talk.Controls[0]).Multiline = true;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((TextBox)talk.Controls[1]).Multiline = true;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.WindowState = FormWindowState.Maximized;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;talk.Show();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((TextBox)talk.Controls[1]).KeyUp += new KeyEventHandler(key_up);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TC = new N.Sockets.TcpClient();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TC.Connect(&quot;IP OF A SERVER HERE&quot;,4296);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread t = new Thread(new ThreadStart(run));&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;t.Start();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(true) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Application.DoEvents();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;private static void talk_Closing(object s, CancelEventArgs e) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.Cancel = false;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Application.Exit();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ExitProcess(0);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;private static void key_up(object s,KeyEventArgs e) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TextBox TB = (TextBox)s;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(TB.Lines.Length&amp;gt;1) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;StreamWriter SW = new StreamWriter(TC.GetStream());&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.WriteLine(TB.Text);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.Flush();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TB.Text = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TB.Lines = null;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;private static void run() {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;StreamReader SR = new StreamReader(TC.GetStream());&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(true) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Application.DoEvents();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TextBox TB = (TextBox)talk.Controls[0];&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TB.AppendText(SR.ReadLine()+&quot;\r\n&quot;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TB.SelectionStart = TB.Text.Length;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #2e2e2e; font-family: Lucida Console, monospace;&quot;&gt;&lt;span style=&quot;background-color: #fff8e1; font-size: 11px;&quot;&gt;&lt;b&gt;This is server part of chat program.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.IO;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.Net;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.Threading;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using N = System.Net;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;using System.Collections;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;class TalkServ {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;System.Net.Sockets.TcpListener server;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public static Hashtable handles;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public static Hashtable handleByConnect;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public static void Main() {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ TS = new TalkServ();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public TalkServ() {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;handles = new Hashtable(100);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;handleByConnect = new Hashtable(100);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;server = new System.Net.Sockets.TcpListener(4296);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(true) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;server.Start();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(server.Pending()) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;N.Sockets.TcpClient connection = server.AcceptTcpClient();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;Connection made&quot;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BackForth BF = new BackForth(connection); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public static void SendToAll(string name,string msg) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;StreamWriter SW;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ArrayList ToRemove = new ArrayList(0);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;N.Sockets.TcpClient[] tc = new N.Sockets.TcpClient[TalkServ.handles.Count];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handles.Values.CopyTo(tc,0);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for(int i=0;i&lt;tc .length=&quot;&quot; i=&quot;&quot; nbsp=&quot;&quot; span=&quot;&quot;&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(msg.Trim()==&quot;&quot;||tc[i]==null)&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;continue;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW = new StreamWriter(tc[i].GetStream());&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.WriteLine(name + &quot;: &quot; + msg);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.Flush();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW = null;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch(Exception e44) { e44 = e44;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string g = (string) TalkServ.handleByConnect[tc[i]];&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.SendSysMsg(&quot;** &quot; + g + &quot; ** HAS LEFT US.&quot;);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handles.Remove(g);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handleByConnect.Remove(tc[i]);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public static void SendSysMsg(string msg) {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;StreamWriter SW;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ArrayList ToRemove = new ArrayList(0);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;N.Sockets.TcpClient[] tc = new N.Sockets.TcpClient[TalkServ.handles.Count];&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handles.Values.CopyTo(tc,0);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for(int i=0;i&lt;tc .length=&quot;&quot; i=&quot;&quot; nbsp=&quot;&quot; span=&quot;&quot;&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(msg.Trim()==&quot;&quot;||tc[i]==null)&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;continue;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW = new StreamWriter(tc[i].GetStream());&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.WriteLine(msg);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.Flush();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW = null;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch(Exception e44) { e44 = e44;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handles.Remove(TalkServ.handleByConnect[tc[i]]);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handleByConnect.Remove(tc[i]);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;}//end of class TalkServ&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;class BackForth {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;N.Sockets.TcpClient client;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;System.IO.StreamReader SR;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;System.IO.StreamWriter SW;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;string handle;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;public BackForth(System.Net.Sockets.TcpClient c) {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;client = c;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread t = new Thread(new ThreadStart(init));&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;t.Start();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;private string GetHandle() {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.WriteLine(&quot;What is your handle? &quot;);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.Flush();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return SR.ReadLine();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;private void run() {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string l = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(true) {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;l = SR.ReadLine();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.SendToAll(handle,l);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch(Exception e44) { Console.WriteLine(e44); }&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;private void init() {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SR = new System.IO.StreamReader(client.GetStream());&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW = new System.IO.StreamWriter(client.GetStream());&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.WriteLine(&quot;WELCOME TO TalkServ! Be Nice!&quot;);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//SW.WriteLine(&quot;What is your handle? &quot;);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//SW.Flush();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;handle = GetHandle();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(TalkServ.handles.Contains(handle)) {&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.WriteLine(&quot;ERR - Handle already exists!&quot;);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;handle = GetHandle();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handles.Add(handle,client);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.handleByConnect.Add(client,handle);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TalkServ.SendSysMsg(&quot;** &quot; + handle + &quot; ** HAS JOINED US.&quot;);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.WriteLine(&quot;Now Talking.....\r\n-------------------------------&quot;);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SW.Flush();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread t = new Thread(new ThreadStart(run));&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;t.Start();&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px; margin: 0px; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;}&lt;/span&gt;&lt;/tc&gt;&lt;/span&gt;&lt;/tc&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff8e1; color: #2e2e2e; font-family: &#39;Lucida Console&#39;, monospace; font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/3074236053259732089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/a-sample-clientserver-chat-program-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/3074236053259732089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/3074236053259732089'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/a-sample-clientserver-chat-program-in-c.html' title='A Sample Client/Server Chat Program in C#'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-2371472130317081145</id><published>2014-03-20T19:59:00.003-07:00</published><updated>2014-03-20T19:59:52.895-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><title type='text'>How To Send Email  Via Web Services In Asp.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a class=&quot;header tight padded-top&quot; href=&quot;http://www.codeproject.com/Questions/746824/How-Can-I-Send-Email-And-Messages-Via-Web-Services&quot; id=&quot;ctl00_ctl00_MC_AMC_TitleLink&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px !important; padding: 0px !important; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1 id=&quot;ctl00_ctl00_MC_AMC_ItemTitle&quot; style=&quot;color: #333333; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 29px; font-weight: 200; line-height: normal; margin: 25px 0px 0px; padding: 0px; text-align: left;&quot;&gt;
How To Send Email Via Web Services In Asp.Net&lt;/h1&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To send Email via Web Services in ASP.Net Create a web method as given below:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
public static void CreateMessageWithAttachment(string server)&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Specify the file to be attached and sent.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// This example assumes that a file named Data.xls exists in the&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// current working directory.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;string file = &quot;myfile.xls&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Create a message and set up the recipients.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;MailMessage message = new MailMessage(&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &quot;naveenranjan@gmail.com&quot;,&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &quot;nr2info@gmail.com&quot;,&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &quot;Your data report.&quot;,&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &quot;See the attached File.&quot;);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Create &amp;nbsp;the file attachment for this e-mail message.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Attachment data = new Attachment(file, MediaTypeNames.Application.Octet);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Add time stamp information for the file.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ContentDisposition disposition = data.ContentDisposition;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;disposition.CreationDate = System.IO.File.GetCreationTime(file);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;disposition.ModificationDate = System.IO.File.GetLastWriteTime(file);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;disposition.ReadDate = System.IO.File.GetLastAccessTime(file);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Add the file attachment to this e-mail message.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;message.Attachments.Add(data);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//Send the message.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SmtpClient client = new SmtpClient(server);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Add credentials if the SMTP server requires them.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;client.Credentials = CredentialCache.DefaultNetworkCredentials;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;client.Send(message);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;catch (Exception ex) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;Console.WriteLine(&quot;Exception caught in CreateMessageWithAttachment(): {0}&quot;,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ex.ToString() );&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Display the values in the ContentDisposition for the attachment.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ContentDisposition cd = data.ContentDisposition;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;Content disposition&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(cd.ToString());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;File {0}&quot;, cd.FileName);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;Size {0}&quot;, cd.Size);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;Creation {0}&quot;, cd.CreationDate);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;Modification {0}&quot;, cd.ModificationDate);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;Read {0}&quot;, cd.ReadDate);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;Inline {0}&quot;, cd.Inline);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Console.WriteLine(&quot;Parameters: {0}&quot;, cd.Parameters.Count);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;foreach (DictionaryEntry d in cd.Parameters)&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Console.WriteLine(&quot;{0} = {1}&quot;, d.Key, d.Value);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;data.Dispose();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/2371472130317081145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/how-to-send-email-via-web-services-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/2371472130317081145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/2371472130317081145'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/how-to-send-email-via-web-services-in.html' title='How To Send Email  Via Web Services In Asp.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-8105513123841758319</id><published>2014-03-20T19:50:00.002-07:00</published><updated>2014-03-20T19:50:59.321-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><title type='text'>Print GridView Data Using JavaScript in ASP.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: #f6f4ef; color: #222222; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;How to Print&amp;nbsp;&lt;/span&gt;gridview&lt;span style=&quot;background-color: #f6f4ef; color: #222222; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;data in&amp;nbsp;&lt;/span&gt;asp.net&lt;span style=&quot;background-color: #f6f4ef; color: #222222; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;using&amp;nbsp;&lt;/span&gt;C#&lt;span style=&quot;background-color: #f6f4ef; color: #222222; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
To print GridView Data using JavaScript &amp;nbsp;follow this steps.&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Take a GridView Control on your ASP.Net Page.&lt;/li&gt;
&lt;li&gt;Bind the GridView as Per ADO.Net.&lt;/li&gt;
&lt;li&gt;Then Write the JavaScript Code as below to print the gridView Data .&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;div&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;/html&gt;&lt;/div&gt;
&lt;div&gt;
&lt;head id=&quot;Head1&quot; runat=&quot;server&quot;&gt;&lt;/head&gt;&lt;/div&gt;
&lt;div&gt;
&lt;title&gt;Print Gridview Data in asp.net&lt;/title&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;/div&gt;
&lt;div&gt;
function PrintGridViewData() {&lt;/div&gt;
&lt;div&gt;
var GridPrint = document.getElementById(&#39;&lt;%=GridView1.ClientID %&gt;&#39;);&lt;/div&gt;
&lt;div&gt;
GridPrint.border = 0;&lt;/div&gt;
&lt;div&gt;
var windowPrint= window.open(&#39;&#39;, &#39;PrintGridViewData&#39;,&#39;left=100,top=100,width=1000,height=1000,tollbar=0,scrollbars=1,status=0,resizable=1&#39;);&lt;/div&gt;
&lt;div&gt;
windowPrint.document.write(GridPrint .outerHTML);&lt;/div&gt;
&lt;div&gt;
windowPrint.document.close();&lt;/div&gt;
&lt;div&gt;
windowPrint.focus();&lt;/div&gt;
&lt;div&gt;
windowPrint.print();&lt;/div&gt;
&lt;div&gt;
windowPrint.close();&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;body&gt;&lt;/body&gt;&lt;/div&gt;
&lt;div&gt;
&lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Print Gridview Data&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;asp:gridview id=&quot;gvUserInfo&quot; runat=&quot;server&quot;&gt;&lt;/asp:gridview&gt;&lt;/div&gt;
&lt;div&gt;
&lt;headerstyle backcolor=&quot;#df5015&quot; font-bold=&quot;true&quot; forecolor=&quot;White&quot;&gt;&lt;/headerstyle&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;input id=&quot;btnPrint&quot; onclick=&quot;PrintGridData()&quot; type=&quot;button&quot; value=&quot;Print&quot; /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/8105513123841758319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/print-gridview-data-using-javascript-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8105513123841758319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/8105513123841758319'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/print-gridview-data-using-javascript-in.html' title='Print GridView Data Using JavaScript in ASP.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-4135931640290680727</id><published>2014-03-19T19:55:00.003-07:00</published><updated>2014-03-19T19:55:44.019-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Assemby in .Net"/><title type='text'>Benefits of Using Assembly in .Net Framework 4.5 </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Benefits of Using Assembly in .Net Framework 4.5&lt;/b&gt;&amp;nbsp;&lt;/h2&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Assemblies are designed to simplify application deployment and to solve versioning problems that can occur with component-based applications.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
End users and developers are familiar with versioning and deployment issues that arise from today&#39;s component-based systems. Some end users have experienced the frustration of installing a new application on their computer, only to find that an existing application has suddenly stopped working. Many developers have spent countless hours trying to keep all necessary registry entries consistent in order to activate a COM class.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Many deployment problems have been solved by the use of assemblies in the .NET Framework. Because they are self-describing components that have no dependencies on registry entries, assemblies enable zero-impact application installation. They also simplify uninstalling and replicating applications.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;b&gt;Problems in Versioning&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Currently two versioning problems occur with Win32 applications:&lt;/div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Versioning rules cannot be expressed between pieces of an application and enforced by the operating system. The current approach relies on backward compatibility, which is often difficult to guarantee. Interface definitions must be static, once published, and a single piece of code must maintain backward compatibility with previous versions. Furthermore, code is typically designed so that only a single version of it can be present and executing on a computer at any given time.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
There is no way to maintain consistency between sets of components that are built together and the set that is present at run time.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
These two versioning problems combine to create DLL conflicts, where installing one application can inadvertently break an existing application because a certain software component or DLL was installed that was not fully backward compatible with a previous version. Once this situation occurs, there is no support in the system for diagnosing and fixing the problem.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;b&gt;The Dll Hell Problems&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Windows 2000 began to fully address these problems. It provides two features that partially fix DLL conflicts:&lt;/div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Windows 2000 enables you to create client applications where the dependent .dll files are located in the same directory as the application&#39;s .exe file. Windows 2000 can be configured to check for a component in the directory where the .exe file is located before checking the fully qualified path or searching the normal path. This enables components to be independent of components installed and used by other applications.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Windows 2000 locks files that are shipped with the operating system in the System32 directory so they cannot be inadvertently replaced when applications are installed.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
The common language runtime uses assemblies to continue this evolution toward a complete solution to DLL conflicts.&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;b&gt;Assembly Is Solution&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
To solve versioning problems, as well as the remaining problems that lead to DLL conflicts, the runtime uses assemblies to do the following:&lt;/div&gt;
&lt;ul style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Enable developers to specify version rules between different software components.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Provide the infrastructure to enforce versioning rules.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Provide the infrastructure to allow multiple versions of a component to be run simultaneously (called side-by-side execution).&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/4135931640290680727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/benefits-of-using-assembly-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4135931640290680727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4135931640290680727'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/benefits-of-using-assembly-in-net.html' title='Benefits of Using Assembly in .Net Framework 4.5 '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-7233848103972555470</id><published>2014-03-19T19:45:00.002-07:00</published><updated>2014-03-19T19:45:52.249-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Assemby in .Net"/><title type='text'>Assembly Versioning in .Net Framework 4.5</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; text-align: start;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Assembly Versioning in .Net Framework 4.5&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; font-weight: normal; line-height: 18px; text-align: start;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;All versioning of assemblies that use the common language runtime is done at the assembly level. The specific version of an assembly and the versions of dependent assemblies are recorded in the assembly&#39;s manifest. The default version policy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version policy in configuration files (the application configuration file, the publisher policy file, and the computer&#39;s administrator configuration file).&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Versioning is done only on assemblies with strong names.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The runtime performs several steps to resolve an assembly binding request:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Checks the original assembly reference to determine the version of the assembly to be bound.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Checks for all applicable configuration files to apply version policy.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Determines the correct assembly from the original assembly reference and any redirection specified in the configuration files, and determines the version that should be bound to the calling assembly.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Checks the global assembly cache, codebases specified in configuration files, and then checks the application&#39;s directory and subdirectories .&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;Version Information&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Each assembly has two distinct ways of expressing version information:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-size: 13px; line-height: 17.549999237060547px;&quot;&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The assembly&#39;s version number, which, together with the assembly name and culture information, is part of the assembly&#39;s identity. This number is used by the runtime to enforce version policy and plays a key part in the type resolution process at run time.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: none;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;An informational version, which is a string that represents additional version information included for informational purposes only.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;Assembly Version Information&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Each assembly has a version number as part of its identity. As such, two assemblies that differ by version number are considered by the runtime to be completely different assemblies. This version number is physically represented as a four-part string with the following format:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;&lt;em&gt;major version&lt;/em&gt;&amp;gt;.&amp;lt;&lt;em&gt;minor version&lt;/em&gt;&amp;gt;.&amp;lt;&lt;em&gt;build number&lt;/em&gt;&amp;gt;.&amp;lt;&lt;em&gt;revision&lt;/em&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;For example, version 1.5.1254.0 indicates 1 as the major version, 5 as the minor version, 1254 as the build number, and 0 as the revision number.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The version number is stored in the assembly manifest along with other identity information, including the assembly name and public key, as well as information on relationships and identities of other assemblies connected with the application.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;When an assembly is built, the development tool records dependency information for each assembly that is referenced in the assembly manifest. The runtime uses these version numbers, in conjunction with configuration information set by an administrator, an application, or a publisher, to load the proper version of a referenced assembly.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The runtime distinguishes between regular and strong-named assemblies for the purposes of versioning. Version checking only occurs with strong-named assemblies.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;b&gt;Assembly Informational Version&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2a2a2a; font-size: 13px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The informational version is a string that attaches additional version information to an assembly for informational purposes only; this information is not used at run time. The text-based informational version corresponds to the product&#39;s marketing literature, packaging, or product name and is not used by the runtime. For example, an informational version could be &quot;Common Language Runtime version 1.0&quot; or &quot;NET Control SP 2&quot;. On the Version tab of the file properties dialog in Microsoft Windows, this information appears in the item &quot;Product Version&quot;.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/7233848103972555470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/assembly-versioning-in-net-framework-45.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/7233848103972555470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/7233848103972555470'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/assembly-versioning-in-net-framework-45.html' title='Assembly Versioning in .Net Framework 4.5'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-1086807545399341189</id><published>2014-03-19T09:52:00.000-07:00</published><updated>2014-03-19T09:52:02.996-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADO.Net"/><title type='text'>How to SqlBulkCopy for high performance inserts in .Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;How to use SqlBulkCopy for High Performance insert in ADO.Net&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
In the age of Object Relational Mapping frameworks (ORMs) it seems unusual to ever get “close to the metal” when it comes to persisting data. Developers are getting quite used to being abstracted away from the underlying data access technologies. However there are times when having a good understanding of what’s going on under the covers can allow you to look for alternative solutions when the ORM layer isn’t going to be as efficient as you need for a particular scenario. (This is actually true for all abstractions, not just ORMs.)&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
In a project I worked on about 5 years ago I implemented my own ORM. The application it was being developed for needed to save large sets of data to the database, anywhere between 100,000 and 1,000,000 records in a batch. For various reasons, all of this needed to operate within the ORM code-base; that is to say it wasn’t going to be possible to use a&amp;nbsp;SQL Server&amp;nbsp;DTS package to load the data. Running some performance tests showed that saving the data on a row by row basis by firing off multiple INSERT statements just wasn’t going to cut the mustard.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
The most efficient way to accomplish this turned out to be the&amp;nbsp;SqlBulkCopy&amp;nbsp;class. Unfortunately there isn’t a simple way to get SqlBulkCopy to process through a collection of business entities. This article will show you how you can use SqlBulkCopy with any set of classes to insert new data into a database very quickly. (As an aside, this isn’t the code that I wrote all those years ago – this article takes advantage of&amp;nbsp;.NET&amp;nbsp;framework features that weren’t available back when the original framework was developed, which make things even better than before.)&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #2e2e2e; font-family: Arial; font-size: 1.3em; margin: 10px 0px 5px; padding: 5px 0px;&quot;&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Using SqlBulkCopy&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 18.239999771118164px;&quot;&gt;There are 4 methods on the SqlBulkCopy API that write data to a database:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 18.239999771118164px;&quot;&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;public void WriteToServer(IDataReader reader);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 18.239999771118164px;&quot;&gt;
public void WriteToServer(DataTable table);&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 18.239999771118164px;&quot;&gt;
public void WriteToServer(DataTable table, DataRowState rowState);&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 18.239999771118164px;&quot;&gt;
public void WriteToServer(DataRow[] rows);&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 18.239999771118164px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
The last three of them are closely tied to DataTable-centric classes that were introduced with the first version of the .NET framework. Without copying the data from the objects into a completely different format, these particular methods aren’t going to be any use.&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
That leaves the first method that takes an IDataReader instance. Ideally it would be possible to create a generic&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;ObjectDataReader&lt;person&gt;&lt;/person&gt;&lt;/b&gt;&amp;nbsp;and use that to feed WriteToServer with a set of objects. Sadly this doesn’t exist, so you’re going to have to implement your own.&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;public interface IDataReader : IDisposable, IDataRecord&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;int Depth { get; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;bool IsClosed { get; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;int RecordsAffected { get; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;void Close();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;DataTable GetSchemaTable();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;bool NextResult();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;bool Read();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;But as you can see, it also implements IDisposable (not a big deal) and IDataRecord (a slightly bigger deal). Putting the slightly menacing IDataRecord interface aside for now, this is what a generic implementation of IDataReader might look like:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;public class ObjectDataReader&lt;tdata&gt; : IDataReader&lt;/tdata&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;private IEnumerator&lt;tdata&gt; dataEnumerator;&lt;/tdata&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;public ObjectDataReader(IEnumerable&lt;tdata&gt; data)&lt;/tdata&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; this.dataEnumerator = data.GetEnumerator();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;But as you can see, it also implements IDisposable (not a big deal) and IDataRecord (a slightly bigger deal). Putting the slightly menacing IDataRecord interface aside for now, this is what a generic implementation of IDataReader might look like:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;public class ObjectDataReader&lt;tdata&gt; : IDataReader&lt;/tdata&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;private IEnumerator&lt;tdata&gt; dataEnumerator;&lt;/tdata&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;public ObjectDataReader(IEnumerable&lt;tdata&gt; data)&lt;/tdata&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; this.dataEnumerator = data.GetEnumerator();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;The constructor takes an enumerable of whatever generic type the data reader is constructed with. This is used to get an enumerator that will be used to iterate through the data.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;public bool Read()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;if (this.dataEnumerator == null)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; throw new ObjectDisposedException(&quot;ObjectDataReader&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;return this.dataEnumerator.MoveNext();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;Other than making sure the instance hasn’t been disposed, Read just moves the enumerator onto the next item and returns the result of doing so. This will be true if there was another item to move to, or false if the enumerator has run&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;out of items.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;public void Dispose()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;this.Dispose(true);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;GC.SuppressFinalize(this);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;protected virtual void Dispose(bool disposing)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;if (disposing)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if (this.dataEnumerator != null)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.dataEnumerator.Dispose();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.dataEnumerator = null;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;The dispose methods follow the standard Dispose pattern – the only thing that needs cleaning up there is the enumerator that was created during the constructor call.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;public void Close()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;this.Dispose();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;public bool IsClosed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&amp;nbsp; &amp;nbsp;get { return this.dataEnumerator == null; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
IsClosed just checks to see if the data reader has been disposed by checking if the enumerator is null, and Close is just a wrapper for Dispose. As an aside, I don’t really like there being two ways to dispose an object, but it’s in the interface so it’s best to implement it.&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
The rest of the IDataReader members (&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;GetSchemaTable&lt;/b&gt;,&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;NextResult&lt;/b&gt;,&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Depth&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;RecordsAffected&lt;/b&gt;) aren’t relevant to this implementation.&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
There’s nothing really complicated there; all the code does so far is iterate through the values yielded by an enumerator, which is nothing more than a foreach statement can do for us. That’s why we have to implement IDataRecord as well, and this is where the fun starts.&lt;/div&gt;
&lt;h2 style=&quot;border: 0px; clear: none; color: #2e2e2e; font-family: Arial; font-size: 1.3em; margin: 10px 0px 5px; padding: 5px 0px;&quot;&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;using IDataRecord&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
The IDataRecord interface provides access to the values held within the current record the IDataReader is pointing to. In a traditional sense IDataRecord would be responsible for returning values from the columns returned by a database query or the columns in a data table. This column-centric view of the world is a bit of a problem, as you’ll see very shortly.&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; font-weight: normal; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
The&amp;nbsp;IDataRecord&amp;nbsp;interface contains a lot of members, but most of them aren’t called during the SqlBulkCopy process. In fact, of the 24 properties and methods it defines, only 3 need to be implemented:&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;int FieldCount { get; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;int GetOrdinal(string name)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;object GetValue(int i)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
GetValue is the most important method as it is the one that SqlBulkCopy calls to get values from each of the properties. Notice that GetValue only takes an integer parameter: the ordinal position of the&amp;nbsp;&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;column&amp;nbsp;&lt;/i&gt;to read. This is the problem I alluded to earlier as this doesn’t make much sense in an object-based context where properties need to be read.&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
FieldCount is just used to return the number of columns (or properties) on the current record and GetOrdinal is a method that supports GetValue by providing the ordinal index for a column/property name.&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
So somehow you need to map the properties of the class to an ordinal index value. The first step to accomplishing this is to use reflection to find all the readable properties on the type of class:&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;public ObjectDataReader(IEnumerable&lt;tdata&gt; data)&lt;/tdata&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;this.dataEnumerator = data.GetEnumerator();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;var propertyAccessors = typeof(TData)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .GetProperties(BindingFlags.Instance | BindingFlags.Public)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .Where(p =&amp;gt; p.CanRead)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .Select((p, i) =&amp;gt; new&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Index = i,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Property = p,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Accessor = CreatePropertyAccessor(p)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .ToArray();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;This ugly looking code creates an anonymous type for each property defined on TData, comprising the ordinal index of the property, the PropertyInfo for the property and an accessor for the property created by a method called CreatePropertyAccessor. CreatePropertyAccessor is a method that takes a PropertyInfo and creates a delegate capable of reading from the property for an instance of the class. You’ll see this method implemented shortly.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 1.5em; margin-bottom: 10px; padding: 0px;&quot;&gt;
The rest of the constructor just creates two lookups:&lt;/div&gt;
&lt;ul style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 10px; padding: 0px 0px 0px 30px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;The first is an array of the property accessors – these are stored in the order they were discovered in the class, i.e. ordinal order.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;The second is a dictionary keyed on property names, the values being the ordinal index of the property in the array lookup.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;div&gt;
this.accessors = propertyAccessors.Select(p =&amp;gt; p.Accessor).ToArray();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;this.ordinalLookup = propertyAccessors.ToDictionary(&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; p =&amp;gt; p.Property.Name,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; p =&amp;gt; p.Index,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; StringComparer.OrdinalIgnoreCase);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;line-height: 18.239999771118164px;&quot;&gt;We now have enough information to implement the three methods of IDataRecord. FieldCount is simple – it’s just the number of property accessors that have been generated.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;line-height: 18.239999771118164px;&quot;&gt;&lt;div&gt;
public int FieldCount&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;get { return this.accessors.Length; }&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
GetOrdinal is just a case of looking up in the dictionary to obtain the ordinal index of the property with the given name. Just to be safe there’s a check to ensure that there is a property with a matching name.&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
public int GetOrdinal(string name)&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;int ordinal;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;if (!this.ordinalLookup.TryGetValue(name, out ordinal))&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; throw new InvalidOperationException(&quot;Unknown parameter name &quot; + name);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;return ordinal;&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
GetValue simply gets the accessor at the given ordinal index and executes it, passing in the current instance of the class. The accessor will return the value of the property.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
public object GetValue(int i)&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;if (this.dataEnumerator == null)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; throw new ObjectDisposedException(&quot;ObjectDataReader&quot;);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;return this.accessors[i](this.dataEnumerator.Current);&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2 style=&quot;border: 0px; clear: none; font-size: 1.3em; line-height: normal; margin: 10px 0px 5px; padding: 5px 0px;&quot;&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Creating the accessors&lt;/b&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;In theory, having the PropertyInfo for the class’s properties would be enough for us to read property values as we could just use&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-weight: normal; margin: 0px; padding: 0px;&quot;&gt;PropertyInfo.GetValue&lt;/i&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;. However given that there is an overhead with using reflection and performance is a consideration, CreatePropertyAccessor generates an accessor that is compiled at runtime for each of the properties using expression trees. Here’s the implementation:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;div&gt;
private Func&lt;tdata object=&quot;&quot;&gt; CreatePropertyAccessor(PropertyInfo p)&lt;/tdata&gt;&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;// Define the parameter that will be passed - will be the current object&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;var parameter = Expression.Parameter(typeof(TData), &quot;input&quot;);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;// Define an expression to get the value from the property&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;var propertyAccess = Expression.Property(parameter, p.GetGetMethod());&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;// Make sure the result of the get method is cast as an object&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;var castAsObject = Expression.TypeAs(propertyAccess, typeof(object));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;// Create a lambda expression for the property access and compile it&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;var lamda = Expression.Lambda&lt;func ata=&quot;&quot; object=&quot;&quot;&gt;&amp;gt;(castAsObject, parameter);&lt;/func&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;return lamda.Compile();&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2 style=&quot;border: 0px; clear: none; font-size: 1.3em; line-height: normal; margin: 10px 0px 5px; padding: 5px 0px;&quot;&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Using ObjectDataReader&lt;/b&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Here’s a demo command line application illustrating how the ObjectDataReader class could be used in conjunction with SqlBulkCopy to insert a randomly generated set of people into the MostWanted database:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;div&gt;
namespace SqlBulkCopyExample&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;using System;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;using System.Collections.Generic;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;using System.Data;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;using System.Data.SqlClient;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;using System.Linq;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;class Program&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var people = CreateSamplePeople();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using (var connection = new SqlConnection(&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Server=.;Database=MostWanted;Integrated Security=SSPI&quot;))&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var bulkCopy = new SqlBulkCopy(connection);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bulkCopy.DestinationTableName = &quot;Person&quot;;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bulkCopy.ColumnMappings.Add(&quot;Name&quot;, &quot;Name&quot;);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bulkCopy.ColumnMappings.Add(&quot;DateOfBirth&quot;, &quot;DateOfBirth&quot;);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection.Open();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (var dataReader = new ObjectDataReader&lt;person&gt;(people))&lt;/person&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bulkCopy.WriteToServer(dataReader);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; private static IEnumerable&lt;person&gt; CreateSamplePeople(int count)&lt;/person&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Enumerable.Range(0, count)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Select(i =&amp;gt; new Person&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Name = &quot;Person&quot; + i,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DateOfBirth = new DateTime(&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1950 + (i % 50),&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((i * 3) % 12) + 1,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((i * 7) % 29) + 1)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2e2e2e; font-family: Arial; font-size: 12px; line-height: 18.239999771118164px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/1086807545399341189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/how-to-sqlbulkcopy-for-high-performance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/1086807545399341189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/1086807545399341189'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/how-to-sqlbulkcopy-for-high-performance.html' title='How to SqlBulkCopy for high performance inserts in .Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-67836050818414173</id><published>2014-03-19T08:35:00.003-07:00</published><updated>2014-03-19T08:47:17.704-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><title type='text'>What is Master Page In Asp.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;What is Master Page In Asp.Net&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
A Master page offers a template for one or more web forms. It defines placeholders for the content, which can be overridden by the content pages. The content pages contains only content. When users request the content page, ASP.NET merges the layout of the master page with the content of the content page and produce output.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Advantages of using Master Page in ASP.NET&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Master pages enables consistent and standardized layout to the website.You can make layout changes of the site in the master page instead of making change in the pages.It is very easy to implement&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;How to create Multiple Master Page&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
In ASP.NET, you can have multiple master pages each for a different purpose.You can provide users several layout options using Multiple Master Page. You can define Master Page at multiple places in the web application.&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;We can specify page-level using the @Page directive.&lt;/li&gt;
&lt;li&gt;We can specify using the Web.config&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/67836050818414173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/what-is-master-page-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/67836050818414173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/67836050818414173'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/what-is-master-page-in-aspnet.html' title='What is Master Page In Asp.Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1169934094086970873.post-4981418417827760844</id><published>2014-03-16T03:32:00.000-07:00</published><updated>2014-03-16T03:32:51.129-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><title type='text'>Dynamic Data Provider(DDP) and EntityDataSource Control for EF6</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19.5px;&quot;&gt;&lt;span style=&quot;color: #424242; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Dynamic Data Provider(DDP) and EntityDataSource&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19.5px;&quot;&gt;&lt;span style=&quot;color: #424242; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Control for Entity Framework 6&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;Microsoft has announced an update to ASP.NET DynamicData and EntityDataSource control, so that they work with Entity Framework 6.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h2 style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.35em; line-height: 20px;&quot;&gt;
How to install this preview&lt;/h2&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
You can download this preview for ASP.NET DynamicData.EFProvider (&lt;a href=&quot;http://www.nuget.org/packages/Microsoft.AspNet.DynamicData.EFProvider/&quot; style=&quot;color: #707070; outline: none; text-decoration: none;&quot;&gt;http://www.nuget.org/packages/Microsoft.AspNet.DynamicData.EFProvider/&lt;/a&gt;) and EntityDataSource (&lt;a href=&quot;http://www.nuget.org/packages/Microsoft.AspNet.EntityDataSource/&quot; style=&quot;color: #707070; outline: none; text-decoration: none;&quot;&gt;http://www.nuget.org/packages/Microsoft.AspNet.EntityDataSource/&lt;/a&gt;) as preview NuGet packages from the NuGet gallery. You can install these pre-release packages through NuGet using the NuGet Package Manager Console, like this:&lt;/div&gt;
&lt;ul style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;
&lt;li&gt;Install-Package Microsoft.AspNet.DynamicData.EFProvider -Version 6.0.0-alpha1 –Pre&lt;/li&gt;
&lt;li&gt;Install-Package Microsoft.AspNet.EntityDataSource -Version 6.0.0-alpha1 –Pre&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;h3 style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.15em; line-height: 18px;&quot;&gt;
Microsoft.AspNet.DynamicData.EFProvider&lt;/h3&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
This package has a DynamicData EFProvider for Entity Framework 6. This provider can work with a Model (either Code First or EF Designer) which was created using Entity Framework 6. This package also installs the Page Templates, Entity Templates and Field Templates which are required for DynamicData. The templates have been updated to use&lt;strong&gt;Microsoft.AspNet.EntityDataSource&lt;/strong&gt;&amp;nbsp;control which we are also previewing today as well.&lt;/div&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
Following are the steps for using this package in a ASP.NET DynamicData application:&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a new ASP.NET Dynamic Data Entities Web Application&lt;/li&gt;
&lt;li&gt;Add the Microsoft.AspNet.DynamicData.EFProvider NuGet package&lt;/li&gt;
&lt;li&gt;This will do the following&lt;ol&gt;
&lt;li&gt;Add a reference to the DynamicData EFProvider binary&lt;/li&gt;
&lt;li&gt;Install the templates. If you are starting with a new project, then you can override the templates. If you have an existing application, then you should be careful when overriding the changes. The templates replace the EntityDataSource control which shipped in .NET with Microsoft.AspNet.EntityDataSource and also have a few bug fixes in the Many-Many field template so they work with Entity Framework 6.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Create your model using Entity Framework Code First or EF Designer.&lt;/li&gt;
&lt;li&gt;Add the following code in RegisterRoutes in Global.asax.cs to register your EF Model:&lt;pre&gt;DefaultModel.RegisterContext(
    new Microsoft.AspNet.DynamicData.ModelProviders.EFDataModelProvider(
        () =&amp;gt; newNorthwindEntities1()),
    newContextConfiguration { ScaffoldAllTables = true });&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Run the project&lt;/li&gt;
&lt;li&gt;You would see all the tables listed on the Default page.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;h3 style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.15em; line-height: 18px;&quot;&gt;
Microsoft.AspNet.EntityDataSource Control&lt;/h3&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
This is an update to the EntityDataSource control which shipped in the .NET Framework. The EntityDataSource control has been updated to work with Entity Framework 6.&lt;/div&gt;
&lt;div style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-top: 12px;&quot;&gt;
To use this control, please do the following&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create an ASP.NET application&lt;/li&gt;
&lt;li&gt;Install the package&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;Microsoft.AspNet.EntityDataSource&lt;ol&gt;
&lt;li&gt;This package will&lt;ol&gt;
&lt;li&gt;install the runtime binary for&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;Microsoft.AspNet.EntityDataSource&lt;/li&gt;
&lt;li&gt;Install the EntityFramework version 6 NuGet package&lt;/li&gt;
&lt;li&gt;Add the following tag prefix in web.config&lt;pre&gt;&lt;pages&gt; 
  &lt;controls&gt; 
    &lt;add br=&quot;&quot;&gt;      tagPrefix=&quot;ef&quot; 
      assembly=&quot;Microsoft.AspNet.EntityDataSource&quot; 
      namespace=&quot;Microsoft.AspNet.EntityDataSource&quot; /&amp;gt; 
  &lt;/add&gt;&lt;/controls&gt; 
&lt;/pages&gt; &lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Create a new Web Form page&lt;/li&gt;
&lt;li&gt;Use the control as follows and bind it to any Databound control such as GridView, FormView etc.&lt;pre&gt;&lt;ef:entitydatasource enabledelete=&quot;true&quot; id=&quot;GridDataSource&quot; runat=&quot;server&quot;&gt; &lt;/ef:entitydatasource&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;h2 style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.35em; line-height: 20px;&quot;&gt;
Known Issues&lt;/h2&gt;
&lt;ul style=&quot;color: #424242; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;
&lt;li&gt;The templates in Microsoft.AspNet.DynamicData.EFProvider are for C# only.&lt;/li&gt;
&lt;li&gt;The templates in Microsoft.AspNet.DynamicData.EFProvider are for Web Application projects only and will not work for WebSites projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnethope.blogspot.com/feeds/4981418417827760844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnethope.blogspot.com/2014/03/dynamic-data-providerddp-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4981418417827760844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1169934094086970873/posts/default/4981418417827760844'/><link rel='alternate' type='text/html' href='http://dotnethope.blogspot.com/2014/03/dynamic-data-providerddp-and.html' title='Dynamic Data Provider(DDP) and EntityDataSource Control for EF6'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14298510030894986948</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>