<?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: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-3366468919231472940</id><updated>2012-01-21T07:38:32.787-08:00</updated><title type='text'>VB Guide</title><subtitle type='html'>Visual Basic Guide</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-4489642954697575102</id><published>2012-01-21T07:38:00.000-08:00</published><updated>2012-01-21T07:38:32.798-08:00</updated><title type='text'></title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;h2&gt;Use Parameters in Stored procedures&lt;/h2&gt;Using stored procedures in asp.net application helps in various ways to run  couple of SQL statements, and makes the applications to get the data by calling  those procedures. When using stored procedures, the parameters have to be sent  to while executing the stored procedures.&lt;br /&gt;&lt;div class="LakeQuencyAds"&gt; &lt;div class="lqm_ad" lqm_channel="1" lqm_format="2" lqm_publisher="463" lqm_zone="1"&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="lqm_ad" lqm_channel="1" lqm_format="2" lqm_publisher="463" lqm_zone="1"&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;SqlParameter to pass the value&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;Since most of the samples I am working on are related to SQL Server, I need  to use the SqlParameter. There are various ways to pass the values from asp.net  (or win forms, WPF applications, win service, etc...) applications.  I prefer  just create a new parameter by specifying its name and type while initializing  and then pass the value using the value parameter. &lt;br /&gt;&lt;h3&gt;Stored procedure &lt;/h3&gt;Stored procedures which are accepting the parameters have to specify its  datatype and the length of the data. If you are expecting that there will be a  possibility that the parameter may not be passed at all i.e. the optional  parameter, this can be easily defined in the stored procedure by assigning the  null while declaring the parameters.&lt;br /&gt;For more info please read here&amp;nbsp;&lt;a href="http://www.vbknowledgebase.com/?Id=152&amp;amp;Desc=Asp.Net-Stored-Procedure-Parameters"&gt;http://www.vbknowledgebase.com/?Id=152&amp;amp;Desc=Asp.Net-Stored-Procedure-Parameters&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.squidoo.com/guidance-on-choosing-a-used-car-"&gt;http://www.squidoo.com/guidance-on-choosing-a-used-car-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-4489642954697575102?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/4489642954697575102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2012/01/use-parameters-in-stored-procedures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/4489642954697575102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/4489642954697575102'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2012/01/use-parameters-in-stored-procedures.html' title=''/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-705748017497165257</id><published>2011-09-06T03:58:00.000-07:00</published><updated>2011-09-06T03:58:26.530-07:00</updated><title type='text'>Package multiple files using Asp.Net Zip</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt; Microsoft.Net has a very good utility for zipping aka packaging files. While  there are good utilities there in open source/Code Plex for packaging files. I  would still prefer to write the code using native functions and classes  available in .Net. In this article I am going to use the System.IO.Packaging for  showing how to attach multiple files into a zip.&lt;br /&gt;&lt;div class="LakeQuencyAds"&gt; &lt;div class="lqm_ad" lqm_channel="1" lqm_format="2" lqm_publisher="463" lqm_zone="1"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="lqm_ad" lqm_channel="1" lqm_format="2" lqm_publisher="463" lqm_zone="1"&gt;&lt;strong&gt;Zipper class for Packaging&lt;/strong&gt;&lt;/div&gt;&lt;/div&gt;I have created a separate class called as Zipper for the future works as it  gives great re-usability.  This class can be used for the WinForms, WPF, or  ASP.Net applications. Though has to be changed as per the specific needs. It is  just a starter for writing more functions into the zipper class.&lt;br /&gt;&lt;h3&gt;Referencing required assemblies&lt;/h3&gt;The System.IO.Packaging library is not directly available in the default set  of references. You have to add a reference to the assembly known as  windowsbase.dll under Program Files. In my system it is located right at  &lt;em&gt;C:\Program Files\Reference  Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll. &lt;/em&gt;Once it is referenced  the namespace can be imported in the top of the class as Imports  System.IO.Packaging.&lt;br /&gt;Read original article here &lt;a href="http://www.vbknowledgebase.com/?Id=156&amp;amp;Desc=Asp.Net-Zip-Multiple-Files"&gt;http://www.vbknowledgebase.com/?Id=156&amp;amp;Desc=Asp.Net-Zip-Multiple-Files&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://vbreader.bravejournal.com/entry/75736"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;http://vbreader.bravejournal.com/entry/75736&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://vbreader.edublogs.org/2011/09/05/netbooks-for-kids/"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;http://vbreader.edublogs.org/2011/09/05/netbooks-for-kids/&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://aggregator.weebly.com/1/post/2011/09/cheap-netbooks-for-kids.html"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;http://aggregator.weebly.com/1/post/2011/09/cheap-netbooks-for-kids.html&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://goodarticles.webs.com/cheapnetbooksforkids.htm"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;http://goodarticles.webs.com/cheapnetbooksforkids.htm&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://www.gather.com/viewArticle.action?articleId=281474980169744"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;http://www.gather.com/viewArticle.action?articleId=281474980169744&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://carpcsoftware.blogspot.com/2011/09/netbook-for-kids.html"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;http://carpcsoftware.blogspot.com/2011/09/netbook-for-kids.html&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://fantastic.sosblog.com/The-first-blog-b1/Netbook-for-Kids-b1-p5.htm"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;http://fantastic.sosblog.com/The-first-blog-b1/Netbook-for-Kids-b1-p5.htm&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-705748017497165257?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/705748017497165257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/09/package-multiple-files-using-aspnet-zip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/705748017497165257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/705748017497165257'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/09/package-multiple-files-using-aspnet-zip.html' title='Package multiple files using Asp.Net Zip'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-5220614815176806011</id><published>2011-07-09T22:33:00.000-07:00</published><updated>2011-08-18T06:15:48.485-07:00</updated><title type='text'>WPF Animation Using DoubleAnimation</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;h2&gt;&lt;/h2&gt;Easiest way to animate is using the&lt;a href="http://www.vbnettutorial.net/?Id=138&amp;amp;Desc=WPF-Marquee-Animation-In-Listbox-Items"&gt; Double Animation&lt;/a&gt; provided by WPF. It is  much easier to use the Double Animation as there are only few statements needed  and they are quite straight forward to implement. For e.g. Specifying the  following parameters will let you start understand the animation  easily&lt;br /&gt;• From&lt;br /&gt;• To&lt;br /&gt;• RepeatBehavior &lt;br /&gt;• Duration &lt;br /&gt;After this  setup, just calling the BeginAnimation method alongwith which property needs to  be animated (in our case it is the right property) will start sliding  horizontally.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Animation Setup&lt;/b&gt; &lt;br /&gt;For horizontal marquee, we need two controls. One is the outer panel and the  sliding label.  For horizontal sliding or marquee we can either change the left  property or right property using double animation object. For example we are  going to try the right property. &lt;br /&gt;If you want the sliding to be faster then  reduce the duration. If you want the sliding to be slower, then duration has to  be increased.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Animation in Listbox Items&lt;/b&gt;&lt;br /&gt;Since we like to have the animation inside the listbox items, I made this  label as the UserControl.  So, we can either use inside the ListBox or can be  used independently.   Listbox Items bound to the data and values will be passed  to listbox items while binding. We have to get the data and assign it to our  Marquee control respectively.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;DependencyPropertyChangedEvent&lt;/b&gt;&lt;br /&gt;For transferring the values from the listbox to marque slider, we use the  dependency property we created and named as  MarqueeText. We need to register  the property as the dependency property along with the event for property value  changed. This event will be triggered whenever there is a change in the  event.&lt;br /&gt;We can retrieve the new value i.e the changed value from the event  argument DependencyPropertyChangedEventArgs. There is a property named as  e.NewValue.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-5220614815176806011?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/5220614815176806011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/07/wpf-animation-using-doubleanimation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5220614815176806011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5220614815176806011'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/07/wpf-animation-using-doubleanimation.html' title='WPF Animation Using DoubleAnimation'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-7952461816063738269</id><published>2011-04-20T08:30:00.000-07:00</published><updated>2011-04-20T08:30:19.587-07:00</updated><title type='text'>Implicit Connections in ADO with Visual Basic 6</title><content type='html'>When a same connection is used to open two different RecordSets, ADO opens &lt;br /&gt;&lt;br /&gt;two ports (TCP/IP) in the machine where application is running. If a RecordSet is opening inside a loop with the same connection then ado will open a separate port for its each iteration&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Resolution &lt;br /&gt;&lt;br /&gt;1. Use a separate connection for each RecordSets rather than using the same &lt;br /&gt;&lt;br /&gt;connection as follows.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dim conOne as new Adodb.Connection&lt;br /&gt;&lt;br /&gt;Dim rsOne as Adodb.Recordset&lt;br /&gt;&lt;br /&gt;Dim rsTwo as Adodb.Recordset&lt;br /&gt;&lt;br /&gt;conOne.open(connection string goes here)&lt;br /&gt;&lt;br /&gt;Set rsOne= con.execute select query&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Do until rsOne.EoF&lt;br /&gt;&lt;br /&gt;Set rsTwo = conOne.execute select c2,c3 from tbl1 where &lt;br /&gt;&lt;br /&gt;c1 = &amp;amp; rsOne(0)&lt;br /&gt;&lt;br /&gt;rsOne.MoveNext&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The code segment should be modified as follows&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dim conOne as new Adodb.Connection&lt;br /&gt;&lt;br /&gt;Dim conTwo as new Adodb.Connection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dim rsOne as Adodb.Recordset&lt;br /&gt;&lt;br /&gt;Dim rsTwo as Adodb.Recordset&lt;br /&gt;&lt;br /&gt;conOne.open(connection string goes here)&lt;br /&gt;&lt;br /&gt;conTwo.open(connection string goes here)&lt;br /&gt;&lt;br /&gt;Set rsOne= con.execute select query&lt;br /&gt;&lt;br /&gt;Do until rsOne.EoF&lt;br /&gt;&lt;br /&gt;Set rsTwo = conTwo.execute select c2,c3 from tbl1 where &lt;br /&gt;&lt;br /&gt;c1 = &amp;amp; rsOne(0)&lt;br /&gt;&lt;br /&gt;rsTwo.close()&lt;br /&gt;&lt;br /&gt;rsOne.MoveNext&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;In this case, only two ports will be opened even though the RecordSet is &lt;br /&gt;&lt;br /&gt;opened several times inside the loop&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. If the SQL server is 2005 then the MARS(Multiple Active Result Sets) &lt;br /&gt;&lt;br /&gt;will manage opening and closing the ports internally. Even though it is managing &lt;br /&gt;&lt;br /&gt;the ports internally, the ports will be opened for each RecordSet opening.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;conOne.Open "Provider=SQLNCLI;MARS Connection=true" &amp;amp; _&lt;br /&gt;&lt;br /&gt;"Uid=" &amp;amp; UserId _&lt;br /&gt;&lt;br /&gt;&amp;amp; ";Pwd=" &amp;amp; Password _&lt;br /&gt;&lt;br /&gt;&amp;amp; ";Database=" &amp;amp; Database _&lt;br /&gt;&lt;br /&gt;&amp;amp; ";Server=" &amp;amp; Server&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. For both the cases described above, the recordset is not opened in a proper &lt;br /&gt;&lt;br /&gt;way. The following will be the ideal way of opening a recordset with readonly, &lt;br /&gt;&lt;br /&gt;serverside cursor(known as firehose cursor).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dim rstOne As New Recordset&lt;br /&gt;&lt;br /&gt;rst.CursorLocation = adUseServer&lt;br /&gt;&lt;br /&gt;rst.Open select goes here, conOne, adOpenForwardOnly, &lt;br /&gt;&lt;br /&gt;adLockReadOnly&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.usedcarschennai.in/list/makes/audi"&gt;http://www.usedcarschennai.in/list/makes/audi&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-7952461816063738269?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7952461816063738269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7952461816063738269'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/04/implicit-connections-in-ado-with-visual.html' title='Implicit Connections in ADO with Visual Basic 6'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-6136643175511897008</id><published>2011-03-30T20:54:00.000-07:00</published><updated>2011-08-18T06:16:43.755-07:00</updated><title type='text'>Fix debugging issues with Aspnet_regiis</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;strong&gt;Error while trying to run project:&lt;/strong&gt;&lt;br /&gt;Unable to start debugging on the web server. The server does not support debugging of ASP.NET or ATL Server applications. Run setup to install the Visual Studio .NET server components. If setup has been run, verify that a valid URL has been specified.&lt;br /&gt;&lt;br /&gt;You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation. Would you like to disable future attempts to debug ASP.NET pages for this project?&lt;br /&gt;Solution&lt;br /&gt;&lt;br /&gt;Open command window by Start &amp;gt; Run then type cmd and hit enter&lt;br /&gt;&lt;br /&gt;Locate the directory in command prompt using cd command C:\[Windows Directory]\Microsoft.Net\Framework\[Version]&lt;br /&gt;&lt;br /&gt;Note: You must replace [Windows Directory] in this path with the correct directory for your system and replace [Version] with the version of the .NET Frame work installed on your system.&lt;br /&gt;&lt;br /&gt;Execute aspnet_regiis -i to re-register the asp.net process in the iis.&lt;br /&gt;&lt;br /&gt;You can always find the right web server hosting for you projects&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For More info&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=16&amp;amp;Desc=Debug-Issue-Aspnet_regiis"&gt;Debug Issue Aspnet_regiis&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-6136643175511897008?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/6136643175511897008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/03/fix-debugging-issues-with-aspnetregiis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/6136643175511897008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/6136643175511897008'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/03/fix-debugging-issues-with-aspnetregiis.html' title='Fix debugging issues with Aspnet_regiis'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-6743920810811870151</id><published>2011-03-04T22:00:00.001-08:00</published><updated>2011-08-18T06:17:15.339-07:00</updated><title type='text'>ASP.Net Menu And CSS for style</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Without a menu the asp.net web application is hard to navigate. We can even &lt;br /&gt;bind to a hierarchical data. Or with little additional work the database tables &lt;br /&gt;can be bound easily.&lt;br /&gt;&lt;strong&gt;Format Base Menu&lt;/strong&gt;&lt;br /&gt;Base menu can be formatted using some simple format options(similar like &lt;br /&gt;anyother controls in asp.net shown as below). But the important item to be noted &lt;br /&gt;is the section where this is applied for. To format base menu use &lt;br /&gt;LevelMenuItemStyles section(BackColor="Silver" BorderStyle="Dashed" &lt;br /&gt;BorderWidth="1"). If&amp;nbsp; the menu has to be displayed horizontally, the orientation &lt;br /&gt;attribute has to be changed accordingly(Orientation="Horizontal") which is &lt;br /&gt;availabel in the &lt;asp:menu itself&lt;="" p="" section=""&gt;&lt;/asp:menu&gt;&lt;br /&gt;&lt;br /&gt;Sample grey background style will look like &lt;br /&gt;&lt;levelmenuitemstyles&gt;&lt;br /&gt;&lt;asp:menuitemstyle &lt;br="" backcolor="Silver" borderstyle="Solid"&gt;Font-Bold="true" BorderColor="Gray" BorderWidth="1" HorizontalPadding="10px" /&amp;gt;&lt;/asp:menuitemstyle&gt;&lt;/levelmenuitemstyles&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Format Menu Item&lt;/strong&gt;&lt;br /&gt;Same as base menu but here the style is in the same tag. The tag is &lt;br /&gt;DynamicMenuItemStyle. sample of the dynamic menu item style &lt;br /&gt;is.&lt;br /&gt;&lt;dynamicmenuitemstyle &lt;br="" backcolor="Orange" forecolor="Maroon"&gt;Font-Bold="true" BorderStyle="Solid" BorderColor="Gray" BorderWidth="1" &lt;br /&gt;HorizontalPadding="10px" /&amp;gt;&lt;/dynamicmenuitemstyle&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Selected Menu using DynamicSelectedStyle&lt;/strong&gt;&lt;br /&gt;The following sample will highlight both base menu and the sub menus. The &lt;br /&gt;base menu is handled by LevelSelectedStyles and the sub menu is hadled by &lt;br /&gt;DynamicSelectedStyle. Currently i have used BackColor for understanding &lt;br /&gt;purposes. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;levelselectedstyles&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;asp:menuitemstyle &lt;br=""&gt;BackColor="Gray" ForeColor="White" Font-Bold="true" BorderStyle="Solid" &lt;br /&gt;BorderColor="Gray" BorderWidth="1" HorizontalPadding="10px" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/asp:menuitemstyle&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;dynamicselectedstyle &lt;br=""&gt;BackColor="Maroon" ForeColor="Orange" Font-Bold="true" &lt;br /&gt;BorderStyle="Solid"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; &lt;br /&gt;BorderColor="Gray" &lt;br /&gt;BorderWidth="1" HorizontalPadding="10px" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;items&gt;&amp;nbsp; &lt;/items&gt;&lt;/dynamicselectedstyle&gt;&lt;/levelselectedstyles&gt;&lt;br /&gt;For references&lt;br /&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=78&amp;amp;Desc=Formatting-items-in-ASP.Net-Menu"&gt;&lt;strong&gt;Formatting items in ASP.Net Menu&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-6743920810811870151?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/6743920810811870151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/03/aspnet-menu-and-css-for-style.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/6743920810811870151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/6743920810811870151'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/03/aspnet-menu-and-css-for-style.html' title='ASP.Net Menu And CSS for style'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-9051770723556982884</id><published>2011-02-23T19:00:00.000-08:00</published><updated>2011-03-04T22:01:36.693-08:00</updated><title type='text'>ASP.Net Image Dropdownlist using Repeater</title><content type='html'>I was searching for ASP.Net Image Dropdownlist that can have a image thumbnail before the text in each item in the list. However, we do not have any option ASP.Net Image Dropdownlist that can contain image thumbnails. WPF does but not ASP.Net. Hence, I started planning to build one for my project. However, it is not a user control or server control. This can be made as server control with necessary changes but this article will be big. I would like to keep it simple and to explain how this can be achieved.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Constructing the Image Dropdownlist&lt;/strong&gt;&lt;br /&gt;I was interested in showing this as close as possible to the standard Dropdownlist. I planned to have three main components to construct. The following are the list and hierarchy of the controls used&lt;br /&gt;&lt;br /&gt;• Dropdownlist as a HTML DIV&lt;br /&gt;a. Image to show the selected item’s Image&lt;br /&gt;b. Label to show the selected item’s text&lt;br /&gt;c. Button to simulate the look of the Dropdownlist’s arrow&lt;br /&gt;• List window that contains the list of Dropdownlist items to choose&lt;br /&gt;a. Image &lt;br /&gt;b. Linkbutton to raise a Postback event for selection&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Down Arrow in ASP.Net Image Dropdownlist &lt;/strong&gt;&lt;br /&gt;The only issue in getting closer is due to the down arrow button. I had a look at the character map, found the down arrow, and used it as a text in the down arrow button. For those who does not know what is character map in windows go to start menu ? run ? type charmap and you can select any letters or symbols and copy the respective values. If you are bit worried about the display issues in other platforms because of the Character you have chosen to show the dropdown. You may chose to use a small GIF image.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CSS Classes for styling&lt;/strong&gt;&lt;br /&gt;I have used the CSS classes for styling this, so a little knowledge on the CSS is necessary. We used both ID and CSS Class to define the style for the elements. I used the IDs because of simplicity. However, if you are trying to create this as a control, I would suggest using a class name respectively. Reason behind is, if you are using the control inside another control, then the client id depends on it’s control hierarchy. Because of this, you will see that the class is not referenced properly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Showing Images in the Dropdownlist using a ImageHandler&lt;/strong&gt;&lt;br /&gt;I wish data for this Dropdownlist to be completely driven from the database table. I have used Northwind Database’s category table. It contains image data for its picture column. And if your picture is in image datatype, we know that we need a Image handler to render the image to the browser. Please refer Asp.Net Image Handler for more information.&lt;br /&gt;&lt;br /&gt;Read more here&lt;br /&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=157&amp;amp;Desc=Asp.Net-Image-Dropdownlist"&gt;ASP.Net Image Dropdownlist&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-9051770723556982884?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/9051770723556982884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/02/aspnet-image-dropdownlist-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/9051770723556982884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/9051770723556982884'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/02/aspnet-image-dropdownlist-using.html' title='ASP.Net Image Dropdownlist using Repeater'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-1276053677553342436</id><published>2011-02-07T19:10:00.000-08:00</published><updated>2011-08-18T06:17:50.397-07:00</updated><title type='text'>ASP.Net Calendar with JavaScript as a DatePicker</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Is there a DatePicker control in the ASP.Net 2.0? No, so I started writing some code which will be similar to the Win Forms DatePicker. The best approach is to build a server control or al least a user control. This article describes how to use JavaScript to get this functionality so that later on this can be ported to a user control.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Controls required for a DatePicker&lt;/strong&gt;&lt;br /&gt;I have planned to use a textbox to accept the dates, calendar to select dates, a panel to contain the calendar and a button to show, or hide the calendar control and its panel. I preferred to use the html button and div as a panel.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;JavaScript Functionalities&lt;/strong&gt;&lt;br /&gt;This DatePicker is designed with the aim of improving the usability in to consideration. Still there are various functionalities can be added but for explaining the core working functionalities without making too much of confusions, I have opted only the following functionalities.&lt;br /&gt;&lt;br /&gt;Button Onclick: if the calendar is visible hide it. If the calendar is not visible then make it visible using Display attribute of Style.&lt;br /&gt;Hide after show: the calendar will be invisible after 5 seconds using javascript TimeOut.&lt;br /&gt;Textbox On Focus: Once the text box got focus the calendar will be shown&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ASP.Net Calendar&lt;/strong&gt;&lt;br /&gt;Since we are using ASP.Net I decided to use the built in calendar control for the DatePicker. So I don’t need to worry about the Viewstate and the date rendering logic. And I can style the calendar as much as other .Net controls. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ASP.Net Calendar Styling&lt;/strong&gt;&lt;br /&gt;Though the native calendar is loaded with lots of functionalities, the default display is not appealing and few considerations the styling is necessary. So styling calendar in such a way that the required details are displayed properly, I have used the following styles to display ok(at least to me)&lt;br /&gt;&lt;br /&gt;DayStyle: the style of days displayed on the calendar&lt;br /&gt;OtherMonthDayStyle: the days which are NOT in the current month&lt;br /&gt;TitleStyle: the title of the control like in month and year&lt;br /&gt;&lt;br /&gt;For source code refer &lt;a href="http://www.vbknowledgebase.com/?Id=150&amp;amp;Desc=ASP.Net-DatePicker-using-Calendar-Control"&gt;&amp;nbsp;ASP.Net DatePicker and Calendar Control&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-1276053677553342436?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/1276053677553342436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/02/aspnet-calendar-with-javascript-as.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1276053677553342436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1276053677553342436'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/02/aspnet-calendar-with-javascript-as.html' title='ASP.Net Calendar with JavaScript as a DatePicker'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-1503502627054243791</id><published>2011-02-05T23:01:00.000-08:00</published><updated>2011-02-20T17:12:39.052-08:00</updated><title type='text'>Build a Horizontal List with ASP.Net Repeater</title><content type='html'>&lt;p$1&gt;&lt;p$1&gt;How to build a Horizontal List using an ASP.net RepeaterHave you ever tried generating a horizontal list in ASP.Net?&amp;nbsp; There is no control in ASP.Net which natively supports this (to my knowledge). Due to the emerging technology in &lt;a href="http://www.cheapnetbooksunder200.net/"&gt;Cheap Netbooks&amp;nbsp;one can buy under 200&amp;nbsp;USD&lt;/a&gt;,&amp;nbsp;We have to design the sites&amp;nbsp;with wider screen but&amp;nbsp;short height. So there is a need of horizontal menu than the vertical one in our case.&amp;nbsp;Radio button list supports the list’s orientation as horizontal. But you can not use radio button list for a menu. I am trying to use a repeater to fabricate the menu so that you can add the other onClick events later to bind to the respective actions.&lt;br /&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;strong&gt;Why ASP.Net over the other data controls.&lt;/strong&gt;ASP.net repeater is a very simple control which just repeats the items defined in the ItemTemplate. It does not add anything other than this. This gives us more possibilities in generating the code as we like. And for this menu we don’t need any paging or runtime sorting options. So with a little CSS and JavaScript we are ready to use the horizontal menu we created.&lt;br /&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;strong&gt;Bind the Data&lt;/strong&gt;Please refer to the data controls section for how to connect the data and bind the data controls. I am just skipping those areas, since I have explained in few articles in the earlier days in detail.&lt;br /&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;strong&gt;Constructing a menu&lt;/strong&gt;To get a menu we need two divs. One is the outer div(we call it as OuterPanel) and another one is the div used for each menu item. So we place the repeater inside the OuterPanel. Let the repeater handle the placing of inner divs(we call as ItemPanel). After assigning the proper class names, the application is ready to run. &lt;br /&gt;&lt;p$1&gt;&lt;p$1&gt;If you run at this stage you will notice that the ItemPanels are placed vertically. That is the default behaviour of the divs. They don’t sit horizontally. To bring the menu items floating next to each other we need to use the property float:left for the menu items. &lt;br /&gt;&lt;p$1&gt;Fixing few for a decent looking menu&lt;br /&gt;&lt;p$1&gt;At this stage if you run, you can notice the ItemPanels are overlapping the OuterPanel. This is due to the float:left assigned to the ItemPanels. To fix this you can add float:left to the OuterPanel. Apply some padding, margin, background the menu will look decent.&lt;br /&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;strong&gt;For More Info refer &lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=155&amp;amp;Desc=Asp.Net-Repeater-Horizontal-List-Menuhttp://www.carpcgadgets.com/?Id=48&amp;amp;Desc=3M-Headlight-Lens-Restoration-System-Review"&gt;Asp.Net Repeater Horizontal List Menu&lt;/a&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-1503502627054243791?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/1503502627054243791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/02/build-horizontal-list-with-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1503502627054243791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1503502627054243791'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/02/build-horizontal-list-with-aspnet.html' title='Build a Horizontal List with ASP.Net Repeater'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-5891114691103985582</id><published>2011-01-31T01:56:00.000-08:00</published><updated>2011-01-31T01:56:23.914-08:00</updated><title type='text'>VB.Net Auto Complete for ComboBox</title><content type='html'>ComboBox.AutoCompleteMode PropertyComboBox control is similar to ListBox control, in which you can select one item from a list of items. But it takes less space on screen and it allows you to locate an item by setting value to the ComboBox control’s text property. In simple word, it is an expandable(collapse/expand) ListBox control. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;AutoCompleteMode Property&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Here we are going to see the AutoCompleteMode property in ComboBox control. This property automatically matches the input string given on runtime (starts with match) of all strings in the source database column. Based on that it will display the matched string in ComboBox. This property is very useful for frequently searching strings. Such as URLs, file name, customer name, or any command that is frequently used. This property go well when there is no duplication in source data. If there is duplication occurs in source data then the AutoCompleteMode property omits the duplication and display only once. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Fetch data from SQL server&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There is an easy way to fetch data from the SQL server, first select the “Add New Item” from Project menu. In which, select “LINQ to SQL Classes”, name it as Northwind.dbml and press Add button. Now you get the new Northwind.dbml designer on screen. Now drag the Customer table from server explorer window to Northwind.dbml. Now you can fetch the source data from SQL server by using the following code &lt;br /&gt;&lt;br /&gt;ComboBox1.DataSource = (New NorthwindDataContext).Customers.Where(Function(Cust) &lt;br /&gt;Cust.ContactName.Contains(comboBox1.SelectedText)) &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Implementation of AutoCompleteMode property&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Pickup a ComboBox control from the toolbox and place it in your form1.vb[Design]. Now set the “DropDownStyle” property value as DropDown. To execute AutoCompleteMode property, The AutoCompleteModeProperty and AutoCompleteSource property must be used together. First you should set the AutoCompleteMode property value as Suggest and set AutoCompleteCustomSource property value as ListItems. If the value of AutoCompleteCustomSource property is null, then the prefix of the source data that gets matched with the input string will not get listed below the ComboBox . &lt;br /&gt;&lt;br /&gt;The following code is used to set both the properties. &lt;br /&gt;ComboBox1.AutoCompleteMode = AutoCompleteMode.Suggest &lt;br /&gt;ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;For source code and Screen shot &lt;/strong&gt;&lt;a href="http://www.vbnettutorial.net/?Id=135&amp;amp;Desc=VB.net-ComboBox-AutoComplete"&gt;&lt;strong&gt;VB.net ComboBox AutoComplete&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://goarticles.com/author/Saravanan/261957/"&gt;http://goarticles.com/author/Saravanan/261957/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-5891114691103985582?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/5891114691103985582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/01/vbnet-auto-complete-for-combobox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5891114691103985582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5891114691103985582'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/01/vbnet-auto-complete-for-combobox.html' title='VB.Net Auto Complete for ComboBox'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-1966297898383187582</id><published>2011-01-24T00:16:00.000-08:00</published><updated>2011-01-31T01:53:24.317-08:00</updated><title type='text'>Detect Graphics Card using VB Code</title><content type='html'>NameIs it possible to detect the graphics card name from .Net code? Yes it is possible using WMI. But you need to reference the System.Management and import it. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using WMI to get the Graphics Card Name&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;WMI can be used to query a lot of information about hardware and Operating systems related information. ManagementObjectSearcher can be used to query the data. It accepts two parameters. The first parameter is to tell which section to search called as scope. And the second parameter is the actual query almost similar to SQL query. Using the Get method of ManagementObjectSearcher will give the result set in a collection.&lt;br /&gt;&lt;strong&gt;Source Code&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Imports System.Management&lt;br /&gt;Public Class Form1&lt;br /&gt;Private Sub Button1_Click(ByVal sender As System.Object, _&lt;br /&gt;ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;&lt;br /&gt;MsgBox(GetGraphicsCardName())&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Function GetGraphicsCardName() As String&lt;br /&gt;Dim GraphicsCardName = String.Empty&lt;br /&gt;Try&lt;br /&gt;Dim WmiSelect As New ManagementObjectSearcher _&lt;br /&gt;("root\CIMV2", "SELECT * FROM Win32_VideoController")&lt;br /&gt;&lt;br /&gt;For Each WmiResults As ManagementObject In WmiSelect.Get()&lt;br /&gt;&lt;br /&gt;GraphicsCardName = WmiResults.GetPropertyValue("Name").ToString&lt;br /&gt;&lt;br /&gt;If (Not String.IsNullOrEmpty(GraphicsCardName)) Then&lt;br /&gt;&lt;br /&gt;Exit For&lt;br /&gt;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Catch err As ManagementException&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MessageBox.Show(err.Message)&lt;br /&gt;&lt;br /&gt;End Try&lt;br /&gt;&lt;br /&gt;Return GraphicsCardName&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;For a formated source code refer &lt;a href="http://www.pcigraphicscard.net/?Id=2&amp;amp;Desc=VB.Net-Code-to-get-Graphics-Card-Name"&gt;VB.Net Code to Detect Video Card Name&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-1966297898383187582?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/1966297898383187582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/01/detect-graphics-card-using-vb-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1966297898383187582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1966297898383187582'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/01/detect-graphics-card-using-vb-code.html' title='Detect Graphics Card using VB Code'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-9174661696895478906</id><published>2011-01-08T02:06:00.000-08:00</published><updated>2011-01-08T02:06:13.528-08:00</updated><title type='text'>Printing Datagridview using VB.Net</title><content type='html'>There will be situations to just print a DataGridView in a application than designing again the columns and rows in a Crystal Report. But in .Net there is no straight forward way to do this or in other words this is not supported natively. To print using an &lt;a href="http://www.allinoneprinters.biz/"&gt;all in one printers&lt;/a&gt;, the Datagridview we need to draw all the objects using Graphics Object given in the PrintDocument before calling print method in the respective PrintDocument.&lt;br /&gt;&lt;h3&gt;PrintDocument and the Graphics Object&lt;/h3&gt;So as I earlier said we need to actually draw all including text using the Graphics object. The print document needs to be prepared before actual printing starts. So we can use the event PrintPage, in this event we can draw all the objects as we need.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Draw the DataGridView like a table using lines&lt;/h3&gt;To get a tabular data to represent the DataGridView, we need to do the following&lt;br /&gt;&lt;br /&gt;• Draw an outer rectangle as the border to table&lt;br /&gt;• Draw a line for every row&lt;br /&gt;• Draw a line for every column while iterating the cell&lt;br /&gt;• Draw the cell value as text&lt;br /&gt;All the above said items can be drawn with the help of the DataGridView’s native properties, Left, Top, Height, Width, Row.Hieght, and Column. Width&lt;br /&gt;&lt;br /&gt;Refer source code &lt;a href="http://www.vbnettutorial.net/?Id=132&amp;amp;Desc=VB.Net-Print-Datagridview-in-WinForms"&gt;VB.Net Print Datagridview in WinForms&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-9174661696895478906?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/9174661696895478906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2011/01/printing-datagridview-using-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/9174661696895478906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/9174661696895478906'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2011/01/printing-datagridview-using-vbnet.html' title='Printing Datagridview using VB.Net'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-5090945923257108357</id><published>2010-12-24T20:59:00.000-08:00</published><updated>2011-01-10T04:57:17.233-08:00</updated><title type='text'>read text file into string using VB.Net</title><content type='html'>In classic VB reading a file is not that easy as we do in vb.net. The first and easy way to access a text file is using the simple file open method available in classic Visual Basic. Using this method, we can allocate a unique file number for opening the file. further the same number has to be used for closing the file handle. &lt;br /&gt;&lt;br /&gt;In addition to this, there are various modes a file can be opened. Some of them are Append, Binary, Input, Output, or Random. By default Random will be used.&lt;br /&gt;&lt;h3&gt;Read text file in VB.Net &lt;/h3&gt;In VB.net we can read files very easily. The System.IO namespace contains really very useful set of functions which can reduce the effort and time in coding file related activities. One of the easiest is reading a text file into string System.IO.File.ReadAllText(FilePath)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Some references&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://vbnettutorial.net/?Id=131&amp;amp;Desc=Vb.Net-Read-Text-File"&gt;Vb.Net Read Text File&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-5090945923257108357?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/5090945923257108357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/12/read-text-file-into-string-using-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5090945923257108357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5090945923257108357'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/12/read-text-file-into-string-using-vbnet.html' title='read text file into string using VB.Net'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-5312217951708083727</id><published>2010-05-07T02:05:00.001-07:00</published><updated>2010-05-07T02:05:56.501-07:00</updated><title type='text'>Recursively scan and access all TreeView nodes</title><content type='html'>TreeView nodes can be accessed from either Nodes collection from the TreeView root or ChildNodes collection for a TreeNode. But you don’t have any native functions to list all nodes to a single level list. This article explains how to get all nodes with complete source code in VB.Net. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TreeView Preparations&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To distinguish the levels I have made the lines visible by the property ShowLines as visible. I have used two DIVs to show the output and the TreeView side by side. Sitemap is going to be used for the sample data to bind the TreeView, So a SiteMapDataSource to bind the Sitemap to the TreeView.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sample Data &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To explain accessing all nodes in all levels of hierarchy, we need some sample data to fill up all levels. Here in our case we are going to deal that with a sitemap. So I have purposely created a sitemap with few levels and each level contains few items. I have named them in a way we can identify its level from looking at the name. Look the screen capture for further understandings.&lt;br /&gt;&lt;br /&gt;For Source code Please refer (&lt;a href="http://www.vbknowledgebase.com/?Id=143&amp;amp;Desc=Extract-All-TreeView-Nodes"&gt;TreeView Nodes&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-5312217951708083727?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/5312217951708083727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/05/recursively-scan-and-access-all.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5312217951708083727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5312217951708083727'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/05/recursively-scan-and-access-all.html' title='Recursively scan and access all TreeView nodes'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-648464402341553537</id><published>2010-05-04T19:32:00.000-07:00</published><updated>2010-05-04T19:32:58.934-07:00</updated><title type='text'>DataGridView Binding</title><content type='html'>DataGridView is very simple in .Net. Provided the knowledge of connecting to database, executing the SQL Select Queries and filling the dataset with the data fetched is necessary. While data reader also can be used for light weight read only purposes, I am explaining here with dataset. Since the coming articles in this website will refer back this article for DataBinding samples &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Connect To DataBase&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We are going to use the following namespaces for using the database related objects in ADO.Net,&lt;br /&gt;&lt;br /&gt;Import System.Data&lt;br /&gt;&lt;br /&gt;Import System.Data.SqlClient&lt;br /&gt;&lt;br /&gt;Next step is to get the connection to the database. Since we have already decided to use the SqlClient, we have to use SqlConnection to open a connection as follows. &lt;br /&gt;&lt;br /&gt;1. Initialize the connection object&lt;br /&gt;&lt;br /&gt;Dim ConnectionToFetch As New SqlConnection&lt;br /&gt;&lt;br /&gt;2. Specify the connection string&lt;br /&gt;&lt;br /&gt;ConnectionToFetch.ConnectionString = "Server= localhost\SQLEXPRESS;Database=Northwind;Trusted_Connection=true"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Open the connection&lt;br /&gt;&lt;br /&gt;ConnectionToFetch.Open()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: Northwind database can be obtained from MSDN&lt;br /&gt;&lt;br /&gt;http://blogs.msdn.com/smartclientdata/archive/2005/11/02/488258.aspx&lt;br /&gt;&lt;br /&gt;Next step is to use the opened connection to fetch data. We have several options to fetch the data. But in this example I am going to use SqlDataAdapter and DataSet.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Read the Data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Initialize the SqlDataAdapter and DataSet&lt;br /&gt;&lt;br /&gt;Dim SampleDataAdapter As New SqlDataAdapter&lt;br /&gt;&lt;br /&gt;Dim SampleSource As New DataSet&lt;br /&gt;&lt;br /&gt;2. Create a command object&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Connect the command object with the opened active connection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Assign the command object to the SqlDataAdapter&lt;br /&gt;&lt;br /&gt;Dim SelectQry = "SELECT * FROM Products " &lt;br /&gt;&lt;br /&gt;Dim SampleCommand As New SqlCommand()&lt;br /&gt;&lt;br /&gt;Dim SampleDataAdapter = New SqlDataAdapter()&lt;br /&gt;&lt;br /&gt;SampleCommand.CommandText = SelectQry&lt;br /&gt;&lt;br /&gt;SampleCommand.Connection = Connection&lt;br /&gt;&lt;br /&gt;SampleDataAdapter.SelectCommand = SampleCommand &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Use SqlDataAdapter’s fill method to fill the dataset&lt;br /&gt;&lt;br /&gt;ConnectionToFetch.Fill(SampleSource)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Close the connection&lt;br /&gt;&lt;br /&gt;ConnectionToFetch.Close()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. Assign the dataset to the GridView’s Datasource&lt;br /&gt;&lt;br /&gt;GridView1.DataSource = dsGrid.Tables(0)&lt;br /&gt;&lt;br /&gt;8. Bind the GridView with Dataset&lt;br /&gt;&lt;br /&gt;GridView1.DataBind()&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Please find the source code here (&lt;/strong&gt;&lt;a href="http://www.vbnettutorial.net/?Id=125&amp;amp;Desc=VB.Net-DataGridView"&gt;&lt;strong&gt;VB.Net DataGridView&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-648464402341553537?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/648464402341553537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/05/datagridview-binding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/648464402341553537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/648464402341553537'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/05/datagridview-binding.html' title='DataGridView Binding'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-4105888056894263804</id><published>2010-04-20T19:43:00.000-07:00</published><updated>2010-04-20T19:43:03.565-07:00</updated><title type='text'>ASP.Net Slider Control with Ajax</title><content type='html'>I tried creating a small ASP.Net Ajax Slider Control using JavaScript and AJAX. The idea is to generate the PostBack at some predefined intervals in the marker scale. I don’t wish to raise the PostBack for every pixel the slider slides. It will actually spoil the usability of the control than helping. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Controls used &lt;/strong&gt;&lt;br /&gt;&lt;em&gt;SliderBase : A panel which contains all the following controls.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;SliderHolder : It is the slider rail where the slider bar slides in.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;SliderPanel : It is the slider bar.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Marker : The marker scale sitting just above the slider holder.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;SliderValue : A hidden field to contain the slider value.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;IsDragStarted : A hidden field to contain the state of the drag started or finished.&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;JavaScript and AJAX&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Since most of the portion of the work is in JavaScript, I will explain this portion first and move to the server along with PostBack later. And before start developing, I have already decided to enable Ajax for this control. I don’t think it will work as expected without Ajax, so I even tried running without Ajax. Because of this reason the code is not tested for that case.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Events&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Actually we are going to disable the default drag and selection using the return false for the respective functions onselectstart, and onbegindrag. Apart from disabling the events onmousedown is used to mark the drag is started using a hidden field IsDragStarted. Likewise the onmouseup event is used to mark the drag is stopped or released. &lt;br /&gt;&lt;br /&gt;&amp;nbsp;Read more with working source code here(&lt;a href="http://www.vbknowledgebase.com/?Id=140&amp;amp;Desc=Asp-.Net-Ajax-Slider-Custom-Server-Control"&gt;Asp.Net Ajax Slider Control&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-4105888056894263804?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/4105888056894263804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/04/aspnet-slider-control-with-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/4105888056894263804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/4105888056894263804'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/04/aspnet-slider-control-with-ajax.html' title='ASP.Net Slider Control with Ajax'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-8466739782396208873</id><published>2010-04-04T18:22:00.000-07:00</published><updated>2010-04-04T18:22:17.753-07:00</updated><title type='text'>Ajax Error Handling</title><content type='html'>&lt;strong&gt;Ajax Error information with stack trace&lt;/strong&gt; ASP.Net Ajax is great for developing web applications. However there are some issues in presenting server side exceptions in the browser nicely. I actually needed the entire stack trace to be shown in the screen. Whenever I had an error while using Ajax, I used to get an alert with error message. Sometimes even I got notification in the status bar of the browser window. Instead of getting the error on the alert box, I wanted to get it on the body or label in the body of the browser window. Ajax Error Handling support is already available, but using them is a bit not user friendly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;JavaScript to show error messages&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Since the exception is passed to the browser from server side, we need a lot of Ajax Error Handling to do in the JavaScript. There are two events needs to be registered Begin Request and End Request in the Page Load event. PageLoad Event can be registered using Sys.Application.add_load (PageLoad) event. We need a label or DIV to display the error messages.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Register Events on PageLoad for Ajax Error Handling&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Two events needs to be registered BeginRequest, and EndRequest in the Page Load event using add_beginRequest and add_endRequest respectively&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;BeginRequest Event&lt;/strong&gt;&lt;br /&gt;Here we need to make the label invisible, because if there is no error no needs to display this label. Basically using a style to make it invisible will be sufficient.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;EndRequest Event&lt;/strong&gt;&lt;br /&gt;This is the main event to deal with the exceptions passed to the client. Here the invisible label will become visible. And the passed error description can be fetched using args.get_error ().description.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ajax Application Generator&lt;/strong&gt;&lt;br /&gt;Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To display Stack Trace&lt;/strong&gt;&lt;br /&gt;With the above changes we can display the latest error message. To get the stack trace of the error from the server, we need to use the ScriptManager’s AsyncPostBackError event. The second argument contains the exception, so accessing and passing the stack trace is simpler. The modified error message can be passed to the client by assigning ScriptManager1.AsyncPostBackErrorMessage.&lt;br /&gt;&lt;br /&gt;Finally you will be able to see the stack trace, but the information is not presented in a well readable format. The error message is not meant for the web, so the line breaks have to be replaced by &lt;br /&gt;&lt;br /&gt;Read more with complete working source code (&lt;a href="http://www.vbknowledgebase.com/?Id=126&amp;amp;Desc=Asp.net-Ajax-Error-Handling"&gt;Ajax Error Handling&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-8466739782396208873?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/8466739782396208873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/04/ajax-error-handling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8466739782396208873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8466739782396208873'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/04/ajax-error-handling.html' title='Ajax Error Handling'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-7261942697156917719</id><published>2010-03-31T23:34:00.000-07:00</published><updated>2010-03-31T23:34:18.871-07:00</updated><title type='text'>WPF Textbox AutoComplete</title><content type='html'>Auto suggest feature is increasingly popular because of the ease of use. In ASP.Net we can use the Ajax tool kit to get the suggestions easily. But I couldn’t locate one for WPF applications. So I started writing my own. Though the source code is not written completely to cater the rich user friendliness, the code is still usable with or without some small changes. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Suggestions from Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;As I have mentioned bit earlier that the suggestions are expected to be available from a database table. So we are going to get the data into a DataTable. For easier explaining, I usually choose Northwind as the database and this time I have chosen customer as the table for samples. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: As it is already explained several times in earlier articles, I am not going to explain again how to get the data and how to read the data from database into a dataset/DataTable. So refer to the Asp.net DataControls section or GridView section for that matter&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TextChanged Event for filtering the data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For this sample I have decided to fetch all the records into DataTable in a class level variable. So that later on TextChanged event we can just use the DataView to filter the rows as per the data entered in the Textbox. In the TextChanged event we are not going to fetch the data from database. Rather we are going to use the filtered data which is in DataTable. For filtering data we can use the RowFilter property of the DataView to provide the filtering criteria.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Suggestion in WPF ListBox &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I have opted to use ListBox for displaying suggestions for the letters typed in the textbox. The filtered DataView can be passed as a DataSource using the property DataContext. DataTemplate can be used to format the results in the ListBox. To read more about ListBox and its DataBinding refer the article WPF DataBinding in the WPF articles Section &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Read More here (&lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=138&amp;amp;Desc=WPF-AutoSuggest-Textbox"&gt;&lt;strong&gt;WPF AutoSuggest&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-7261942697156917719?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/7261942697156917719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/03/wpf-textbox-autocomplete.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7261942697156917719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7261942697156917719'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/03/wpf-textbox-autocomplete.html' title='WPF Textbox AutoComplete'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-8810026134892999723</id><published>2010-03-21T18:35:00.001-07:00</published><updated>2010-03-21T18:35:14.872-07:00</updated><title type='text'>Compare files using MD5</title><content type='html'>When you are receiving files from different sources but the content is same, there is a possibility of having a different filename for the same content. Hence finding a duplicate file just by file name may not be sufficient. To compare by file data, there are several ways. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Usage of Message Digest (MD5)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To find duplicate files even after renamed, the content/data has to be compared after the content of files fetched. Once the file content is in data format, the data can be encoded with MD5 hash algorithm. The string result after hash can be used for comparing. MD5 is a widely used cryptographic hash function with a 128-bit hash value, and is also commonly used to check the integrity of files&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;MD5 in .Net Framework&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;.NET Framework has very rich support for encrypting and decrypting. Computing hashes and encrypting data using a variety of algorithms is very easy. Use the ComputeHash() method to compute the MD5 Hash. &lt;br /&gt;&lt;br /&gt;Read more here: &lt;a href="http://vbnettutorial.net/?Id=122&amp;amp;Desc=Find-duplicate-files-using-VB.Net"&gt;Find duplicate files&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-8810026134892999723?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/8810026134892999723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/03/compare-files-using-md5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8810026134892999723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8810026134892999723'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/03/compare-files-using-md5.html' title='Compare files using MD5'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-4619280977651889756</id><published>2010-03-17T19:09:00.000-07:00</published><updated>2010-03-17T19:11:00.896-07:00</updated><title type='text'>ASP. Net ListView DataBinding</title><content type='html'>For presenting data in list form, we have several options in Asp.Net like ListView, DataList, Repeater, GridView, DropDownList, etc... Since we have a variety of controls to choose from, the control can be selected based on specific requirements. For e.g. single column with single selection the DropDownList is the perfect choice. If paging, sorting, edit is required then GridView will be the right choice. If just need to repeat some html code, then Repeater will work out to be better. This article is focused on ListView.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;DataBinding is quiet similar to GridView&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;DataBinding in ListView is almost similar to GridView. There is not much difference. There is a requirement of ItemPlaceHolder. By default the name of that place holder is itemPlaceholder. Asp.Net allows us to custom name (id) also. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Flexibility in rendering&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This ListView is one of the best controls while flexibility is taken into consideration. With the concept of Item Place Holder, we can specify/ configure where the items have to be placed (rotated). In this example, I have made a two column layout with liquid flow. The number of horizontal cells can be adjusted based on the resolution while resizing the browser.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Templates in ListView&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There are few templates that will ease the development effort using ListView. If you have worked in GridView earlier, then basic templates in ListView are similar to GridView Templates. There are few special templates. I am highlighting the templates in the following list. These templates can be used customize rendering.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;LayoutTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;GroupTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ItemTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;AlternatingItemTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;EditItemTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;InsertItemTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ItemSeparatorTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;GroupSeparatorTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;EmptyItemTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;EmptyDataTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;SelectedItemTemplate&lt;/em&gt;&lt;br /&gt;For Source Code refer here(&lt;a href="http://www.vbnettutorial.net/?Id=115&amp;amp;Desc=VB-.Net-ListView"&gt;VB.Net ListView&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-4619280977651889756?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/4619280977651889756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/03/asp-net-listview-databinding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/4619280977651889756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/4619280977651889756'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/03/asp-net-listview-databinding.html' title='ASP. Net ListView DataBinding'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-8982927493572980463</id><published>2010-03-17T19:07:00.000-07:00</published><updated>2010-03-17T19:12:06.176-07:00</updated><title type='text'>ASP.Net Repeater DataBinding using Visual Basic</title><content type='html'>Repeater can be used for listing data. It can be used to repeat the data horizontally or vertically. And can be used to form s a HTML table and also can be used to prepare a HTML List (LI). For displaying tabular data, we can use the repeater to form the HTML Table. &lt;br /&gt;&lt;br /&gt;However when the repeater is used as a container for controls, It is better to design the templates to be rendered with panels (&lt;br /&gt;&lt;div&gt;) and List Items (&lt;br /&gt;&lt;br /&gt;&lt;li&gt;The DataList is also works similar to Repeater. But the DataList has some additional ability to perform than repeater.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When the page renders, the control loops through the rows in the data source and renders the pre configured template (either in the markup or dynamically configured) for each row. Before and after processing the data items, the Repeater renders the header and the footer based on the configuration of the repeater. Because it has no default appearance, it is can be customized to list any layout and style. For myself if I have planned to work extensively on a page with HTML and strict CSS, I usually go for the repeater control.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Templates in Repeater&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There are few templates that will be much helpful in repeater. Like other data bound controls Repeater also has some templates to work with. Templates in repeater are not much different from the rest of the Data Bound controls. &lt;br /&gt;&lt;br /&gt;&lt;em&gt;1. ItemTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;2. AlternatingItemTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;3. SeparatorTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;4. FooterTemplate&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;5. HeaderTemplate&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;There is a special template here introduced is SeparatorTemplate. This template can be used to add some elements between each row like a horizontal line.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Repeater DataBinding&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Like other data bound controls, repeater also can be bound with a DataTable. So the procedure is to fetch the data to the DataTable using a SqlClient(if MS SQL server) and Use the SqlDataAdapter to fill it. Then the datatable can be assigned to the DataSource of the repeater. Finally instruct the repeater to bind using DataBind()&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For complete source code with more information (&lt;a href="http://www.vbnettutorial.net/?Id=116&amp;amp;Desc=ASP.Net-Repeater"&gt;ASP.Net Repeater&lt;/a&gt;)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-8982927493572980463?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/8982927493572980463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/03/aspnet-repeater-databinding-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8982927493572980463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8982927493572980463'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/03/aspnet-repeater-databinding-using.html' title='ASP.Net Repeater DataBinding using Visual Basic'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-2395081511057113593</id><published>2010-03-17T19:05:00.000-07:00</published><updated>2010-03-17T19:13:03.502-07:00</updated><title type='text'>DataTable Sort in VB.Net</title><content type='html'>When there is a need of sorting rows in a DataTable, there is no direct support available in DataTable. There is no direct way to get the sorted records into a DataTable out of the box. There are few ways to sort the data in the DataTable but that needs a few lines of code that I would like to discuss here. We have already discused how to sort a records in Gridview using DataView.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sorting using DataView &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Basically I like the DataView to sort the records as there is a support natively available as a property DataView.Sort. And the sorted records can be forced to a DataTable using a ToTable () method in a DataView. Not only sorting available but also there are other useful functions like filter, and distinct etc... So we can filter and sort altogether.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sorting using a select method in DataTable&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Like I said earlier there are few ways to achieve sorting in the DataTable. The select method of the DataTable also offers the row filtering and sorting altogether. But the biggest drawback (at least to me) is the out put is a array of data rows. This is not easier to be used as good as a DataView or DataTable. If that output as a DataTable with same structure, there will be a lot of places we don’t need to go to DataView. &lt;br /&gt;&lt;br /&gt;However this is a very subjective view of usage, as I have seen developers working comfortably with arrays. So if select method fits you well, then sorting and filtering is a breeze.&lt;br /&gt;For complete source code with more information(&lt;a href="http://www.vbnettutorial.net/?Id=121&amp;amp;Desc=VB-DataTable Sort"&gt;VB.Net DataTable Sort&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-2395081511057113593?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/2395081511057113593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/03/datatable-sort-in-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2395081511057113593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2395081511057113593'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/03/datatable-sort-in-vbnet.html' title='DataTable Sort in VB.Net'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-1075504136324371560</id><published>2010-03-11T18:06:00.000-08:00</published><updated>2010-03-11T18:06:19.776-08:00</updated><title type='text'>Substitution control to bypass cache</title><content type='html'>When OutputCache is used to cache the page, the page response will be cached and the cached pages will be shown till the cache expires. This allows the web page to be rendered quickly. Wait there is a possibility that a frequently updated data is not shown to the client because of the cache. If this is what we want to accomplish, then substitution control can actually bypass the cache and display the frequently updated content to the client even thought he entire page is cached.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Display Data Using Substitution Control &lt;/strong&gt;&lt;br /&gt;To display some data using this control we need to have a static method accessible from mark-up. This function should accept a parameter with the type HttpContext, So that the control can fetch the data using this method.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to verify the Substitution Control works?&lt;/strong&gt;&lt;br /&gt;If the sample doesn’t have a Cache directive, it is hard / impossible to notice how the control is actually bypassing the cache, so please refer to the example for get hold of how I am going to test it.&lt;br /&gt;&lt;br /&gt;So we need to compare the data rendered by the Substitution control and the normal data under the cache enabled page. In order to do that, we have used the Substitution control to display the current date time and also we are using an inline write to display a current date time as well.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Compare the results&lt;/strong&gt;&lt;br /&gt;To compare the results, we are going to change OutputCache directive’s duration to 3 seconds. &lt;br /&gt;&lt;br /&gt;And we added a JavaScript timeout to refresh the page for every second. So now if you are running you can see that the inline write will update it’s time on every 3 seconds and the substitution control updates on every second.&lt;br /&gt;&lt;br /&gt;It implies that the substitution control can be used in an output cached page to display a non cached data&lt;br /&gt;&lt;br /&gt;Read more with source code here (&lt;a href="http://www.vbknowledgebase.com/?Id=134&amp;amp;Desc=ASP.Net-Substitution-Control-and-Output-Cache"&gt;ASP.Net Substitution Control&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-1075504136324371560?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/1075504136324371560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/03/substitution-control-to-bypass-cache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1075504136324371560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/1075504136324371560'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/03/substitution-control-to-bypass-cache.html' title='Substitution control to bypass cache'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-2186377234120066634</id><published>2010-03-07T18:13:00.000-08:00</published><updated>2010-03-07T18:13:58.793-08:00</updated><title type='text'>WPF Menu Binding</title><content type='html'>&lt;strong&gt;DataBinding WPF Menu with Dataset&lt;/strong&gt;&lt;br /&gt;A typical windows application will not complete without a&amp;nbsp;menu. It&amp;nbsp;&amp;nbsp;is a best&amp;nbsp;control for navigation purposes. Whatever other navigations such as toolbar, tabs etc... will be additional. Especially this control is to display hierarchically organized data for navigation. But there&amp;nbsp;are few things we need to do for&amp;nbsp;displaying hierarchical data. We need to use HierarchicalDataTemplate for loading hierarchical data.&lt;br /&gt;&lt;strong&gt;HierarchicalDataTemplate in mapping data&lt;/strong&gt;&lt;br /&gt;For WPF Menu to&amp;nbsp;iterate the hierarchy of the data, we need to define releationships in the HierarchicalDataTemplate. It will work ONLY if the dataset given is the relational data with proper relationships given. And give a name that describes the relationships well (for readability). Add a TextBlock for displaying the header table information. In this article we refer categories as the Header. Remember to provide a unique Key for the object also.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ItemsSource in HierarchicalDataTemplate&lt;/strong&gt;&lt;br /&gt;The given relationship name can be specified here as {Binding RelationshipName}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ItemTemplate in HierarchicalDataTemplate&lt;/strong&gt;&lt;br /&gt;This is the child template reference. So the child template name which has to be created and referred here as {StaticResource CreatedChildTemplateName}.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Creating Templates for MenuItems&lt;/strong&gt;&lt;br /&gt;For displaying data in Menu Items we have to create a DataTemplate. So later on if a label has to be added. Then we can add it to this template and bind accordingly. Remember to provide a unique Key for the template. Then we can use this key for referring it in ItemTemplate of the HierarchicalDataTemplate.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configure Menu to use the Mapped ItemsSource&lt;/strong&gt;&lt;br /&gt;After placed the Menu, there are few things we may need to configure it to bind the hierarchical template.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ItemsSource in Menu&lt;/strong&gt;&lt;br /&gt;Here is the Parent Table we need to specify in our case it is Categories Table. This is the table name we have to give while preparing the relational dataset (either in the query or later adding as a table name in the dataset which ever is relevant in your case but it is important)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ItemTemplate in Menu&lt;/strong&gt;&lt;br /&gt;This is the Created HierarchicalDataTemplate x:key we need to pass along with such as {StaticResource CategoryTemplate}. Please note that the dataset is already passed as DataContext in code behind.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Read More with full source code (&lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=133&amp;amp;Desc=WPF-Menu-Databinding"&gt;&lt;strong&gt;WPF Menu Databinding&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-2186377234120066634?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/2186377234120066634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/03/wpf-menu-binding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2186377234120066634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2186377234120066634'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/03/wpf-menu-binding.html' title='WPF Menu Binding'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-8852265349934110215</id><published>2010-02-22T21:18:00.000-08:00</published><updated>2010-02-22T21:19:43.604-08:00</updated><title type='text'>Hierarchical GridView</title><content type='html'>I usually choose a TreeView for&amp;nbsp;hierarchical data or else I used to choose ASP.Net menu. But there are some situations you may need to have various controls on each node. If this is your case then the Asp.Net Hierarchical GridView is right choice. But wait one moment, there is no Hierarchical Grid as we have in Classic VB.&lt;br /&gt;&lt;br /&gt;However we can still get a Asp.Net Hierarchical GridView, by using a GridView inside another GridView’s TemplateField. This example I am using a label with ‘+’ (Plus) sign for expanding and a ‘-‘(Minus) sign for collapsing. This is handled by JavaScript. I have used CSS to style the label so the user will click on the (+) and (-) without further instructions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;RowDataBound to access the inner GridView &lt;/strong&gt;&lt;br /&gt;The inner GridView is named as GridView2 and it is placed inside the ItemTemplate in the TemplateField of the GridView1. So to access each row the RowDataBound is the right event. Further all the controls can be accessed in a row using the rows FindControl Method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Hierarchical Data&lt;/strong&gt;&lt;br /&gt;For simpler explanation I always use the Northwind Database. So for this example also I have chosen the Categories and products. Category is used in the outer GridView. And the Product is used in the inner GridView. In the RowDataBound event using the DataItem property we can access the Category ID of the respective row. Then the Category ID is used to fetch the respective Product rows from the Database.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;For Source Code refer &lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=125&amp;amp;Desc=Asp.Net-Hierarchical-GridView"&gt;&lt;strong&gt;Hierarchical GridView&lt;/strong&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-8852265349934110215?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/8852265349934110215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/02/hierarchical-gridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8852265349934110215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8852265349934110215'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/02/hierarchical-gridview.html' title='Hierarchical GridView'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-2212276524861462253</id><published>2010-01-13T23:36:00.000-08:00</published><updated>2010-01-13T23:41:44.170-08:00</updated><title type='text'>Asp.Net Ajax Autocomplete Textbox</title><content type='html'>&lt;strong&gt;Ajax Toolkit for ASP.Net&lt;/strong&gt; &lt;br /&gt;It is very cool to have AutoComplete dropdown for the textbox in the ASP.net. At the mean time if the Auto Complete is not responsive the users will feel that it is trouble to type the characters. As we need a very light weight solution. We have selected this WebService based approach rather than the Ajax Update Panel and Webpage to fetch the data.&lt;br /&gt;&lt;strong&gt;How Auto Complete works with WebService&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For fetching data the data is transferred from web server to client (JavaScript) using web service. So the data transfer between server and client is very minimal based on the configuration value MinimumPrefixLength. Thus you feel it is responsive. As some animations will give a better user expereience, it is purely optional and the AutoCompleteExtender allows that as well&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&lt;strong&gt;This article needs Ajax Control kit. It needs to be downloaded separately.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once downloaded, create a new website and select the Default.Aspx and then switch to design mode in the Web Form for designing the page.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In Web Form&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;While in design mode, open the tool box and right click and choose items. In the "Choose Toolbox Item" choose the downloaded AjaxControlToolKit.dll. &lt;br /&gt;&lt;br /&gt;Now you will see a list Ajax controls in the tool Box.&lt;br /&gt;&lt;br /&gt;Drag the AutoCompleteExtender to the Web form. This will register the Tool Kit in the top.&lt;br /&gt;&lt;br /&gt;Right click the website and add a web service named AutoComplete.asmx&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In Web Service&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;import AjaxControlToolkit using Imports AjaxControlToolkit in the top&lt;br /&gt;&lt;br /&gt;Add a new function named as GetProducts with the following paramters&lt;br /&gt;&lt;br /&gt;prefixText: Ajax control kit needs this string for getting the typed in characters from the screen &lt;br /&gt;&lt;br /&gt;count: the number of rows to be returned&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Get data from DB &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;import System.Data using Imports System.Data in the top &lt;br /&gt;&lt;br /&gt;import System.Data.SqlClient also&lt;br /&gt;&lt;br /&gt;now get a datareader to fill up the Array list.&lt;br /&gt;&lt;br /&gt;(I am not going to explain how to fetch the data from db as you can find the information in the asp.net data controls category)&lt;br /&gt;&lt;br /&gt;I faced some issues while converting object array to string array, So checkout for the sample to get the clear picture.&lt;br /&gt;&lt;br /&gt;Now its time to fill up the AutoCompleteExtender with the web service and web method we created just now.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Fill up the following&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ServicePath =" AutoComplete.asmx" &lt;br /&gt;ServiceMethod =" GetProducts " &lt;br /&gt;MinimumPrefixLength ="1" &lt;br /&gt;CompletionSetCount ="10"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Source Code&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Reference : &lt;a href="http://www.vbknowledgebase.com/?Id=107&amp;amp;Desc=Asp-.Net-Ajax-AutoComplete-Textbox-with-Database"&gt;Asp.Net Ajax AutoComplete Textbox&lt;/a&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-2212276524861462253?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/2212276524861462253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/01/aspnet-ajax-autocomplete-textbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2212276524861462253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2212276524861462253'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/01/aspnet-ajax-autocomplete-textbox.html' title='Asp.Net Ajax Autocomplete Textbox'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-7700030258968354666</id><published>2010-01-06T19:38:00.000-08:00</published><updated>2010-01-06T19:38:22.867-08:00</updated><title type='text'>Asp .Net File Upload</title><content type='html'>I have worked in GridView for displaying different kind of data. The interesting portion is when there is a possibility to attach image, photo. This is not a very big task. But if it is done properly, the result will be very useful to the end user. &lt;br /&gt;&lt;br /&gt;For this article I would like to extend bit further to add some image viewing capability to the GridView using HttpHandler. The following is the intention of this article.&lt;br /&gt;&lt;br /&gt;1) ASP.Net FileUpload to upload the image to the web server&lt;br /&gt;&lt;br /&gt;2) Read it as a byte array and don’t save it to the file system&lt;br /&gt;&lt;br /&gt;3) Update the byte array to save it to the database&lt;br /&gt;&lt;br /&gt;4) Load the grid with image control and reference the image path to a HttpHandler&lt;br /&gt;&lt;br /&gt;5) Develop the HttpHandler to read the data into a byte array&lt;br /&gt;&lt;br /&gt;6) In HttpHandler render the data as image and set the content type as image&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Asp.Net File Upload to upload file&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The uploaded data can be easily accessed using the object PostedFile, if you want to save use the PostedFile.SaveAs () method to save to a file system. But our intention is to save it to a DB so we just access the byte array into a variable and push it to database later.&lt;br /&gt;&lt;br /&gt;As explained earlier the File Upload is going to be in the GridView. And the selected file has to be uploaded to the web server using a PostBack. So we use a submit button along with the FileUpload in the ItemTemplate. (For further information regarding wiring command to the buttons in the ItemTemplate, read here Asp .net GridView with templates) &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Fetch data from File Upload Control into a byte array&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In the RowCommand event of the GridView after the CommandName is verified, the Command argument can be used to fetch the current row (based on the assumption that the command argument is bound with the Container.DataItemIndex in the markup).&lt;br /&gt;&lt;br /&gt;Once the row is available use the FindControl to get the FileUpload, PostedFile object has an InputStream, with that the byte array can be populated with the uploaded file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Update the Database with byte array&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We are using Northwind Database for the sample, this time we have taken the employees table. Basically the update query will be &lt;br /&gt;&lt;br /&gt;Update Employees set Photo=@Photo where EmployeeId=@EmployeeId &lt;br /&gt;&lt;br /&gt;So we need two SqlParameters to pass the Employee id and the byte array. Byte array we have just seen how to fetch it and the employee id can be taken from the Datakeys. Remember to assign DataKeyNames in the markup to GridView as EmployeeId (for this sample).&lt;br /&gt;&lt;br /&gt;Read More Here(&lt;a href="http://www.vbknowledgebase.com/?Id=112&amp;amp;Desc=Asp-.Net-FileUpload-and-Image-Handler"&gt;Asp.Net File Upload &lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-7700030258968354666?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/7700030258968354666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/01/asp-net-file-upload.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7700030258968354666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7700030258968354666'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/01/asp-net-file-upload.html' title='Asp .Net File Upload'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-3844486256309352005</id><published>2010-01-04T22:11:00.000-08:00</published><updated>2010-01-04T22:11:51.555-08:00</updated><title type='text'>VB.Net Export CSV from dataset</title><content type='html'>&lt;strong&gt;CSV from a DataTable in a dataset&lt;/strong&gt;&lt;br /&gt;Before XML is widely used for data communications between the systems/applications, we have used CSV. Even now for when the new systems are being developed which needs to be communicated with these legacy applications, we have no choice if we cant choose anything other than those systems are using. I am planning to develop a class which can be useful for exporting CSV.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Delimiter&lt;/strong&gt;&lt;br /&gt;CSV is a character separated values format so we have to choose a character as a delimiter. As delimiters are chosen based on various factors we need our class to be delimiters configurable.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Text Qualifiers&lt;/strong&gt;&lt;br /&gt;As there will be a risk if the delimiter is already present in the data, the text qualifiers are used to identify the text element’s boundary. Within this boundary if a delimiter character is present then the class will not consider it as a delimiter. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configurable Column Headers&lt;/strong&gt;&lt;br /&gt;Some of the interfaces will not like headers, so make a switch to turn off the column header generations. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Generate the CSV string&lt;/strong&gt;&lt;br /&gt;For generating the file with text quantifiers, surround the item with quantifier character both the side. Once done add a delimiter character next to that. If this is done for all rows then the string is ready to be written into the file system.&lt;br /&gt;&lt;strong&gt;For complete working source code refer here(&lt;/strong&gt;&lt;a href="http://www.vbnettutorial.net/?Id=119&amp;amp;Desc=Export-CSV-from-Dataset"&gt;&lt;strong&gt;Export CSV&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-3844486256309352005?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/3844486256309352005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2010/01/vbnet-export-csv-from-dataset.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/3844486256309352005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/3844486256309352005'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2010/01/vbnet-export-csv-from-dataset.html' title='VB.Net Export CSV from dataset'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-7170074199963694275</id><published>2009-12-30T18:10:00.000-08:00</published><updated>2009-12-30T18:11:11.249-08:00</updated><title type='text'>VB.Net TreeView</title><content type='html'>&lt;strong&gt;VB.Net TreeView Tutorial on Multithreading&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Need of Multi threading&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;I am in the process of developing a windows based car pc Front-End in VB.Net. For the media playback, I was doing a PlayList editor. I don’t want to use the stock PlayList with media player as I need the custom sorting and remove PlayList item while playback.&lt;br /&gt;&lt;br /&gt;I was in need of hierarchical control to load the files from various folders. I am a fan of TreeView from Classic VB days. So I thought the TreeView is a good component for this. Now the problem is the hard disk contains around 100 GB of songs. Populating them into a tree view took around few minutes to be completed, I cant wait till then without doing anything. So I planned to run loading TreeView in a separate thread. Immediately I have decided to go for multi threading as we can still work on other process in parallel. &lt;br /&gt;&lt;br /&gt;.Net has excellent support for multi threading as it helps programming much easier than VB6.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Invoke the threads to communicate between them&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;While working on Windows forms controls in a multithreaded environment, sharing resources between threads have to be taken carefully. Or else exception will be thrown.&lt;br /&gt;&lt;br /&gt;In the current scenario, if a TreeView is being updated in a separate thread, then actually the TreeView will reside in main thread and nodes will be added in consecutive threads. So here the sharing resources have to be handled properly.&lt;br /&gt;&lt;br /&gt;To communicate/share from one thread to another thread we can use Invoke. In the current approach, the nodes have to be added using invoke as following&lt;br /&gt;&lt;br /&gt;TreeView1.Invoke(UpdateTreeDelegate, New Object() {FileInCurrentPath, CurrentNode}) &lt;br /&gt;&lt;br /&gt;As in the previous code segment, the Invoke can be used along with a delegate. The delegate points to a function that does the job and accept the arguments named FileInCurrentPath, CurrentNode.&lt;br /&gt;&lt;br /&gt;Source Code(&lt;a href="http://www.vbnettutorial.net/?Id=117&amp;amp;Desc=VB.Net TreeView"&gt;&lt;strong&gt;VB.Net TreeView&lt;/strong&gt;&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-7170074199963694275?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/7170074199963694275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/12/vbnet-treeview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7170074199963694275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/7170074199963694275'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/12/vbnet-treeview.html' title='VB.Net TreeView'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-5012781712749973537</id><published>2009-11-30T20:00:00.000-08:00</published><updated>2009-11-30T20:00:19.835-08:00</updated><title type='text'>LINQ and Entities GridView</title><content type='html'>DataBind GridView with Entities and LINQ &lt;br /&gt;&lt;br /&gt;For understanding LINQ with Entities for data binding a GridView, how the ado.net works in getting the data to the DataReader from db. Tthe main objective is not about the GridView data binding. The goal is to learn how we can use the LINQ effectively along with Entities to bind data. Why I have decided not to use DataTable with LINQ to bind is, I would like to rely only on entities and LINQ. &lt;br /&gt;&lt;br /&gt;Adding ADO.NET Entity Data Model&lt;br /&gt;We already decided to go for entity based approach. Basically entity is based on a Data Model. To make the article simpler I always prefer to work with Northwind Database. In Northwind we select the Category table for our sample. &lt;br /&gt;&lt;br /&gt;1) Right Click the website and add new Item&lt;br /&gt;2) Select the Categories as Data in the left side pane&lt;br /&gt;3) Select the ADO.NET Entity Data Model. &lt;br /&gt;4) Name the Model appropriately and click Add.&lt;br /&gt;&lt;br /&gt;Configuring the Created Entity Model&lt;br /&gt;As we know the Data model has to be configured along with relational data if applicable. In our case we are not going to deal with very complex data rather we are going to try as simple as possible. So the Categories table is what we have opted for. Now after the above steps immediately you will be asked to configure the Model with the wizard named Entity Data Model Wizard.&lt;br /&gt;&lt;br /&gt;1) Select the Generate From Database option and go next&lt;br /&gt;2) Select an appropriate connection from the list, if not create new. And go next&lt;br /&gt;3) Check the table from the list, in our case it is Categories.&lt;br /&gt;4) Click finish to finish the configuration&lt;br /&gt;You can visually see the relations if you have added any tables with references. In our case it is very simple so you will see the name of table and all the field names.&lt;br /&gt;&lt;br /&gt;Using LINQ to query the data&lt;br /&gt;As planned we are not going to write the SQL queries to hit the Database. But it is going to be handled with Entity Framework and LINQ. While LINQ is not a replacement of SQL queries but it may look a bit like them. The keywords hold same meaning for FROM, SELECT, WHERE. And once you know how to use LINQ to query a set of data from group of objects, (may be a collection, ArrayList, DataTable, or GenericList.), it is much easier to work. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;For More information with source code please refer &lt;a href="http://www.vbknowledgebase.com/?Id=113&amp;amp;Desc=LINQ-and-Entities-for-binding-GridView"&gt;LINQ and Entities GridView&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-5012781712749973537?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/5012781712749973537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/11/linq-and-entities-gridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5012781712749973537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5012781712749973537'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/11/linq-and-entities-gridview.html' title='LINQ and Entities GridView'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-3858682033052549787</id><published>2009-11-08T23:03:00.000-08:00</published><updated>2009-11-08T23:05:26.267-08:00</updated><title type='text'>WPF TreeView Binding with Dataset</title><content type='html'>TreeView is a fantastic control right from classic VB days. It is the best control to display hierarchically organized data. TreeView population by adding nodes through looping has gone. Now in the ASP.Net improved support by using XML to transform the Dataset to TreeView binding.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HierarchicalDataTemplate in mapping data&lt;/strong&gt;&lt;br /&gt;To recognize the node levels by TreeView we need HierarchicalDataTemplate. It will work if the dataset is Relational Database. And give a unique name that describes the relationships. Add a TextBlock for displaying the header table data. In this article we point categories as the Header Data. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Creating Templates for Nodes&lt;/strong&gt;&lt;br /&gt;For populating data in nodes we need a DataTemplate so later on if any control has to be added, and then we can add it to this template and bind respectively. Remember to provide a unique Key for the template. Then we can use this key for referring it in ItemTemplate of the HierarchicalDataTemplate.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configure the TreeView to use the Mapped ItemsSource&lt;/strong&gt;&lt;br /&gt;After placed the TreeView there are few things we need to configure it to bind the hierarchical template.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ItemsSource in TreeView&lt;/strong&gt;&lt;br /&gt;we need to specify in our case it is Categories Table as Parent Table. This is the table name we have to give while preparing the relational dataset (either in the query or later adding in the dataset which ever is relevant in your case but it is important)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ItemTemplate in TreeView&lt;/strong&gt;&lt;br /&gt;This is the Created HierarchicalDataTemplate x:key we need to pass along with such as {StaticResource CategoryTemplate}. The dataset has to be passed as DataContext in code behind.&lt;br /&gt;&lt;br /&gt;For Complete Source Code Please&amp;nbsp;&lt;strong&gt;Click Here&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=111&amp;amp;Desc=WPF-TreeView-Binding-With-Relational-Dataset"&gt;&lt;strong&gt;WPF TreeView Binding With Relational Dataset&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-3858682033052549787?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/3858682033052549787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/11/wpf-treeview-binding-with-dataset.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/3858682033052549787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/3858682033052549787'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/11/wpf-treeview-binding-with-dataset.html' title='WPF TreeView Binding with Dataset'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-6644213749809718779</id><published>2009-10-26T19:19:00.000-07:00</published><updated>2009-10-26T19:19:30.446-07:00</updated><title type='text'>VB Convert HTML to Image</title><content type='html'>&lt;strong&gt;Convert Web Page to an Image&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When we have to take a screenshot of the web page ( the whole page), this class will be useful. This class converts any web page written in any language of programming. &lt;strong&gt;Download the complete working source code here&amp;nbsp; &lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=65&amp;amp;Desc=Convert-Web-Page-or-Html-to-Image"&gt;&lt;strong&gt;Convert Web Page to Image&lt;/strong&gt;&lt;/a&gt;.&amp;nbsp;With the help of .Net 2.0&amp;nbsp;web browser Control taking thumb nails are becoming very easy.&lt;br /&gt;&lt;br /&gt;It makes this task relatively easier to obtain the&amp;nbsp;output of the URL given. Once the navigation completed , the image of screenshot can be taken by means of GDI.&lt;br /&gt;&lt;br /&gt;Use the event DocumentCompleted to find if the navigation of the web page was completed. Use a Bitmap object to pull the image.&lt;br /&gt;&lt;br /&gt;Again the taking of the screenshot of the given web page is the much easier with the use of&amp;nbsp;Internet browser component. DrawToBitmap&amp;nbsp;is useful to draw&amp;nbsp;bitmap image of the rendered web page. This image can be&amp;nbsp;saved in the hard disk or can be forced in the stream to show in another web page.&lt;br /&gt;&lt;strong&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;Download the complete working source code here&lt;/span&gt; &lt;/span&gt;&lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=65&amp;amp;Desc=Convert-Web-Page-or-Html-to-Image"&gt;&lt;strong&gt;&lt;span style="color: blue;"&gt;Convert Web Page to Image&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style="color: blue;"&gt;.&lt;/span&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-6644213749809718779?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/6644213749809718779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/10/vb-convert-html-to-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/6644213749809718779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/6644213749809718779'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/10/vb-convert-html-to-image.html' title='VB Convert HTML to Image'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-5137521040918226694</id><published>2009-10-19T19:11:00.000-07:00</published><updated>2009-10-19T19:11:02.244-07:00</updated><title type='text'>VB Calculator</title><content type='html'>&lt;strong&gt;VB&amp;nbsp;Calculator using Control Arrays&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;how to use the power of control arrays&amp;nbsp;for creating a simple&amp;nbsp;Calculator. If&amp;nbsp; implemented properly, it is much useful in reducing the code. Control Arrays can be used in the situations like whenever the need to repeat controls&amp;nbsp;multiple times. We can make them as an array, and the controls can be accessed by their index later on.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Control Arrays in the&amp;nbsp;form&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Create a Command Button named as Command1 and copy that and paste it 11 times.It will create a control arrat with 11 items.&lt;br /&gt;&lt;br /&gt;then assign the text appropriately. For more information on how to creat control arrays for Calculator&amp;nbsp;with complete working source code &lt;a href="http://www.vbknowledgebase.com/?Id=97&amp;amp;Desc=Visual-Basic-Calculator-Code-using-Control-Arrays"&gt;&lt;strong&gt;VB Calculator using Control Arrays&lt;/strong&gt;&lt;/a&gt;. Like wise create cmdOperator control array also. &lt;br /&gt;&lt;br /&gt;Now you can use the sample code to try (source code can be taken from the above link)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How the Calculator Code works&lt;/strong&gt;&lt;br /&gt;we are actually storing the Last Operator used and The first part of the number used in a class level variable.&amp;nbsp;Hence they can be accessed across the events and functions. &lt;br /&gt;&lt;br /&gt;For the complete working source code and the full article refer &lt;a href="http://www.vbknowledgebase.com/?Id=97&amp;amp;Desc=Visual-Basic-Calculator-Code-using-Control-Arrays"&gt;&lt;strong&gt;VB Calculator Code using Control Arrays&lt;/strong&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-5137521040918226694?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/5137521040918226694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/10/vb-calculator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5137521040918226694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/5137521040918226694'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/10/vb-calculator.html' title='VB Calculator'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-8334222158054616121</id><published>2009-10-17T18:35:00.000-07:00</published><updated>2009-10-17T18:46:38.672-07:00</updated><title type='text'>Ajax Cascading Dropdown</title><content type='html'>&lt;strong&gt;Javascript&amp;nbsp;based Asp.Net Ajax&amp;nbsp;dropdown&lt;/strong&gt; The following is highly performance oriented approach. The data is transferred from web server to client using &lt;u&gt;web service&lt;/u&gt;. So the data transfer between server and client is very minimal. For&amp;nbsp;very small data&amp;nbsp;you can experience the cascading very fast. for a fully working complete source code refer here &lt;a href="http://www.vbknowledgebase.com/?Id=104&amp;amp;Desc=JavaScript-Ajax-Cascading-Dropdown"&gt;JavaScript Ajax Cascading Dropdown&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In Web Form&lt;/strong&gt;&lt;br /&gt;Select&amp;nbsp;&lt;strong&gt;Ajax&lt;/strong&gt; controls&amp;nbsp;from tool box.Drag the &lt;strong&gt;Cascading Dropdown &lt;/strong&gt;to the Web form.Right click the website and add a web service named NorthwindDataService.asmx&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In Web Service&lt;/strong&gt;&lt;br /&gt;import AjaxControlToolkit using Imports AjaxControlToolkit in the top, (&lt;em&gt;AjaxControlToolkit&lt;/em&gt; has to be downloaded seperately). Add a new function named as GetCategories with the following paramters&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CascadingDropDownNameValue&lt;/strong&gt;: Ajax control kit needs this object back for loading data [dont change name]&lt;br /&gt;&lt;strong&gt;category&lt;/strong&gt;: The category for filtering data[dont change name]&lt;br /&gt;&lt;br /&gt;import System.Data using Imports System.Data in the top &lt;br /&gt;import System.Data.SqlClient also&lt;br /&gt;&lt;br /&gt;bind the&amp;nbsp;Cascading Dropdown control with the web service and web method.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Fill up the following&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ServicePath&lt;/strong&gt;="NorthwindDataService.asmx" &lt;br /&gt;&lt;strong&gt;ServiceMethod&lt;/strong&gt;="GetCategories" &lt;br /&gt;&lt;strong&gt;Category&lt;/strong&gt;="CategoryName" &lt;br /&gt;&lt;br /&gt;For more detailed complete working source code refer here &lt;a href="http://www.vbknowledgebase.com/?Id=104&amp;amp;Desc=JavaScript-Ajax-Cascading-Dropdown"&gt;Ajax Cascading Dropdown&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-8334222158054616121?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/8334222158054616121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/10/ajax-cascading-dropdown.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8334222158054616121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/8334222158054616121'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/10/ajax-cascading-dropdown.html' title='Ajax Cascading Dropdown'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-3092321451334861145</id><published>2009-10-17T08:33:00.000-07:00</published><updated>2009-10-17T08:36:28.646-07:00</updated><title type='text'>HTML Guestbook in ASP.Net</title><content type='html'>&lt;strong&gt;File Based Simple Guestbook &lt;/strong&gt;&lt;br /&gt;To&amp;nbsp;develop a Guest Book with just plain HTML some server side technologies required in server to track the guests.&amp;nbsp;Since it is easier to find Asp.Net host .&amp;nbsp;Even the databases are the best to store guest book entries. To&amp;nbsp;explain simpler I have used a flat file for GuestBook. You can find&amp;nbsp;working complete source&amp;nbsp;code for GuestBook &lt;a href="http://www.vbknowledgebase.com/?Id=99&amp;amp;Desc=Free-guestbook-HTML-by-visual-basic-source-code"&gt;HTML Guestbook by VB ASP.Net&lt;/a&gt; , I am just writing some code for beginners to learn how to start with.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Write GuestBook Entry To File System&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A&amp;nbsp;guest book is going to be a file based system. We&amp;nbsp;can delimit the data in a proper way.&amp;nbsp;Hence the data can be presented nicely. one is for the row delimiter another is a column delimiter. so we will use ~ to differentiate each row. and with in the row we can use &lt;br /&gt;to delimit the columns&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Parse the Guest Book Text file&lt;/strong&gt;&lt;br /&gt;GuestBook.Txt can be parsed again with another one aspx file to load in to the screen by using a Split () function&lt;br /&gt;&lt;br /&gt;'~' To delimit a guest entry&lt;br /&gt;&lt;br /&gt;'&lt;br /&gt;' To delimit attributes as name email and comments&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;First split using ‘~’, will get the entire guest book entry for one visitor. Take that entry and parse again using split with &lt;br /&gt;, First element is Name, Second element is e-mail, third element is comments. It can be displayed easily with some HTML formatting.&lt;br /&gt;For a complete working source code pleaser continue reading here &lt;a href="http://www.vbknowledgebase.com/?Id=99&amp;amp;Desc=Free-guestbook-HTML-by-visual-basic-source-code"&gt;HTML Guestbook by visual basic source code&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-3092321451334861145?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/3092321451334861145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/10/html-guestbook-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/3092321451334861145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/3092321451334861145'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/10/html-guestbook-in-aspnet.html' title='HTML Guestbook in ASP.Net'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3366468919231472940.post-2991772146709966111</id><published>2009-10-09T04:27:00.000-07:00</published><updated>2010-07-29T18:31:47.099-07:00</updated><title type='text'>Read text file using VB6</title><content type='html'>&lt;strong&gt;Read text file using Classic Visual Basic &lt;/strong&gt;&lt;br /&gt;I would like to explain various to read the entire &lt;u&gt;text file&lt;/u&gt; into a string using &lt;strong&gt;VB6&lt;/strong&gt;. The first and easy way to read is using the simple open method. For this method, we need to allocate a unique &lt;strong&gt;file&lt;/strong&gt; number for opening. And the same number should be used for closing also. &lt;br /&gt;Use the following modes to open Append, Binary, Input, Output, or Random. default is Random . &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using FileSystemObject&lt;/strong&gt;With FileSystemObject File IO operations are very easier in &lt;strong&gt;VB&lt;/strong&gt;. Almost all the required functions are well defined. For reading, we have to use OpenTextFile method in the FileSystemObject. Once opened, A TextStream object can be used to fetch the data. To fetch line by line we need to loop through until we reach EOF. To find the EOF, FileSystemObject has a property AtEndOfStream. When it is true, it represents that the end of file is reached. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Using the Open method &lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Using a open method is much easier and effective way of &lt;strong&gt;reading a file.&lt;/strong&gt; It is continued from earlier versions of the visual basic. Because of it's simplicity, we can see this in a lot of places. Once file is opened please close it immediately after used. This open method is working based on a unuique FileNumber. So the same FileNumber has to be used to close aswell.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Refer here for the complete article and full working source code &lt;/strong&gt;&lt;a href="http://www.vbknowledgebase.com/?Id=23&amp;amp;Desc=Read-Text-File-into-string-VB6"&gt;&lt;strong&gt;Read Text File using Classic VB&lt;/strong&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3366468919231472940-2991772146709966111?l=vbguide.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbguide.blogspot.com/feeds/2991772146709966111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbguide.blogspot.com/2009/10/read-text-file-using-vb6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2991772146709966111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3366468919231472940/posts/default/2991772146709966111'/><link rel='alternate' type='text/html' href='http://vbguide.blogspot.com/2009/10/read-text-file-using-vb6.html' title='Read text file using VB6'/><author><name>Pon Saravanan</name><uri>http://www.blogger.com/profile/11048789597050516594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
