<?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-191832781286093326</id><updated>2024-09-01T21:04:52.287-07:00</updated><category term="Javascript"/><category term=".Net"/><category term="LINQ XSD XML .NET"/><category term="XSLT transformation"/><category term="Yahoo Financial API"/><category term="ASP.net"/><category term="C#"/><category term="Dataset"/><category term="Ext Js"/><category term="ExtJS"/><category term="HTTPModule"/><category term="Prototype framework"/><category term="Sending Email"/><category term="Stock"/><category term="Winform"/><category term="Zedgraph"/><title type='text'>.Net and Client Technologies</title><subtitle type='html'>Coding C# and client side techniques</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-191832781286093326.post-4509556631527445077</id><published>2019-08-05T05:14:00.001-07:00</published><updated>2019-08-05T05:14:48.767-07:00</updated><title type='text'>Amazing Leading Quality Book</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Many developers start to create product without paying a proper attention to QA.&lt;br /&gt;
If you want to avoid this problem and in short period of time understand&lt;br /&gt;
wisdom about quality in today’s IT world, this book is for you.&lt;br /&gt;
An essential lesson in how to differentiate your product and business with quality&lt;br /&gt;
&lt;br /&gt;
Look in Amazon Store and it&#39;s actually free&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/4509556631527445077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2019/08/amazing-leading-quality-book.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/4509556631527445077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/4509556631527445077'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2019/08/amazing-leading-quality-book.html' title='Amazing Leading Quality Book'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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-191832781286093326.post-5024226654009029320</id><published>2011-10-26T10:26:00.000-07:00</published><updated>2011-10-26T10:30:38.654-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net"/><category scheme="http://www.blogger.com/atom/ns#" term="HTTPModule"/><title type='text'>Measure your site performance (HTTPModule)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1&gt;







Preface
&lt;/h1&gt;
When creating a web site or web service , often you wonder how to measure request life cycle. May be you wonder if requested or web service ended at all.&amp;nbsp;In order to do it we will look in feature that .Net framework expose to us, &quot;HTTPModule&quot; &amp;nbsp;.&lt;br /&gt;
&lt;h1&gt;





HTTPModule&lt;/h1&gt;
&lt;div&gt;
So what is HTTPModule ? &amp;nbsp;Picture for example water filter. &amp;nbsp;When water flowing from the crane , it&#39;s coming to some filter , filter doing some stuff with it ,and it&#39;s coming to your glass. The same mechanism is with the &quot;HTTP&quot; module . When you are requesting&amp;nbsp;some page, you can write you own filter that will be invoked before beginning processing the page.&amp;nbsp;And will pass page to parser that will process Asp. page.&lt;/div&gt;
&lt;h1&gt;



Implementation&lt;/h1&gt;
In order to implement filter we need to create a new class that will inherit from   IHttpModule&lt;b&gt; interface.&lt;/b&gt;

&lt;br /&gt;
Than we need to implement Init function of the interface . Please see example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; public void Init(HttpApplication httpApplication)&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // register for events created by the pipeline&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpApplication.BeginRequest += new EventHandler(this.OnBeginRequest);&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpApplication.EndRequest += new EventHandler(this.OnEndRequest);&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
When implementing the Init function we will&amp;nbsp;subscribe&amp;nbsp;to HTTPApplication events.&lt;br /&gt;
Like in the example below we subscribed to Begin and End &amp;nbsp;Request.&lt;br /&gt;
&lt;br /&gt;
So when we will request specific page before process the page we will enter&lt;br /&gt;
to&amp;nbsp;OnBeginRequest function . After the request ended &amp;nbsp;OnEndRequest function&lt;br /&gt;
will be called.&lt;br /&gt;
&lt;br /&gt;
See all various events that we can&amp;nbsp;subscribe&amp;nbsp;to&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;position: inherit;&quot;&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;AcquireRequestState&lt;/b&gt;: &amp;nbsp;event will be called to allow the module to acquire or create the state (for example, session) for the request.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;AuthenticateRequest&lt;/b&gt;: &amp;nbsp;event will be called when a security module needs to authenticate the user before it processes the request.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;AuthorizeRequest&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;by a security module when the request needs to be authorized. Called after authentication.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;BeginRequest&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;to notify a module that new request is beginning.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;Disposed&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;to notify the module that the application is ending for some reason. Allows the module to perform internal cleanup.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;EndRequest&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;to notify the module that the request is ending.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;Error&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;to notify the module of an error that occurs during request processing.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;PostRequestHandlerExecute&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;to notify the module that the handler has finished processing the request.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;PreRequestHandlerExecute&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;to notify the module that the handler for the request is about to be called.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;PreSendRequestContent&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;to notify the module that content is about to be sent to the client.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;PreSendRequestHeaders&lt;/b&gt;: Call this event to notify the module that the HTTP headers are about to be sent to the client.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;ReleaseRequestState&lt;/b&gt;: Call this event to allow the module to release state because the handler has finished processing the request.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;ResolveRequestCache&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;after authentication. Caching modules use this event to determine if the request should be processed by its cache or if a handler should process the request.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;&lt;b&gt;UpdateRequestCache&lt;/b&gt;:&amp;nbsp;event will be called&amp;nbsp;&amp;nbsp;after a response from the handler. Caching modules should update their cache with the response.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
In our example we subscribed only to Begin and End Request. See the event handler functions&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;public void OnBeginRequest(object o, EventArgs args)&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; beginrequest = DateTime.Now;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Trace.Write(string.Format(&quot;Request started at {0}&quot;, DateTime.Now));&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void OnEndRequest(object obj, EventArgs args)&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // get the time elapsed for the request&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TimeSpan elapsedtime = DateTime.Now - beginrequest;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Trace.Write(string.Format(&quot;Request ended at {0}&quot;, DateTime.Now));&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Trace.Write(string.Format(&quot;Elapsed time {0}&quot;, elapsedtime));&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
And final step , we need to declare about our model in web config . In order&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
to declare need to add following row&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;RequestInspector&quot; type=&quot;&lt;b&gt;Namespace.Class&lt;/b&gt;,&lt;b&gt;Assembly&lt;/b&gt;&quot;/&amp;gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Please see example below&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;lt;httpModules&amp;gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;RequestInspector&quot; type=&quot;RequestInspectorNamespace.RequestInspector,RequestInspectorAssembly&quot;/&amp;gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/httpModules&amp;gt;&lt;/i&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;div&gt;
You can download &amp;nbsp;&lt;a href=&quot;http://depositfiles.com/files/toccjepgq?redirect&quot;&gt;Source Code&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/5024226654009029320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/10/measure-your-site-performance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/5024226654009029320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/5024226654009029320'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/10/measure-your-site-performance.html' title='Measure your site performance (HTTPModule)'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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-191832781286093326.post-6274124206544920901</id><published>2011-09-28T02:46:00.000-07:00</published><updated>2011-10-04T08:23:52.919-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="Sending Email"/><title type='text'>Send email easily</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;




&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Preface&lt;/span&gt;&lt;/h2&gt;
Sending email in .Net it&#39;s not complicated thing . You can do it via config file or via code. &lt;br /&gt;
But we will create an &lt;strong&gt;email sender&lt;/strong&gt; compoment that will&amp;nbsp;encapsulate the process of sending email.&lt;br /&gt;
In future we will use this component in order to send a stock graph in program that we created&lt;br /&gt;
&lt;div&gt;
in &lt;strong&gt;&lt;a href=&quot;http://gregnozik.blogspot.com/2011/09/see-money-on-your-screen.html&quot;&gt;previous blog.&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;




&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Implementation&lt;/span&gt;&lt;/h2&gt;
Lets start our desing with the UML . &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/AVvXsEi8ANIvuTuSbN3Gwx-SjeZHwGeeSFwc6ZFZsccCRys_iOj6tJzefwNM8rtqKrGnte6OVP2i6Vrmo_V-6z15TLeSnxzy4t-xyb5db-5LGmJ8lhpxf0ic20Fawwg6EPqJrm2pkwDILW6XlRQ/s1600/email.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;174&quot; kca=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8ANIvuTuSbN3Gwx-SjeZHwGeeSFwc6ZFZsccCRys_iOj6tJzefwNM8rtqKrGnte6OVP2i6Vrmo_V-6z15TLeSnxzy4t-xyb5db-5LGmJ8lhpxf0ic20Fawwg6EPqJrm2pkwDILW6XlRQ/s320/email.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
First we create base class&amp;nbsp; &quot;SMTPBase&quot;. The class will implement IDisposable interface.&lt;br /&gt;
The interface will help to Garbage Collector to free resources that were allocated by this object.&lt;br /&gt;
&lt;br /&gt;
The class will have a basic functionality to send emails. We will define properties such as :&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;From&amp;nbsp; - sender email&lt;/li&gt;
&lt;li&gt;To&amp;nbsp; -&amp;nbsp;recipient email&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Subject - email subject &lt;/li&gt;
&lt;li&gt;SmtpHost&amp;nbsp; - smtp server host&lt;/li&gt;
&lt;li&gt;Port - smtp port&lt;/li&gt;
&lt;li&gt;Body - email text&lt;/li&gt;
&lt;li&gt;Attachment - files that we want to attach to the email&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp;Of course we need to include validation if email valid or not. The most effective way&amp;nbsp; to do it &lt;br /&gt;
&amp;nbsp;is by regular expression.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Regex&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; re = &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Regex&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;@&quot;\w.\w@{1,1}\w[.\w]?.\w&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;);&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; re.IsMatch(email);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Email can be send using Gmail or Hotmail accout. We will define an Enum that will holds various account types and we will call it &quot;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SMTPHostType&quot;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;At the end we will create the service class that will send an email. Of course&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;the class will inherit from our base class. We will call it &quot;SMTPSender&quot;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;The class will have several constructors&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;Constructor that receives host and port&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; SMTPSender(&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; host, &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; port) : &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;(host, port) { }&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Constuctor that will receive Host type Like Google or Hotmail&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; SMTPSender(&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SMTPHostType&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; smtpHost) : &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;(smtpHost ) { }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Here is a sample code that can be used in order to send an email.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SMTPSender&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; smtpSender = &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SMTPSender&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SMTPHostType&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.HOTMAIL, &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;john@hotmail.com&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;johnpass&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;))&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;john@gmail.com&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;john@gmail.com&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.Empty, &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Subject&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Text Body&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;br /&gt;
&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: large;&quot;&gt;
All the code can be &lt;a href=&quot;http://depositfiles.com/files/mdho3ihjw&quot;&gt;dowloaded from here.&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;




&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Summary&lt;/span&gt;&lt;/h2&gt;
We created in this blog component that knows how to send emails using .Net . &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/6274124206544920901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/send-email-easily.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6274124206544920901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6274124206544920901'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/send-email-easily.html' title='Send email easily'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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/AVvXsEi8ANIvuTuSbN3Gwx-SjeZHwGeeSFwc6ZFZsccCRys_iOj6tJzefwNM8rtqKrGnte6OVP2i6Vrmo_V-6z15TLeSnxzy4t-xyb5db-5LGmJ8lhpxf0ic20Fawwg6EPqJrm2pkwDILW6XlRQ/s72-c/email.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-191832781286093326.post-3854287992524186230</id><published>2011-09-23T06:00:00.000-07:00</published><updated>2011-09-25T22:36:32.751-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Dataset"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ XSD XML .NET"/><title type='text'>GetXml dataset method not good enough</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;



&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;
Preface&lt;/span&gt;&lt;/h2&gt;
Dataset class has&amp;nbsp;&lt;span class=&quot;typ&quot;&gt;GetXml method&lt;/span&gt;. The method takes data and creates XML.The problem is that you cannot change &amp;nbsp;XML that created by function &amp;nbsp;For example &amp;nbsp;if you created SQL statement&lt;br /&gt;
&lt;br /&gt;
Select PersonId,PersonName from Employee.&lt;br /&gt;
&lt;br /&gt;
You will get following XML&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;newdataset&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;table1&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;personId&amp;nbsp;&amp;gt;354&amp;lt;/personId&amp;nbsp;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;personName&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;gt;Jhon&amp;lt;/&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;personName&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/table1&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;/newdataset&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
But if you want to change it to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;newdataset&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Persons&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Person&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;personId = 354 personName=&quot;Jhon&quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/Persons&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;lt;/newdataset&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
You cannot do it.&lt;br /&gt;
&lt;br /&gt;
The other problem that can happen, that if SQL statement includes Left Outer Join, and one of the field&lt;br /&gt;
will be Null, the field will not be included in XML.&lt;br /&gt;
&lt;br /&gt;
In order to solve these issus I created my &quot;GetXml&quot; function . You can customize your code any way you like.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;

&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;












Implementation&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
Basically I needed to implemented this function when I created statefull mechanism between client and server. So I needed to add in each row field &quot;StateId&quot; that will show the status of the row.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So here is the code&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;GetXmlFromDataset&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataSet&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dataSet&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;bool&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; isStatefull&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;XmlTextWriter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; xwriter &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;XmlTextWriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MemoryStream&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Encoding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;UTF8&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteStartElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;NewDataSet&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;//start enumerate in table collection&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataTable&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dt &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dataSet &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Tables&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rowNum &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tmp &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MinValue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;isStatefull&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataColumn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;IsDummy&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;typeof&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;bool&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;isStatefull &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Rows&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Count&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Rows&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;NewRow&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Rows&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;IsDummy&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;//start enumerate in rows collection&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataRow&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Rows&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;//start &amp;lt;Table&amp;gt; element&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteStartElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;TableName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;isStatefull&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteAttributeString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;stat&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteAttributeString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;rowNum&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rowNum&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tmpDate &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MinValue&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;//start enumerate in columns collection&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataColumn&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dc &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Table&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;kwd&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; colValue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Empty&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&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 class=&quot;kwd&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataType&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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;/span&gt;&lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;DateTime&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;TryParse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataRowVersion&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tmpDate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; colValue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tmpDate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;yyyy-MM-ddTHH:mm:ss&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &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; colValue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataRowVersion&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&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;/span&gt;&lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; colValue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataRowVersion&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&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 class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteStartElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ColumnName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Replace&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;_x0020_&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; isStatefull &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Compare&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataType&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;string&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteAttributeString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;datatype&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;DataType&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;isStatefull&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteAttributeString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;stat&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&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 class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;colValue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteEndElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;//end &amp;lt;Table&amp;gt; element&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteEndElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rowNum&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;//end &amp;lt;NewDataSet&amp;gt; element&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteEndElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Flush&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;BaseStream&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Seek&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;SeekOrigin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Begin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;StreamReader&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; reader &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;StreamReader&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;BaseStream&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; reader&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ReadToEnd&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;xwriter &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xwriter &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
The code iterates over the tables&amp;nbsp;and build XML accrodingly.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;

&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;





Summary
&lt;/span&gt;&lt;/h2&gt;
We learned in this post how to write custom &quot;GetXml&quot; function.
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/3854287992524186230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/getxml-dataset-method-not-good-enough.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/3854287992524186230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/3854287992524186230'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/getxml-dataset-method-not-good-enough.html' title='GetXml dataset method not good enough'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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-191832781286093326.post-2662560597176455466</id><published>2011-09-23T01:00:00.000-07:00</published><updated>2011-10-24T01:01:29.113-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Yahoo Financial API"/><title type='text'>Yahoo Download Stock Data</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1&gt;


















Preface&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Almost everyone knows that Yahoo has API to retrieve financial data.We will write a client that will&lt;br /&gt;
consume Yahoo API to retrieve history stock data. Let&#39;s start to develop set of classes&lt;br /&gt;
that will handle required functionality.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h1&gt;

















Implementation&lt;/h1&gt;
&lt;/div&gt;
First we define an Enum that holds different period types. The name of the class &quot;PeriodType&quot;.&lt;br /&gt;
Yahoo stock data can be retrieved for various period types. It can be daily,monthly and etc..&lt;br /&gt;
Than we will define a class that holds information about single piece of data.&lt;br /&gt;
If we will request daily data , than class will holds single day, and if we request data by month&lt;br /&gt;
it will holds single month . The class name &quot;Bar&quot;.&lt;br /&gt;
&lt;br /&gt;
The main class that uses Yahoo API is class that named &quot;YahooHistoryDownloader&quot;. &lt;br /&gt;
The class knows how to retrieve a stock data for different periods and different intervals.&lt;br /&gt;
The main function &quot;GetBarHistory&quot;&amp;nbsp; .&lt;br /&gt;
Input parameters:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;string stockName&amp;nbsp; - ticker name of the stock . &quot;GOOG&quot; for example.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;PeriodType periodType - enum that represent interval&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;DateTime frDate - start date&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;DateTime toDate -&amp;nbsp; from date&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
In order to test I created a console application that will print&amp;nbsp; the downloaded data to console.&lt;br /&gt;
The test function knows how to download data for the half year.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp; private static void GetDataFromStock(string stockName,PeriodType periodType)&lt;br /&gt;&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; YahooHistoryDownloader historyDown = new YahooHistoryDownloader();&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; List&amp;lt;Bar&amp;gt; listBar = historyDown.GetBarHistory(stockName,periodType, DateTime.Now.AddMonths(-6), DateTime.Now);&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; foreach (Bar bar in listBar)&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; Console.WriteLine(bar);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
In order to use it&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; string stockName = &quot;GOOG&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; GetDataFromStock(stockName, PeriodType.Weekly );&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Than you can&amp;nbsp;collect the stock data and&amp;nbsp;develop your&lt;/strong&gt;&amp;nbsp; &lt;a href=&quot;http://6a16bdt7q-e-ks8-2tv41numzy.hop.clickbank.net/?tid=5TM6VGJH&quot; target=&quot;_top&quot;&gt;trading strategy&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Here is UML &lt;/span&gt;&lt;/span&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/AVvXsEg9_5W_-cbqlnfx0VdsfKEdWze2CyNcA47jIE0dHtTG4CllMTh4eAwb2gWNQXqJf0Hny4kA3xmz9YRujUt4hm2ATQOKJmrO-CJwi4Gyw-ZCzK1VP_SI5OMeF-2IPGO3seG1BHCtQ-fF2ns/s1600/UML.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9_5W_-cbqlnfx0VdsfKEdWze2CyNcA47jIE0dHtTG4CllMTh4eAwb2gWNQXqJf0Hny4kA3xmz9YRujUt4hm2ATQOKJmrO-CJwi4Gyw-ZCzK1VP_SI5OMeF-2IPGO3seG1BHCtQ-fF2ns/s320/UML.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;All the code can be downloaded from here&lt;/span&gt; -&amp;nbsp;&lt;a href=&quot;http://depositfiles.com/files/h9qm2fxrj&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Download&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Please see how this component can be used to display stock graph in my next blog &lt;a href=&quot;http://gregnozik.blogspot.com/2011/09/see-money-on-your-screen.html&quot;&gt;Click here !&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/2662560597176455466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/yahoo-finance-api_23.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/2662560597176455466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/2662560597176455466'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/yahoo-finance-api_23.html' title='Yahoo Download Stock Data'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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/AVvXsEg9_5W_-cbqlnfx0VdsfKEdWze2CyNcA47jIE0dHtTG4CllMTh4eAwb2gWNQXqJf0Hny4kA3xmz9YRujUt4hm2ATQOKJmrO-CJwi4Gyw-ZCzK1VP_SI5OMeF-2IPGO3seG1BHCtQ-fF2ns/s72-c/UML.JPG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-191832781286093326.post-6184752617655760293</id><published>2011-09-21T22:18:00.000-07:00</published><updated>2011-10-04T02:06:28.307-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Stock"/><category scheme="http://www.blogger.com/atom/ns#" term="Winform"/><category scheme="http://www.blogger.com/atom/ns#" term="Yahoo Financial API"/><category scheme="http://www.blogger.com/atom/ns#" term="Zedgraph"/><title type='text'>See stock on your screen.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;


&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;

Preface&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;I think that if you intrested in stock trading , and you want to see the graph of you favorite stock,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;you will like this blog for sure !&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Please see the GUI of our next program.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;We will&amp;nbsp;build a program that will display a stock data. In the progran &lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;you will enter Ticker Name, From Date, End Date and the program&amp;nbsp;display the data in a graph.&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif; font-size: large;&quot;&gt;We will use &amp;nbsp;Yahoo download component &amp;nbsp;that I posted&amp;nbsp;&lt;a href=&quot;http://gregnozik.blogspot.com/2011/09/yahoo-finance-api_23.html&quot;&gt;in other blog&lt;/a&gt;.&lt;/span&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/AVvXsEgknQpOIN8rGyapJv9x75bF9gVw1ZPi-uoKWm-lBcyMo0APLv3M-q6_GfPblGPnYVfYIWWXoE7qWTFbCGVFW33kJipngNBs9sTRUqLf7Kju8RlhNeOCBdiRw4KYQPAqKVC6Q3G6zUDZwaE/s1600/ProgramView.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgknQpOIN8rGyapJv9x75bF9gVw1ZPi-uoKWm-lBcyMo0APLv3M-q6_GfPblGPnYVfYIWWXoE7qWTFbCGVFW33kJipngNBs9sTRUqLf7Kju8RlhNeOCBdiRw4KYQPAqKVC6Q3G6zUDZwaE/s1600/ProgramView.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgknQpOIN8rGyapJv9x75bF9gVw1ZPi-uoKWm-lBcyMo0APLv3M-q6_GfPblGPnYVfYIWWXoE7qWTFbCGVFW33kJipngNBs9sTRUqLf7Kju8RlhNeOCBdiRw4KYQPAqKVC6Q3G6zUDZwaE/s400/ProgramView.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;


&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;

Desing&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;As every good design we will start with UML&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/AVvXsEhcrEKtyBMQthNJsA3oj-Q6SH0RE5qYTR3Hk3AkAHTQaHYflnW9qhtwssB-53KxLZlM9uJ9yvEfhR8e7Jkm622XidTanbaQy0-pu_SFlTgd2vDp1mu0Uw0OkusOft4hTd5f53wW2qSJzKU/s1600/UML.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; hca=&quot;true&quot; height=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcrEKtyBMQthNJsA3oj-Q6SH0RE5qYTR3Hk3AkAHTQaHYflnW9qhtwssB-53KxLZlM9uJ9yvEfhR8e7Jkm622XidTanbaQy0-pu_SFlTgd2vDp1mu0Uw0OkusOft4hTd5f53wW2qSJzKU/s320/UML.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;As we see in the picture we defined an Interface that called &quot;ZedGraph&quot;&amp;nbsp;. Zedgraph expose common properties &lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;of our Graph object . Please see below several of them :&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Description &lt;span style=&quot;color: black;&quot;&gt;- A description of what this demo is showing.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;li&gt;Title - Graph Title &lt;/li&gt;
&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Than we will define base graph &quot;BaseGraph&quot;&amp;nbsp;for all stock graphes. The class is abstract so no one can instance&amp;nbsp;it. &lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;The class is implemented the interface that we created above so he must impement&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;properties that we defined in interface. The main public function of the class is &quot;AddLine&quot; . The function&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;know how to display the data in the graph.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;In order to show the data we must created a class that will be inherited from the base.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;So we will create class &quot;SingleGraph&quot;. The graph will inherit from &quot;BaseGraph&quot; and the class will be responsible for charting.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;In our window form class in order to show the graph we will implement following code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YahooHistoryDownloader yahoo = new YahooHistoryDownloader();&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; List&amp;lt;StockDownloader.Bar&amp;gt; list = yahoo.GetBarHistory(stockName, from, toDate);&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; if (list.Count &amp;gt; 0)&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;&amp;nbsp;&amp;nbsp; singleGraph.ClearGraph();&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; singleGraph.AddLine(singleGraph.GraphPane, list, Action.Add, Color.Red, stockName);&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; singleGraph.ZedGraphControl.AxisChange();&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; singleGraph.ZedGraphControl.Refresh();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Our task is complete &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;I prepare for you code that you can play with it .&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Code can be downloaded from &lt;/span&gt;&lt;a href=&quot;http://depositfiles.com/files/avp1ylihc&quot;&gt;this location.&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;


&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;

Summary&lt;/span&gt;&lt;/h2&gt;
We wanted to see the stock data and see how our stock do today.&lt;br /&gt;
So we created simple design how to do it and implement it as window form.&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;In my next blogs we will define stock with indicator, so it will be other&amp;nbsp;graph type and &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;more intresting.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/6184752617655760293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/see-money-on-your-screen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6184752617655760293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6184752617655760293'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/see-money-on-your-screen.html' title='See stock on your screen.'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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/AVvXsEgknQpOIN8rGyapJv9x75bF9gVw1ZPi-uoKWm-lBcyMo0APLv3M-q6_GfPblGPnYVfYIWWXoE7qWTFbCGVFW33kJipngNBs9sTRUqLf7Kju8RlhNeOCBdiRw4KYQPAqKVC6Q3G6zUDZwaE/s72-c/ProgramView.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-191832781286093326.post-6759147209658737291</id><published>2011-09-13T21:20:00.000-07:00</published><updated>2011-09-14T01:32:25.587-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="XSLT transformation"/><title type='text'>Compare two XSLT transformation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In my previous blog I showed two methods for XSLT transformation. See for details&amp;nbsp;&lt;a href=&quot;http://gregnozik.blogspot.com/2011/09/improving-xslt-transformation.html&quot;&gt;Previous blog&lt;/a&gt;.&lt;br /&gt;
Today I would like to compare run time of &amp;nbsp;two methods.&lt;br /&gt;
Therefore &amp;nbsp;I created big xml with the same fields as I showed in my previous blog&lt;br /&gt;
and XSL stays the same. I created method that uses &quot;transformnode&quot; approach and&lt;br /&gt;
method that uses &quot;processor&quot; approach.&lt;br /&gt;
&lt;br /&gt;
Afterwords I created a method that will run 5 &amp;nbsp;transformation at once and create a table&lt;br /&gt;
with the results. I colored in red the method which run faster.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnm8uAXEkoYTEp-GJqxhvwqERY4xSEkTnZiNos8J5PcChWaLFKPm1sg_IimXvhhsW_CKU5PNUsrV4Btf9fos4Ztj57x4ZzabtZmrH-Eknt6PTXYec5jIg_hCqB3NIKQ4fxG-2BmW5DQBM/s1600/1.bmp&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; height: 116px; margin-bottom: 1em; margin-right: 1em; width: 379px;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;138&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnm8uAXEkoYTEp-GJqxhvwqERY4xSEkTnZiNos8J5PcChWaLFKPm1sg_IimXvhhsW_CKU5PNUsrV4Btf9fos4Ztj57x4ZzabtZmrH-Eknt6PTXYec5jIg_hCqB3NIKQ4fxG-2BmW5DQBM/s400/1.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
As you see the process template is the quicker one. Please note that I did not measure CPU&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
execution time only time that took to do XML transformation.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
You can play with the source and check yourself.&amp;nbsp;All files can be downloaded from&amp;nbsp;&lt;a href=&quot;https://docs.google.com/viewer?a=v&amp;amp;pid=explorer&amp;amp;chrome=true&amp;amp;srcid=0B4m1viRAyKkgODk2YWMxMDAtYjQwOC00NWY3LTk3YjMtYjk4NTQ5ZjhhNWUx&amp;amp;hl=en_US&quot;&gt;Download&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/6759147209658737291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/compare-two-xslt-transformation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6759147209658737291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6759147209658737291'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/compare-two-xslt-transformation.html' title='Compare two XSLT transformation'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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/AVvXsEhnm8uAXEkoYTEp-GJqxhvwqERY4xSEkTnZiNos8J5PcChWaLFKPm1sg_IimXvhhsW_CKU5PNUsrV4Btf9fos4Ztj57x4ZzabtZmrH-Eknt6PTXYec5jIg_hCqB3NIKQ4fxG-2BmW5DQBM/s72-c/1.bmp" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-191832781286093326.post-602869024429264422</id><published>2011-09-13T08:39:00.000-07:00</published><updated>2011-09-13T21:23:54.255-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="XSLT transformation"/><title type='text'>Two XSLT transformation in javascript</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&gt;

Introduction.&lt;/h2&gt;
In order to execute XSLT transformation in&amp;nbsp;IE&amp;nbsp;two different javascript methods&amp;nbsp;can be done.&lt;br /&gt;
In this article I would like explain how to use each of the javascript method.&lt;br /&gt;
&lt;h2&gt;

Setup&lt;/h2&gt;
So for a start I created XML and XSL&amp;nbsp;that I will show transformation.&lt;br /&gt;
&lt;br /&gt;
XML Example&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;products&amp;gt;&lt;br /&gt;
&amp;lt;product href=&quot;&lt;a href=&quot;http://www.playfield.com/text&quot;&gt;http://www.playfield.com/text&lt;/a&gt;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name&amp;gt;Playfield Text&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;price currency=&quot;usd&quot;&amp;gt;299&amp;lt;/price&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;description&amp;gt;Faster than the competition.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/product&amp;gt;&lt;br /&gt;
&amp;lt;/product&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
XSLT Example&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;&lt;a href=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;http://www.w3.org/1999/XSL/Transform&lt;/a&gt;&quot;&amp;gt;&lt;br /&gt;
&amp;lt;xsl:output method=&quot;html&quot; indent=&quot;no&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;xsl:template match=&quot;/products&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;table&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr class=&quot;header&quot;&amp;gt;&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;lt;td&amp;gt;Name&amp;lt;/td&amp;gt;&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;lt;td&amp;gt;Price&amp;lt;/td&amp;gt;&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;lt;td&amp;gt;Description&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&amp;lt;xsl:template match=&quot;product[position() mod 2 = 1]&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;tr class=&quot;odd&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&quot;name&quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&quot;price&quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&quot;description&quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&amp;lt;xsl:template match=&quot;product&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;tr class=&quot;even&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&quot;name&quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&quot;price&quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&quot;description&quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;

The first method.&lt;/h2&gt;
The first method that can trasform XSLT is to use &quot;&lt;strong&gt;transformNode&lt;/strong&gt;&quot;&lt;br /&gt;
method of Microsoft.XMLDOM object.&lt;br /&gt;
&lt;br /&gt;
Please see below the code&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; var xml = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;); &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var xslt = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;xml.load(&quot;data.xml&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;xslt.load(&quot;transformxsl.xml&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var output = xml.transformNode(xslt);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The code is pretty simple. Need to define a two XMLDom object and invoke transform method.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;

The second method.&lt;/h2&gt;
The second method is to use with XSLTemplate.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var xml = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var xslt = new ActiveXObject(&quot;MSXML2.FreeThreadedDOMDocument&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xml.load(&quot;data.xml&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xslt.load(&quot;transformxsl.xml&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var processor&amp;nbsp;&amp;nbsp; = new ActiveXObject(&quot;Msxml2.XSLTemplate&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;processor.stylesheet = xslt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var objXSLTProc = processor.createProcessor();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;objXSLTProc.input = xml;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;objXSLTProc.transform();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var output&amp;nbsp; = objXSLTProc.output;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The object is to load XSLT need to be created from FreeThreadedDOMDocument.&lt;br /&gt;
The transformation is done by object created from Msxml2.XSLTemplate.&lt;br /&gt;
Afterwords need to invoke transform method.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;

Summary&lt;/h2&gt;
We looked in two different approaches of XSLT transformatiion.&lt;br /&gt;
On my next article, we will check which is the best solution.&lt;br /&gt;
Please follow my&amp;nbsp;&lt;a href=&quot;http://gregnozik.blogspot.com/2011/09/compare-two-xslt-transformation.html&quot;&gt;next article&lt;/a&gt;&amp;nbsp;to see the result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;

&lt;/h2&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/602869024429264422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/improving-xslt-transformation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/602869024429264422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/602869024429264422'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/improving-xslt-transformation.html' title='Two XSLT transformation in javascript'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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-191832781286093326.post-7052285817465740345</id><published>2011-09-11T06:16:00.000-07:00</published><updated>2011-09-11T06:31:26.125-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ExtJS"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>Remove mask from the Grid (ExtJS)</title><content type='html'>I created a grid using ExtJs framework. When the grid was loading , the &#39;loading...&#39;&amp;nbsp; text was displayed in &lt;br /&gt;
the screen. The text was&amp;nbsp;displayed by Extjs framework&amp;nbsp;, and I needed to remove it. In order to do it, &lt;br /&gt;
I debuged ExtJs framework and found out that the message was created by the &lt;span style=&quot;color: maroon; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
LoadMask &lt;span style=&quot;color: black;&quot;&gt;class. In order to remove the loading message&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;need to define in the class config setup of the grid,&amp;nbsp; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;viewConfig section with the &#39;loadMask:false&#39; option.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;viewConfig: {&lt;br /&gt;&amp;nbsp; loadMask:&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;}&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/7052285817465740345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/remove-mask-from-grid-extjs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/7052285817465740345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/7052285817465740345'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/remove-mask-from-grid-extjs.html' title='Remove mask from the Grid (ExtJS)'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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-191832781286093326.post-6048323641052352826</id><published>2011-09-09T14:29:00.000-07:00</published><updated>2011-09-14T03:24:09.826-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ext Js"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>Extjs S.gif</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I staretd to use Extjs library. It&#39;s really a great library with the strong features.&lt;br /&gt;
(&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #0e774a; font-family: arial,sans-serif; font-size: x-small; line-height: 16px; white-space: nowrap;&quot;&gt;www.sencha.com/) . &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: arial,sans-serif; font-size: x-small; line-height: 16px; white-space: nowrap;&quot;&gt;I wrote first page , opened a fiddler to see the data between client and server.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: arial,sans-serif; font-size: x-small; line-height: 16px; white-space: nowrap;&quot;&gt;I found out that the Extjs is downloading image s.gif from the external server. I searched in the&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial,sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px; white-space: nowrap;&quot;&gt;Net about this issue and found that need to download this image from sencha site to local server.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial,Verdana,Helvetica,sans-serif; font-size: 12px;&quot;&gt;The file can be downloaded &amp;nbsp;from &amp;nbsp;&quot;http://extjs.com/s.gif&quot;. And then need to include at the beginning of the code&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial,Verdana,Helvetica,sans-serif; font-size: 12px;&quot;&gt;&lt;b&gt;Ext.BLANK_IMAGE_URL=&#39;include/images/blank.gif&#39;; &lt;/b&gt;This code will remove unwanted request to external server.&lt;/span&gt;&lt;/div&gt;
&lt;a href=&quot;http://www.linksmanagement.com/&quot;&gt;&amp;nbsp;&lt;/a&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/6048323641052352826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/extjs-sgif.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6048323641052352826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6048323641052352826'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/extjs-sgif.html' title='Extjs S.gif'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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-191832781286093326.post-3501181367792766982</id><published>2011-09-08T03:42:00.000-07:00</published><updated>2011-10-04T08:27:08.094-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="Prototype framework"/><title type='text'>Tooltip Class. Prototype</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
One of my projects was developed on prototype java-script framework. I needed to write a functionality to show tool tip . I started to look in the prototype framework if they already have it.&lt;br /&gt;
Unfortunately I did not find any component . I started to goggle it&amp;nbsp; and did not found anything as well.So I wrote my class that aimed to show tool tip . In constructor class receiving following parameters.&lt;br /&gt;
&lt;br /&gt;
elementOb -&amp;nbsp; The parent element to show tip&lt;br /&gt;
tool_tip -&amp;nbsp; Tool tip message&lt;br /&gt;
width - Tooltip width&lt;br /&gt;
height - Tooltip height&lt;br /&gt;
&lt;br /&gt;
Simple?&lt;br /&gt;
&lt;br /&gt;
In order to setup a css class for the tool tip need to define a css style with the&lt;br /&gt;
.toolTip className.&lt;br /&gt;
&lt;br /&gt;
To use it need to write the code below.&lt;br /&gt;
&lt;br /&gt;
var toolTipMessage = &quot;The message is showing tooltip.Please change and play with it&quot;;&lt;br /&gt;
var toolTip = new Tooltip($(&#39;tblToolTip&#39;),toolTipMessage);&lt;br /&gt;
I wrote sample page to test it .&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: large;&quot;&gt;All the code can be downloaded from here&amp;nbsp;&lt;a href=&quot;http://depositfiles.com/files/bnngn0b5s&quot;&gt;Download&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See below sample picture&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/AVvXsEjvqNbxTIGFuX7qgBwfLcMfQ8P5jrhaXNN9goBz-RABvTOnC3N6exwVTakrnfx8dv2uwTEjbO838PEdim0N2-kMz5Uno60WIDdZV0SAfWiYw5Zwe0Ak6yrYTNU1XCwfQfIj2S4VGpiG5IQ/s1600/tooltip.GIF&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvqNbxTIGFuX7qgBwfLcMfQ8P5jrhaXNN9goBz-RABvTOnC3N6exwVTakrnfx8dv2uwTEjbO838PEdim0N2-kMz5Uno60WIDdZV0SAfWiYw5Zwe0Ak6yrYTNU1XCwfQfIj2S4VGpiG5IQ/s640/tooltip.GIF&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/3501181367792766982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/tooltip-class-prototype.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/3501181367792766982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/3501181367792766982'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/tooltip-class-prototype.html' title='Tooltip Class. Prototype'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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/AVvXsEjvqNbxTIGFuX7qgBwfLcMfQ8P5jrhaXNN9goBz-RABvTOnC3N6exwVTakrnfx8dv2uwTEjbO838PEdim0N2-kMz5Uno60WIDdZV0SAfWiYw5Zwe0Ak6yrYTNU1XCwfQfIj2S4VGpiG5IQ/s72-c/tooltip.GIF" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-191832781286093326.post-6105664741443289616</id><published>2011-09-07T08:10:00.000-07:00</published><updated>2011-09-07T08:14:12.728-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LINQ XSD XML .NET"/><title type='text'>Parsing Typed XML</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;I had a task to parse XML into Database.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;I started to plan execution of the task. First of all XML has a constant structure. So the plan was to create the schema (XSD) of the XML and then produce from the schema collection of classes. Afterwards the XML can be de serialized .The schema creation in .Net can be done with the XSD tool. But the problem that I wanted that collection of&amp;nbsp;classes&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;will support LINQ. &amp;nbsp;I was confident that someone already wrote framework that does it and I found it. Project called “Linq to XSD”.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;(&lt;/span&gt;&lt;a href=&quot;http://linqtoxsd.codeplex.com/&quot;&gt;&lt;span style=&quot;color: purple; font-family: Calibri;&quot;&gt;http://linqtoxsd.codeplex.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;). &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;The project creates&amp;nbsp; schema from the XML and produce classes from it. &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;The collection of classes can be queried in LINQ manner. That’s exactly what I was looking for!&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;The single problem that I had with it , was to&amp;nbsp;installed it. Because the project in the Beta phase, need to work a litle. But after I finished &lt;br /&gt;
that, it was really easy to use.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;My tip for using the framework is to remove unnecessary functions,&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;that was created by the framework. &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;Functions that &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;you are not using simply holding the pointer in virtual table. &lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregnozik.blogspot.com/feeds/6105664741443289616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gregnozik.blogspot.com/2011/09/parsing-typed-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6105664741443289616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/191832781286093326/posts/default/6105664741443289616'/><link rel='alternate' type='text/html' href='http://gregnozik.blogspot.com/2011/09/parsing-typed-xml.html' title='Parsing Typed XML'/><author><name>Greg</name><uri>http://www.blogger.com/profile/05748216767242798986</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>