<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7839837632136915848</atom:id><lastBuildDate>Mon, 28 Nov 2011 00:25:24 +0000</lastBuildDate><category>Compiling a Native C++ Program from the Command Line (C++)</category><category>interview question .net</category><category>Linux and windows</category><category>low ranking of new domains</category><category>read XML from a file by using Visual C# .NET</category><category>smtp mail using sql server</category><category>ArrayList</category><category>Assemblies</category><category>Precompilation In ASP.Net</category><category>Turn off xp login screen unread mail count.</category><category>read XML from a file</category><category>Write TO Excel using vb.net</category><category>open source Web Development Tools and applications</category><category>Mobile Secrets</category><category>Advantage of ArrayList</category><category>To compile a Visual C++ .NET console application on the command line</category><category>Convert ascii to int using asp.net</category><category>E-mail Password Hacking Programs</category><category>open source Web Development Tools</category><category>Dynamic DNS</category><category>generate an assembly from the source code</category><category>clipboard hacking</category><category>How to add Software Expriation</category><category>install the software  only on one computer:</category><category>https security</category><category>White Hat and Grey Hat Hacker</category><category>To Clear TextBox</category><category>Windows Hack</category><category>cache for your web pages</category><category>Decode Yahoo Messenger Messages Archive</category><category>Creating new domain names</category><category>windows services</category><category>mail sender  Ip Address</category><category>.Net Fundementals</category><category>Ranking factors in the Google search engine</category><category>Top Tips to Become a Hacker</category><category>active desktop recovery</category><category>cannot find codebehind class in asp.net</category><category>List of Web Messengers For Your Convenience</category><category>SMS</category><category>Build your own search engine</category><category>How to Run Multiple Yahoo Messenger Simultaneously</category><category>C#.Net Fundamentals</category><category>Nokia</category><category>Gmail Sender Ip</category><category>secure data using cryptography</category><category>increase Page Rank</category><category>Difference Between Hacker and Cracker</category><category>Cross Thread</category><category>Crystal Report</category><category>Compiling C++ programs using VC++ .net</category><category>asp.net interview questions</category><category>secure data</category><category>disable link navigation</category><category>register ASP.NET with my IIS Web Server</category><category>Hacking</category><category>Creating and Configuring Web Sites in Windows Server 2003</category><category>SEO Tips</category><category>disable hyperlink</category><category>Search for tools on Hackers Websites and forums</category><category>Convert int to ascci using asp.net</category><category>Easily Show The Contents of Password Fields</category><category>Connect MS Acess with VB.Net</category><category>Compilation Using Asp.Net</category><category>Change Admin Password in Windows XP</category><category>Windows Boot</category><category>Dual Boot</category><category>Parsing XML with XmlDocument</category><category>Active directory</category><category>Delegates in C#</category><category>Mobile Hack</category><category>Security and privacy information for the web surfer.</category><category>What is .NET</category><category>Read and Write To XML</category><category>sony erricson</category><category>Search Engine For Site</category><category>Password hack in Xp</category><category>Friend Assemblies</category><category>Windows Logo Change</category><category>Google Page rank</category><category>emacs commands</category><category>Register Clients Script</category><category>image</category><category>Print using DataGrid Class</category><category>SMS through Bluetooth</category><category>boot sequence</category><category>Hidden Emoticons For Yahoo</category><category>search engine using regular expressions</category><category>image upload</category><category>start and stop windows services</category><category>Get Password</category><category>Clipboard</category><category>Find TextBox Empty</category><category>Easily Send and Receive Emails from Multiple Email Accounts</category><category>Windows XP User Account with Random Password</category><category>Hackers</category><category>Registry Edit</category><category>redirect http</category><category>Ip adrdress</category><category>.Net Technologies</category><category>MySQL and SQL Server</category><category>The Google Sandbox effect</category><category>Detect Invisible Users on Yahoo Messenger</category><category>difference between MSSQLserver and mysql</category><category>Delegates</category><category>Download any file from ASP.NET</category><category>Saving an Image in a SQL Server Database</category><category>smtp mail</category><category>How To Find Hidden Passwords</category><category>SEO</category><category>Active directory Programming in C#</category><category>Hidden Emoticons</category><category>Printing using Vb.Net</category><category>ADO.Net Connection with MS Access</category><category>This error can happen to the form designer</category><category>SMS through Mail</category><category>error can happen to the form designer</category><category>nvisible Users on Yahoo Messenger</category><category>Linux Boot</category><category>Password Crack</category><title>Program Solution</title><description>Solution to Problems that existed during programming and a small Knowledge repository to some extend.</description><link>http://programsolution.blogspot.com/</link><managingEditor>noreply@blogger.com (Bishar.B.N)</managingEditor><generator>Blogger</generator><openSearch:totalResults>103</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/VisualStudio" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="visualstudio" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><itunes:explicit>yes</itunes:explicit><itunes:subtitle>Solution to Problems that existed during programming and a small Knowledge repository to some extend.</itunes:subtitle><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-1145349552649657824</guid><pubDate>Mon, 17 May 2010 13:19:00 +0000</pubDate><atom:updated>2010-05-17T17:24:03.742+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Precompilation In ASP.Net</category><category domain="http://www.blogger.com/atom/ns#">Compilation Using Asp.Net</category><title>Precompilation In ASP.Net</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7sVoTSdbv4c/S_FDP3EekgI/AAAAAAAABMc/gZbkTxhBtFQ/s1600/Precomplation1.png"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7sVoTSdbv4c/S_FDPSXtrCI/AAAAAAAABMU/29OoUClvM8M/s1600/Precomplation.png"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;In this article we will explore the benefits and caveats around pre-compilation and the new aspnet_compiler tool. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;When the first request arrives at your web application there is a mind-numbing amount of work to do. The worker process starts, the runtime initializes, ASPX pages are parsed and compiled to intermediate language, methods are just-in-time compiled to native code - and the list goes on and on. If you want to cut out some of the overhead and improve the startup time of your application, then you’ll want to look at the precompile features in ASP.NET 2.0. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;Although pre-compilation will give our site a performance boost, the difference in speed will only be noticeable during the first request to each folder. Perhaps a more important benefit is the new deployment option made available by the precompile - the option to deploy a site without copying &lt;i&gt;any&lt;/i&gt; of the original source code to the server. This includes the code and markup in aspx, ascx, and master files. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;In this article we will explore the benefits and caveats around pre-compilation and the new aspnet_compiler tool. There are two modes for pre-compilation: in place pre-compilation and pre-compilation for deployment. We will take a look at in place pre-compilation first. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;In Place Pre-compilation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;By default, ASP.NET dynamically parses and compiles all the ASPX pages in a folder when the first request arrives for a page inside that folder. ASP.NET also needs to compile applicable files in the special folders, like App_Code, on the first request, and any code-behind files associated with ASPX and ASCX files. The runtime caches all the compilation results in order to quickly process later requests, and does not need to recompile again unless someone edits a file. This behavior gives us a great deal of flexibility, including the flexibility to change code and markup and instantly have the changes reflected in the next browser request. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;The price for this flexibility is the performance hit on the first request. Some people have found their ASP.NET applications to be slow starters. These people usually work in the sales department and perform software demos in front of customers. In place pre-compilation makes the “first hit” to a web application and forces all pages and code in the application to compile. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7sVoTSdbv4c/S_FDPSXtrCI/AAAAAAAABMU/29OoUClvM8M/s1600/Precomplation.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 92px;" src="http://2.bp.blogspot.com/_7sVoTSdbv4c/S_FDPSXtrCI/AAAAAAAABMU/29OoUClvM8M/s400/Precomplation.png" alt="" id="BLOGGER_PHOTO_ID_5472228952140262434" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;The tool to use for pre-compilation is the aspnet_compiler executable, which you can find in the %WINDIR%\Microsoft.NET\Framework\v2.x.xxxx directory. If we have a web application in the WebSite1 virtual directory under IIS, we could use the following command line to compile the application. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="Picture_x0020_1" spid="_x0000_i1026" type="#_x0000_t75" alt="http://odetocode.com/aimages/precompilation/figure1.png" style="'width:441.75pt;"&gt;  &lt;v:imagedata src="file:///C:\Users\Timeline\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png" title="figure1" grayscale="t"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;The –v parameter specifies that we are passing a virtual path to our web site. On servers with multiple websites you may need to use the –m parameter and specify the full IIS metabase path to the application (-m /LM/W3SVC/1/Root/WebSite1). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;The pre-compiled code will end up inside of the Temporary ASP.NET File directory, just as it would when the runtime compiles files for a browser request. Inside of the bin directory for the compiled site, you’ll find the assemblies (dll files). The compiler generates special filenames to avoid naming collisions. In the shot below, the dll starting with App_Code contains the code from the App_Code directory – not too surprising. Each folder containing aspx, or ascx files will compile into a dll prefixed with App_Web. The files with a .compiled extension contain XML with information about which original source code file maps to which assembly. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7sVoTSdbv4c/S_FDP3EekgI/AAAAAAAABMc/gZbkTxhBtFQ/s1600/Precomplation1.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 241px;" src="http://1.bp.blogspot.com/_7sVoTSdbv4c/S_FDP3EekgI/AAAAAAAABMc/gZbkTxhBtFQ/s400/Precomplation1.png" alt="" id="BLOGGER_PHOTO_ID_5472228961991692802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;With the compiled files in place your web application should have a slightly better startup time, but a primary benefit to in place pre-compilation will be the ability to ensure the web application is error free. If you happen to modify a class or web form and leave an error in the file, the aspnet_compiler will fail and display the compiler error. The tool will also display any warnings, but warning will not stop compilation. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Pre-compilation For Deployment&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;Pre-compilation for deployment creates an ‘executable’ (no source code) version of your web application. With pre-compilation for deployment you give the aspnet_compiler the path to your source code, and the path to a target directory for the compilation results, like below. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;aspnet_compiler -p "C:\MyDevelopment\WebSite1" -v / C:\Staging&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;This command will compile the site and place the result in C:\Staging. You must still specify –v as a parameter, even though we are not using a virtual path as either a source or a destination. Instead, the compiler will use this parameter to resolve application root references (~). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;The pre-compilation for deployment step will recreate your web site’s folder structure in the destination directory. All of the static files (HTML files, image files, configuration files) are copied into the folder structure exactly as they appear in the source folder hierarchy. A bin directory will appear in the target directory with all of the assemblies and .compiled files. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;The target directory will contain &lt;i&gt;no&lt;/i&gt; source code. All of the classes in the App_Code folder are now compiled into one or more assemblies in the bin directory, and no .cs or .vb files will exist in the target directory. Master page files will also compile to the bin directory and not exist. All the code and markup in ASPX, ASCX, and ASHX files, along with any associated code-behind files, will live inside of one or more assemblies in the bin directory, although these files &lt;i&gt;will&lt;/i&gt; still exist in the target directory, they exist as nearly empty ‘marker’ files. If you open an ASPX file in a pre-compiled target directory you’ll see the following content: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;This is a marker file generated by the precompilation tool, and should not be deleted!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;Note: this behavior is as of beta 2 and may change. The IIS script map for the ASPX file extension leaves the “Verify that file exists” checkbox unchecked, and the site will work without &lt;i&gt;any&lt;/i&gt; of the ASPX files present. There is, however, a problem getting IIS to serve a default document for a directory request unless the file is present.  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;Once the application finishes compiling you can FTP or XCOPY the target directory to a web server (or map a virtual directory to the target directory), and the application will be ready to run. A benefit to pre-compilation for deployment is that no one can make changes to the web application by tweaking the source code – no source code exists! In fact, you can’t even place a new ASPX file into the existing application directory structure without causing an error. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;Making a change to your site will require you to make a change in the original source code, pre-compile the application again, and redeploy all files to the server. There is one caveat in this scenario, in that pre-compilation generates unique filenames for some assemblies in the bin folder, and these filenames will change each time the pre-compiler executes. The first time you run aspnet_compiler you might see App_Web_lufhs9vn.dll in the bin directory, the next time you might see App_Web_hviqdkt.dll with the same compiled code, even though no source file has changed. This means you might have unneeded dlls in your bin directory if you keep repeatedly copy files to the server without cleanup. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;Update: use the -fixednames switch to generate repeatable assembly names.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;For some people, the ability to update content on the web server by modifying aspx and ascx files is a needed feature. To support this scenario, the aspnet_compiler has the –u switch for an “updateable” pre-compilation. With updateable pre-compilation the ASPX, ASCX, ASHX, and MASTER files are copied to the target directory in tact - they do not become ‘marker’ files. You can deploy these files to the server and modify them without causing an error, because the ASP.NET runtime will dynamically parse and compile these files. All of the source code for code-behind files and in the App_Code folder will still be compiled into assemblies and will not need to be deployed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Miscellany&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;A few other features of the aspnet_compiler include the –d switch, which tells the compiler to generate debugging symbols for the application. Debugging symbols are required if you need line numbers in the stack traces of exceptions. The –f switch will force the compiler to overwrite a target directory, even if a precompiled application already exists there. There are also options to give compiled assemblies a strong name, and allow partially trusted callers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;In addition, you can pre-compile an application directly from Visual Studio 2005 using the Build -&gt; Publish menu item. The Publish Web Site dialog will let you select an http, ftp, or local file system destination as the target. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;The precompiler also supports strong naming with the -keyfile, -keycontainer, and -delaysign switches. To allow partially trusted callers, use the -aptca switch.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Wrap Up&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;Although performance is often touted as a benefit of pre-compilation, I tend to think of pre-compilation as a safety feature. Safety in knowing all of the code in a web application compiles without an error, and safety in keeping your source code out of a shared host environment. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-1145349552649657824?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2010/05/precompilation-in-aspnet.html</link><author>noreply@blogger.com (Bishar.B.N)</author><media:thumbnail url="http://2.bp.blogspot.com/_7sVoTSdbv4c/S_FDPSXtrCI/AAAAAAAABMU/29OoUClvM8M/s72-c/Precomplation.png" height="72" width="72" /><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-4504974627445928630</guid><pubDate>Sat, 08 May 2010 07:22:00 +0000</pubDate><atom:updated>2010-05-08T11:34:48.270+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ADO.Net Connection with MS Access</category><category domain="http://www.blogger.com/atom/ns#">Connect MS Acess with VB.Net</category><title>Sample  Project using MS Access Connection with ADO.Net</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7sVoTSdbv4c/S-UTukEi4pI/AAAAAAAABME/gZfUh9IgVi8/s1600/SampleProject.png"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;This is Sample Project for Connecting the MS Access DataBase with the Vb.Net.I had included a Customer Master screen for saving Data.&lt;br /&gt;&lt;br /&gt;Here there a Class ADO.Net to access the Database from the Application.This can be used as template for small utility programs.&lt;br /&gt;&lt;br /&gt;Hope this could a Simple and very fast way to access the DB.if you have any queries regarding these please let me know that.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7sVoTSdbv4c/S-UTukEi4pI/AAAAAAAABME/gZfUh9IgVi8/s1600/SampleProject.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 246px;" src="http://4.bp.blogspot.com/_7sVoTSdbv4c/S-UTukEi4pI/AAAAAAAABME/gZfUh9IgVi8/s400/SampleProject.png" alt="" id="BLOGGER_PHOTO_ID_5468799013188985490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;you can download the sample from here...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.drivehq.com/file/df.aspx/publish/bishar/PublicFolder/InvoicePrinting.rar"&gt;Download From Here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-4504974627445928630?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2010/05/sample-project-using-ms-access.html</link><author>noreply@blogger.com (Bishar.B.N)</author><media:thumbnail url="http://4.bp.blogspot.com/_7sVoTSdbv4c/S-UTukEi4pI/AAAAAAAABME/gZfUh9IgVi8/s72-c/SampleProject.png" height="72" width="72" /><thr:total>0</thr:total><enclosure url="http://www.drivehq.com/file/df.aspx/publish/bishar/PublicFolder/InvoicePrinting.rar" length="269175" type="application/x-msdownload" /><media:content url="http://www.drivehq.com/file/df.aspx/publish/bishar/PublicFolder/InvoicePrinting.rar" fileSize="269175" type="application/x-msdownload" /><itunes:explicit>yes</itunes:explicit><itunes:subtitle> This is Sample Project for Connecting the MS Access DataBase with the Vb.Net.I had included a Customer Master screen for saving Data. Here there a Class ADO.Net to access the Database from the Application.This can be used as template for small utility pr</itunes:subtitle><itunes:author>noreply@blogger.com (Bishar.B.N)</itunes:author><itunes:summary> This is Sample Project for Connecting the MS Access DataBase with the Vb.Net.I had included a Customer Master screen for saving Data. Here there a Class ADO.Net to access the Database from the Application.This can be used as template for small utility programs. Hope this could a Simple and very fast way to access the DB.if you have any queries regarding these please let me know that. you can download the sample from here... Download From Here</itunes:summary><itunes:keywords>ADO.Net Connection with MS Access, Connect MS Acess with VB.Net</itunes:keywords></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-7638966313662181717</guid><pubDate>Sat, 08 May 2010 05:41:00 +0000</pubDate><atom:updated>2010-05-08T09:44:31.864+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Password Crack</category><category domain="http://www.blogger.com/atom/ns#">Get Password</category><title>Get Password from SAM Files</title><description>&lt;p&gt; &lt;span style="font-size:85%;"&gt;Introduction &lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-size:85%;"&gt;I know that this topic has been covered by others on more  than one occasion, but I figured I'd go over it yet again and throw in an update or two. Let me  start with  what this is all about: SAM Files &amp;amp; NT Password Hashes.   &lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-size:85%;"&gt;NT Password Hashes - When you type your password into a  Windows NT, 2000, or XP login Windows encrypts your password using an encryption scheme that turns  your password  into something that looks like this: &lt;/span&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; 7524248b4d2c9a9eadd3b435c51404ee &lt;/p&gt;&lt;p&gt; This is a password Hash.  This is what is actually being checked against  when you  type your password in.  It encrypts what you typed and bounces it  against what is  stored in the Registry and/or SAM File. &lt;/p&gt;&lt;p&gt; SAM File - Holds the user names and password hashes for every account on  the local  machine, or domain if it is a domain controller.  Simple enough wouldn't  you say? &lt;/p&gt;&lt;p&gt;§ Where do I find the SAM/Hashes? &lt;/p&gt;&lt;p&gt; You can find what you're looking for in several locations on a given  machine. &lt;/p&gt;&lt;p&gt; It can be found on the hard drive in the folder  %systemroot%system32config.   However this folder is locked to all accounts including Administrator  while the  machine is running.  The only account that can access the SAM file  during operation  is the "System" account.   &lt;/p&gt;&lt;p&gt; You may also be able to find the SAM file stored in %systemroot% epair if the NT Repair Disk Utility a.k.a. rdisk has been run and the Administrator has  not removed the backed up SAM file. &lt;/p&gt;&lt;p&gt; The final location of the SAM or corresponding hashes can be found in  the registry. It can be found under HKEY_LOCAL_MACHINESAM.  This is also locked to all  users,  including Administrator, while the machine is in use. &lt;/p&gt;&lt;p&gt; So the three locations of the SAMHashes are:&lt;/p&gt;&lt;p&gt;    - %systemroot%system32config&lt;/p&gt;&lt;p&gt;    - %systemroot% epair (but only if rdisk has been run)&lt;/p&gt;&lt;p&gt;    - In the registry under HKEY_LOCAL_MACHINESAM    &lt;/p&gt;&lt;p&gt;§ Obtaining the SAMPassword Hashes &lt;/p&gt;&lt;p&gt; Wow, how wonderful.  Now we know where the goods are, and the problem is  this... "How do I get my hands on those hashes?"  The answer is "One of four  ways." &lt;/p&gt;&lt;p&gt; 1) Probably the easiest way to do this is to boot your target machine to  an     alternate OS like NTFSDOS or Linux and just copy the SAM from the            %systemroot%system32config folder.  It's quick, it's easy, and it's  effective.      You can get a copy of NTFSDOS from  Sysinternals(http://www.sysinternals.com)      The regular version of NTFSDOS is freeware, which is always nice, but  only allows    for Read-Only access.  This should be fine for what you want to do,  however, if     you're the kind of person that just has to have total control and has  some money to     burn.  NTFSDOS Pro, which is also by Sysinternals has read/write  access but it'll     cost you $299. &lt;/p&gt;&lt;p&gt; 2) Once again, you may be able to obtain the SAM from %systemroot% epair if rdisk     has been run and you are lucky enough to have a sloppy admin. &lt;/p&gt;&lt;p&gt; 3) You can also get password hashes by using pwdump2.  pwdump uses .DLL  injection in     order to use the system account to view the password hashes stored in  the registry.    It then pulls the hashes from the registry and stores them in a handy  little text     file that you can then import into a password cracking utility like  l0phtcrack. &lt;/p&gt;&lt;p&gt; 4) The final way to obtain password hashes is to listen directly to the  network      traffic as it floats by your computer and grab hashes using the above  mentioned        l0phtcrack.   &lt;/p&gt;&lt;p&gt; § Cracking Password Hashes &lt;/p&gt;&lt;p&gt; With the hashes in hand and an eagerness to find out what passwords lie  waiting.   Let's get cracking.  While there are numerous programs available for the  use of password cracking I will quickly cover two of the most popular ones. &lt;/p&gt;&lt;p&gt; John the Ripper -  John the Ripper is to many, the old standby password cracker.  It is  command line which makes it nice if you're doing some scripting, and best of all it's  free. The only real thing that JtR is lacking is the ability to launch Brute  Force attacks against your password file.  But look at it this way, even though it is  only a  dictionary cracker, that will probably be all you need. I would say that  in my  experience I can find about 85-90% of the passwords in a given file by  using just a  dictionary attack.  Not bad, not bad at all. &lt;/p&gt;&lt;p&gt; L0phtCrack - Probably the most wildly popular password cracker out there.  L0phtCrack  is sold by the folks at @Stake. And with a pricetag of $249 for a single user  license it  sure seems like every one owns it.  Boy, @Stake must be making a  killing. :)  This  is probably the nicest password cracker you will ever see.  With the  ability to  import hashes directly from the registry ala pwdump and dictionary,  hybrid, and  brute-force capabilities.  No password should last long.  Well, I  shouldn't say  "no password".  But almost all will fall to L0phtCrack given enough  time.  &lt;/p&gt;&lt;p&gt; § Injecting Password Hashes into the SAM &lt;/p&gt;&lt;p&gt; Probably one of my favorite and easiest ways to gain Administrator  privileges on a machine, is by injecting password hashes into the SAM file.  In order to  do this you will need physical access to the machine and a brain larger than a  peanut.  Using a utility called "chntpw" by Petter Nordhal-Hagen you can inject whatever  password you wish into the SAM file of any NT, 2000, or XP machine thereby giving you  total  control.  I would suggest backing up the SAM file first by using an  alternate OS.   Go in, inject the password of your choosing.  Login using your new  password.  Do what you need to do.  Then restore the original SAM so no one knows you were  there.   &lt;/p&gt;&lt;p&gt; § Password Strength &lt;/p&gt;&lt;p&gt; By looking at the methods above, you can see the importance in keeping  strong  passwords.  Someone may be able to get there hands on your hashes, but  it's whether  or not they can crack them that is the real test.  Don't make it easy on  them.   &lt;/p&gt;&lt;p&gt; When I create a password I like to use the first letter of each word in a  phrase.   Like "Password Strength is important so I pick good passwords" would be  "psiisipgp".   Now you have a 9 character password that isn't in any dictionary I know  of.  Bye Bye  John the Ripper.   &lt;/p&gt;&lt;p&gt; Now I like to flank passwords in special characters like "@$%?", now  your password  is ?psiisipgp?.  This will ensure L0phtCrack takes a long time cracking  it, giving you time to change it if you discover a breach, or just change  your passwords  regularly.   &lt;/p&gt;&lt;p&gt; If you want to get insane, like I do, you can add non-printable ascii  characters to  your passwords.  Using the Alt key and the numbers on your number pad,  hold Alt and  key in 149.  you should get a character like this "ò".  Flank your  password with this  before your question marks and now you've got a secure password.   ?òpsiisipgpò? can't be cracked by L0phtCrack since it doesn't allow for non-printable ascii  characters. Bye Bye L0phtCrack. &lt;/p&gt;&lt;p&gt; I know this may seem like a lot to do, but let's face it, a weak  password is a  cracked password.  &lt;/p&gt;&lt;p&gt; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- &lt;/p&gt;&lt;p&gt; NTFSDOS - (&lt;a href="http://www.sysinternals.com"&gt;http://www.sysinternals.com&lt;/a&gt;) &lt;/p&gt;&lt;p&gt; pwdump2 - &lt;a href="%28http://www.webspan.net/%7Etas/pwdump2/"&gt;(http://www.webspan.net/~tas/pwdump2/&lt;/a&gt;) &lt;/p&gt;&lt;p&gt; John the Ripper - (&lt;a href="http://www.openwall.com/john/"&gt;http://www.openwall.com/john/&lt;/a&gt;) &lt;/p&gt;&lt;p&gt; L0phtCrack - (&lt;a href="http://www.atstake.com/research/lc3/"&gt;http://www.atstake.com/research/lc3/&lt;/a&gt;) &lt;/p&gt;&lt;p&gt; chntpw - (&lt;a href="http://home.eunet.no/%7Epnordahl/ntpasswd/"&gt;http://home.eunet.no/~pnordahl/ntpasswd/&lt;/a&gt;) &lt;/p&gt; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-7638966313662181717?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2010/05/get-password-from-sam-files.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-7612752294300468905</guid><pubDate>Wed, 18 Jun 2008 09:54:00 +0000</pubDate><atom:updated>2008-06-18T13:56:14.462+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Convert int to ascci using asp.net</category><category domain="http://www.blogger.com/atom/ns#">Convert ascii to int using asp.net</category><title>Convert int to ascci using asp.net</title><description>Converting INTEGER into an ASCII char is very simple . In C# we dont need to do anything special, just type-cast the INT into a CHAR.&lt;br /&gt;&lt;br /&gt;int i = 65;&lt;br /&gt;char a = (char) i;&lt;br /&gt;Console.WriteLine("Result : "+a.toString());&lt;br /&gt;&lt;br /&gt;Result : A&lt;br /&gt;&lt;br /&gt;Converting ASCII char into an INTEGER is also same way but vice versa.Type-casting CHAR into an INT.&lt;br /&gt;&lt;br /&gt;char a = 'A';&lt;br /&gt;int i = (int) a;&lt;br /&gt;Console.WriteLine("Result : "+i.toString());&lt;br /&gt;&lt;br /&gt;Result : 65&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-7612752294300468905?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/06/convert-int-to-ascci-using-aspnet.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-6492918639562006200</guid><pubDate>Thu, 01 May 2008 11:39:00 +0000</pubDate><atom:updated>2008-05-01T15:44:09.903+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Fundementals</category><title>.Net Fundementals</title><description>&lt;span style="font-weight: bold;"&gt;Asp.net Documents&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ASP.NET is one of the more powerful tools available for building Web applications. Learn to use Microsoft Visual Studio 2005 to build database-driven ASP.NET Web applications. We cover the fundamentals of Visual Studio 2005; the various server side controls; the page life cycle; databinding in ASP.NET; how to design a three-tiered application complete with a presentation layer, business layer, and data access layer; using ADO.NET to select, insert, update, and delete data; design user controls for component-based applications; optimize a Web application with caching; and other topics. Students may choose to work in either C# or VB.NET.&lt;br /&gt;&lt;br /&gt;Prerequisites:&lt;br /&gt;Prerequisites: Experience in object-oriented programming or proficiency in developing Web applications and client server technology.&lt;br /&gt;Visual Basic .NET Programming&lt;br /&gt;&lt;br /&gt;X52.9294 / Continuing Education / $1,095&lt;br /&gt;SUMMER 2008&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;VB.Net&lt;/span&gt;&lt;br /&gt;Programmers use Visual Basic.NET (VB.NET) for rapid development of browser-based Windows applications. In this course, students with Windows programming experience learn the basics of VB.NET. Understand the .NET framework, which implements Microsoft's support for Web services; the common language runtime, which allows programs to be run in any Windows environment; VB.NET syntax; object-oriented programming in VB.NET; error handling; and database access in VB.NET. Upon completion of the course, students can build database-driven VB.NET applications that use Web services.&lt;br /&gt;&lt;br /&gt;Prerequisites:&lt;br /&gt;Prerequisite: Prior experience in one of the following: C, C++, Visual Basic, Java, or PERL.&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;C# .NET Programming&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;X52.9295 / Continuing Education / $1,095&lt;br /&gt;SUMMER 2008&lt;br /&gt;&lt;br /&gt;Microsoft's newest object-oriented language, C#, allows programmers to rapidly build applications for the Microsoft .NET platform. Learn about C#'s support for constructors, methods, overloaded methods, and static methods. Topics include object cleanup and data, field method and property access, base classes, data access between classes, cloning, identity, equivalence, and inheritance, as well as other C# features.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-6492918639562006200?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/05/net-documents.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-8584115708773980723</guid><pubDate>Thu, 01 May 2008 11:36:00 +0000</pubDate><atom:updated>2008-05-01T15:44:50.253+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Write TO Excel using vb.net</category><title>Write TO Excel using vb.net</title><description>'Programmer :Bishar&lt;br /&gt;'Date       :26-03-08&lt;br /&gt;&lt;br /&gt;Imports System.IO&lt;br /&gt;Imports Microsoft.Office.Interop&lt;br /&gt;Imports System.Text.RegularExpressions&lt;br /&gt;&lt;br /&gt;Public Class Form1&lt;br /&gt;&lt;br /&gt;   Private Sub btnbrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbrowse.Click&lt;br /&gt;       If (FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK) Then&lt;br /&gt;           txtpath.Text = FolderBrowserDialog1.SelectedPath&lt;br /&gt;       End If&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;       FolderBrowserDialog1.ShowNewFolderButton = False&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;   Private Sub btnconvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnconvert.Click&lt;br /&gt;       Dim excelapp As New Excel.Application&lt;br /&gt;       Dim excelbook As Excel.Workbook&lt;br /&gt;       excelbook = excelapp.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet)&lt;br /&gt;       Dim excelWorksheet As Excel.Worksheet = CType(excelbook.Worksheets(1), Excel.Worksheet)&lt;br /&gt;       Dim filename As String = ""&lt;br /&gt;       Dim objrange As Excel.Range = Nothing&lt;br /&gt;       Dim m_objFont As Excel.Font = Nothing&lt;br /&gt;       Dim cellcount As Integer = 1&lt;br /&gt;       Dim testfile As String = ""&lt;br /&gt;       Dim progressmax As Integer = 100&lt;br /&gt;       Dim labelincr As Integer = 0&lt;br /&gt;       Dim NILLCHAR As String = "-"&lt;br /&gt;       Try&lt;br /&gt;&lt;br /&gt;           If (txtpath.Text &lt;&gt; "") Then&lt;br /&gt;               ProgressBar1.Maximum = Directory.GetFiles(txtpath.Text).Length&lt;br /&gt;               Dim progressincr As Integer = ProgressBar1.Maximum / progressmax&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;               For Each file As String In Directory.GetFiles(txtpath.Text)&lt;br /&gt;&lt;br /&gt;                   If (Path.GetExtension(file).ToUpper = ".HTML" Or Path.GetExtension(file).ToUpper = ".HTM") Then&lt;br /&gt;                       testfile = file&lt;br /&gt;                       Dim sr As StreamReader&lt;br /&gt;                       filename = ""&lt;br /&gt;                       sr = New StreamReader(file)&lt;br /&gt;                       'Read from the html file&lt;br /&gt;                       Dim content As String = sr.ReadToEnd&lt;br /&gt;                       'To create the output folder&lt;br /&gt;                       filename = Environment.CurrentDirectory + "\Output"&lt;br /&gt;                       If (Not IO.Directory.Exists(filename)) Then&lt;br /&gt;                           Directory.CreateDirectory(filename)&lt;br /&gt;                       End If&lt;br /&gt;                   &lt;br /&gt;                       filename = filename + "\" + "Ouput.xls"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                       excelapp.Cells(1, 1).value = "LicenseNumber"&lt;br /&gt;                       excelapp.Cells(1, 2).value = "DateSubmitted"&lt;br /&gt;                       excelapp.Cells(1, 3).value = "BusinessName"&lt;br /&gt;                       excelapp.Cells(1, 4).value = "LocationAdddress"&lt;br /&gt;                       excelapp.Cells(1, 5).value = "City"&lt;br /&gt;                       excelapp.Cells(1, 6).value = "Zip"&lt;br /&gt;                       excelapp.Cells(1, 7).value = "County"&lt;br /&gt;                       excelapp.Cells(1, 8).value = "LicenseType:"&lt;br /&gt;                       excelapp.Cells(1, 9).value = "Licensee/Agent"&lt;br /&gt;                       excelapp.Cells(1, 10).value = "Telephone"&lt;br /&gt;                       excelapp.Cells(1, 11).value = "Type/IP Exp./Lic#"&lt;br /&gt;                       excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;                       ' Apply bold to cells A1:B1.&lt;br /&gt;                       objrange = excelWorksheet.Range("A1", "K1")&lt;br /&gt;                       m_objFont = objrange.Font&lt;br /&gt;                       m_objFont.Bold = True&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                       For Each line1 As String In Regex.Split(content, "&lt;   /  table        &gt;")&lt;br /&gt;&lt;br /&gt;                           cellcount = cellcount + 1&lt;br /&gt;&lt;br /&gt;                           'Searching for each Field in the Content&lt;br /&gt;&lt;br /&gt;                           '1) Licensee: No&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           Dim Licensee As String = extractword(line1, "License Number:", 1)&lt;br /&gt;                           excelapp.Cells(cellcount, 1).value = StrConv(Licensee, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           '2) Date Submitted:&lt;br /&gt;                           Dim datesub As String = extractword(line1, "Date Submitted:", 3)&lt;br /&gt;                           excelapp.Cells(cellcount, 2).value = datesub&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;                           '3)Status&lt;br /&gt;&lt;br /&gt;                           Dim status As String = extractword(line1, "Business Name:", 1)&lt;br /&gt;                           excelapp.Cells(cellcount, 3).value = StrConv(status, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;                           '4   Location Address&lt;br /&gt;                           Dim officer As String = extractword(line1, "Location Address:", 1)&lt;br /&gt;                           excelapp.Cells(cellcount, 4).value = StrConv(officer, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           '5)CITY&lt;br /&gt;                           Dim city As String = extractword1(line1, "Location Address:", "CITY")&lt;br /&gt;                           If (city.Contains("&amp;amp;nbsp")) Then&lt;br /&gt;                               city = removespace(city, " ")&lt;br /&gt;                           End If&lt;br /&gt;                           excelapp.Cells(cellcount, 5).value = StrConv(city, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;                           '6 ZIP&lt;br /&gt;&lt;br /&gt;                           Dim zip As String = extractword1(line1, "Location Address:", "ZIP")&lt;br /&gt;                           If (zip.Contains("&amp;amp;nbsp")) Then&lt;br /&gt;                               zip = removespace(zip, " ")&lt;br /&gt;                           End If&lt;br /&gt;                           excelapp.Cells(cellcount, 6).value = StrConv(zip, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           '7  County&lt;br /&gt;                           Dim County As String = extractword(line1, "County/License Type:", 1)&lt;br /&gt;                           If (County.Contains("&amp;amp;nbsp")) Then&lt;br /&gt;                               County = removespace(County, " ")&lt;br /&gt;                           End If&lt;br /&gt;                           excelapp.Cells(cellcount, 7).value = StrConv(County, VbStrConv.ProperCase)&lt;br /&gt;&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           '8 License Type:&lt;br /&gt;                           Dim licencetype As String = extractword(line1, "County/License Type:", 2)&lt;br /&gt;                           excelapp.Cells(cellcount, 8).value = StrConv(licencetype, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           '9 Licensee/Agent/Tel.&lt;br /&gt;                           Dim license As String = extractword(line1, "Licensee/Agent/Tel.:", 1)&lt;br /&gt;                           excelapp.Cells(cellcount, 9).value = StrConv(license, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           '10    telephone&lt;br /&gt;                           Dim phone As String = extractword(line1, "Licensee/Agent/Tel.:", 2)&lt;br /&gt;                           excelapp.Cells(cellcount, 10).value = StrConv(phone, VbStrConv.ProperCase)&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                           '  11     License Query System Date&lt;br /&gt;&lt;br /&gt;                           Dim licensequery As String = extractword(line1, "Type/IP Exp./Lic. #:", 1)                         &lt;br /&gt;                           Dim dat As String = extractword(line1, "Type/IP Exp./Lic. #:", 2)                          &lt;br /&gt;                           Dim licno As String = extractword(line1, "Type/IP Exp./Lic. #:", 3)&lt;br /&gt;&lt;br /&gt;                           excelapp.Cells(cellcount, 1).value = licensequery + dat + licno&lt;br /&gt;                           excelWorksheet.Columns.AutoFit()&lt;br /&gt;&lt;br /&gt;                     &lt;br /&gt;                       Next&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                       sr.Close()&lt;br /&gt;                       '  excelbook.Save()                     &lt;br /&gt;                   End If&lt;br /&gt;                   If (ProgressBar1.Value &lt;= ProgressBar1.Maximum) Then                         ProgressBar1.Value = ProgressBar1.Value + 1                         labelincr = labelincr + progressincr                         Label2.Text = labelincr.ToString                     End If                  Next                  Label2.Text = "Completed"                 excelbook.SaveAs(filename)                 excelapp.Workbooks.Close()                 excelapp.Quit()                 GC.Collect()                 Me.Close()              Else                 MessageBox.Show("Select the folder")             End If          Catch ex As Exception             excelbook.Save()             excelapp.Workbooks.Close()             excelapp.Quit()             GC.Collect()             MessageBox.Show(ex.Message + "   " + testfile)          End Try     End Sub        Private Function extractword(ByVal content As String, ByVal searchstr As String, ByVal count As Integer)         Try              Dim counter As Integer = 0             Dim word As String = ""              For Each line2 As String In Regex.Split(content, "")&lt;br /&gt;                       counter += 1&lt;br /&gt;                       If (counter &gt; count) Then&lt;br /&gt;                           '  Dim pos As Integer = line.IndexOf("")&lt;br /&gt;                           Dim pos As Integer = line.IndexOf("&gt;")&lt;br /&gt;                           word = line.Remove(0, pos + 1)&lt;br /&gt;                           If (word.Contains("&lt;span style="color:red;"&gt;")) Then&lt;br /&gt;                               word = word.Remove(0, Len("&lt;span style="color:red;"&gt;") + word.IndexOf("&lt;span style="color:red;"&gt;"))&lt;br /&gt;                           End If&lt;br /&gt;                           If (word.Contains("&lt;/span&gt;")) Then&lt;br /&gt;                               word = word.Remove(word.IndexOf("&lt;/span&gt;"), Len(word) - word.IndexOf("&lt;/span&gt;"))&lt;br /&gt;                           End If&lt;br /&gt;&lt;br /&gt;                           'If (word &lt;&gt; "") Then&lt;br /&gt;                           Exit For&lt;br /&gt;                           'End If&lt;br /&gt;                           'word = word.Remove(0, word.IndexOf("") + Len(""))&lt;br /&gt;&lt;br /&gt;                       End If&lt;br /&gt;                   Next&lt;br /&gt;                   counter = 0&lt;br /&gt;               End If&lt;br /&gt;           Next&lt;br /&gt;&lt;br /&gt;           Return word&lt;br /&gt;       Catch ex As Exception&lt;br /&gt;           Return ""&lt;br /&gt;       End Try&lt;br /&gt;   End Function&lt;br /&gt;   Private Function extractword1(ByVal content As String, ByVal searchstr As String, ByVal type As String)&lt;br /&gt;       Try&lt;br /&gt;&lt;br /&gt;           Dim counter As Integer = 0&lt;br /&gt;           Dim word As String = ""&lt;br /&gt;           Dim trcount As Integer = 0&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;           For Each line2 As String In Regex.Split(content, "")              &lt;br /&gt;               If (line2.Contains(searchstr) Or type = "OVER") Then&lt;br /&gt;                   If (type = "CITY") Then&lt;br /&gt;                       trcount = 0&lt;br /&gt;                       type = "OVER"&lt;br /&gt;                       Continue For&lt;br /&gt;                   End If&lt;br /&gt;                   If (type = "ZIP") Then&lt;br /&gt;                       trcount = 1&lt;br /&gt;                       type = "OVER"&lt;br /&gt;                       Continue For&lt;br /&gt;                   End If&lt;br /&gt;                   For Each line As String In Regex.Split(line2, "")&lt;br /&gt;                       If (line &lt;&gt; "" And line &lt;&gt; " ") Then&lt;br /&gt;                           counter += 1&lt;br /&gt;                           If (counter &gt; trcount) Then&lt;br /&gt;                               Dim pos As Integer = line.LastIndexOf("&gt;")&lt;br /&gt;                               word = line.Remove(0, pos + 1)&lt;br /&gt;                               If (word &lt;&gt; "") Then&lt;br /&gt;                                   Return word&lt;br /&gt;                               End If&lt;br /&gt;                               'word = word.Remove(0, word.IndexOf("") + Len(""))&lt;br /&gt;&lt;br /&gt;                           End If&lt;br /&gt;                       End If&lt;br /&gt;                   Next&lt;br /&gt;               End If&lt;br /&gt;               counter = 0&lt;br /&gt;           Next&lt;br /&gt;&lt;br /&gt;           Return word&lt;br /&gt;       Catch ex As Exception&lt;br /&gt;           Return ""&lt;br /&gt;       End Try&lt;br /&gt;   End Function&lt;br /&gt;&lt;br /&gt;   Private Function removespace(ByVal word As String, ByVal checkstr As String)&lt;br /&gt;       Try&lt;br /&gt;           Dim addresspos As Integer = word.IndexOf(checkstr)&lt;br /&gt;           word = word.Remove(addresspos, Len(word) - addresspos)&lt;br /&gt;           Return word&lt;br /&gt;       Catch ex As Exception&lt;br /&gt;           Return word&lt;br /&gt;       End Try&lt;br /&gt;   End Function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   Private Function RemoveHTMLTags(ByVal strText As String) As String&lt;br /&gt;       Return Regex.Replace(strText, "&lt;[^&gt;]*&gt;", "")&lt;br /&gt;   End Function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;End Class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-8584115708773980723?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/05/write-to-excel.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-824697614207004707</guid><pubDate>Thu, 01 May 2008 11:33:00 +0000</pubDate><atom:updated>2008-05-01T15:36:36.730+04:00</atom:updated><title>Regular Expression To remove Html Tags</title><description>&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;Read the html File using the Stream Reader&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  If (Path.GetExtension(file).ToUpper = ".HTML" Or Path.GetExtension(file).ToUpper = ".HTM") Then&lt;br /&gt;                      &lt;br /&gt;                        Dim sr As StreamReader&lt;br /&gt;                      &lt;br /&gt;                        sr = New StreamReader(file)&lt;br /&gt;                        'Read from the html file&lt;br /&gt;                        Dim content As String = sr.ReadToEnd&lt;br /&gt;dim Output as string="'&lt;br /&gt;         Output=            RemoveHtml(content)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Private Function RemoveHTMLTags(ByVal strText As String) As String&lt;br /&gt;        Return Regex.Replace(strText, "&lt;[^&gt;]*&gt;", "")&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please Try this at ur Code&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-824697614207004707?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/05/regular-expression-to-remove-html-tags.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-4033477039417752077</guid><pubDate>Tue, 22 Apr 2008 05:52:00 +0000</pubDate><atom:updated>2008-04-22T10:03:42.081+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Compiling C++ programs using VC++ .net</category><title>Compiling C++ programs using VC++ .net</title><description>&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Open the &lt;span class="ui"&gt;Visual Studio 2008 Command Prompt&lt;/span&gt; window.  &lt;p style="margin-left: 0.5in;"&gt;Click the &lt;span class="ui"&gt;Start&lt;/span&gt; button, point to &lt;span class="ui"&gt;All Programs&lt;/span&gt;, &lt;span class="ui"&gt;Microsoft Visual Studio 2008&lt;/span&gt;, &lt;span class="ui"&gt;Visual Studio Tools&lt;/span&gt;, and click &lt;span class="ui"&gt;Visual Studio 2008 Command Prompt&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;At the command prompt, type &lt;b&gt;notepad simpleclr.cpp&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;Click &lt;span class="ui"&gt;Yes&lt;/span&gt; when you are prompted to create a new file.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In Notepad, type the following lines:&lt;/p&gt;  &lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;int main()&lt;/pre&gt;&lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;{&lt;/pre&gt;&lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;6.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;    &lt;/span&gt;System::Console::WriteLine("This is a Visual C++ program.");&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;}&lt;/pre&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;7.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;On the &lt;span class="ui"&gt;File&lt;/span&gt; menu, click &lt;span class="ui"&gt;Save&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;You have created a Visual C++ source file that uses a .NET class (&lt;a href="http://msdn2.microsoft.com/en-us/library/system.console.aspx"&gt;Console&lt;/a&gt;) and is located in the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.aspx"&gt;System&lt;/a&gt; namespace.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;8.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;On the &lt;span class="ui"&gt;File&lt;/span&gt; menu, click &lt;span class="ui"&gt;Exit&lt;/span&gt; to close Notepad.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;9.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;At the command prompt, type &lt;b&gt;cl /clr simpleclr.cpp&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;. The &lt;b&gt;cl.exe&lt;/b&gt; compiler generates an executable program &lt;b&gt;simpleclr.exe&lt;/b&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;10.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To see a list of all files in the directory named &lt;b&gt;simpleclr&lt;/b&gt; with any extension, type &lt;b&gt;dir simpleclr.*&lt;/b&gt; and press Enter.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The &lt;b&gt;.obj&lt;/b&gt; file is an intermediate format file that you can safely ignore.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The &lt;b&gt;.manifest&lt;/b&gt; file is an XML file that contains information about the assembly. (An assembly is the .NET unit of deployment, such as an &lt;b&gt;.exe&lt;/b&gt; program or &lt;b&gt;.dll&lt;/b&gt; component or library.)&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;11.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To run the &lt;b&gt;simpleclr.exe&lt;/b&gt; program, type &lt;b&gt;simpleclr&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The program displays this text and exits:&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;&lt;span class="code"&gt;This is a Visual C++ program.&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;12.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To close the Command Prompt window, type &lt;span class="input"&gt;exit&lt;/span&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3 style="text-align: center;" align="center"&gt;Compiling C++ programs using VC++ .net&lt;/h3&gt;  &lt;h3 style="text-align: center;" align="center"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/h3&gt;  &lt;h3 style="text-align: center;" align="center"&gt;http://facweb.cs.depaul.edu/msvcdocs/vc++.net/instruction.html&lt;/h3&gt;  &lt;p&gt;Here are instructions to compile C++ programs using VC++ .net, by way of "&lt;b&gt;project&lt;/b&gt;", for two situations: &lt;/p&gt;  &lt;ol start="1" type="i"&gt;&lt;li class="MsoNormal" style=""&gt;Starting a new file and a new      project&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Already having a file, and      creating a new project&lt;/li&gt;&lt;/ol&gt;  &lt;h3&gt;The Steps:&lt;/h3&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Start VC++ .net.  You      will see an opening screen similar to the following. &lt;/li&gt;&lt;/ol&gt;  &lt;p style="margin-left: 0.5in;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style="'width:498.75pt;"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtml1\01\clip_image001.jpg" href="http://facweb.cs.depaul.edu/msvcdocs/vc++.net/instru8.jpg"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1-kmFGZCI/AAAAAAAAATU/jPMGqiTAJAU/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1-kmFGZCI/AAAAAAAAATU/jPMGqiTAJAU/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5191945112590378018" border="0" /&gt;&lt;/a&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;  &lt;/p&gt;  &lt;ol start="2" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Click on "&lt;b&gt;New Project&lt;/b&gt;"      tab in the right pane, then you see a pop-up window comes up.  In      this window, single-click on the "&lt;b&gt;Managed C++ Empty Project&lt;/b&gt;"      icon in the right "Templates" pane (Note you will probably need      to scroll down to find the ion).  &lt;/li&gt;&lt;ol start="1" type="a"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;u&gt;Case 1: If you are       creating a new file (source code):&lt;br /&gt;&lt;/u&gt;Suppose you want to create a file called &lt;i&gt;&lt;u&gt;"temp.cpp"&lt;/u&gt;&lt;/i&gt;       in a subdirectory/project called &lt;i&gt;&lt;u&gt;"assign1"&lt;/u&gt;&lt;/i&gt; under       a path &lt;u&gt;"&lt;i&gt;c:\courses\309"&lt;/i&gt;&lt;/u&gt; (thus the new project       path will be &lt;i&gt;c:\courses\309\assign1\&lt;/i&gt;).  In the same pop-up       window, type in (or browse) "&lt;i&gt;c:\courses\309"&lt;/i&gt; for the       "&lt;b&gt;Location&lt;/b&gt;" and &lt;i&gt;"assign1"&lt;/i&gt; for the "&lt;b&gt;Name&lt;/b&gt;".        As you type in for the Name, you see "temp.cpp" is appended at       the end of "Project will be created at".&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;u&gt;Case 2: If you       already have a file&lt;br /&gt;&lt;/u&gt;Suppose you have a file called &lt;i&gt;&lt;u&gt;"temp.cpp"&lt;/u&gt;&lt;/i&gt;       under a directory&lt;u&gt; "&lt;i&gt;c:\courses\309\assign1\"&lt;/i&gt;&lt;/u&gt;.        In the same pop-up window, type in (or browse) "&lt;i&gt;c:\courses\309"&lt;/i&gt;       for the "&lt;b&gt;Location&lt;/b&gt;" and &lt;i&gt;"assign1"&lt;/i&gt; for       the "&lt;b&gt;Name&lt;/b&gt;".  As you type in for the Name, you see       "temp.cpp" is appended at the end of "Project will be       created at".&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p style="margin-left: 0.5in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1-vmFGZDI/AAAAAAAAATc/DGUqEmU7lpg/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1-vmFGZDI/AAAAAAAAATc/DGUqEmU7lpg/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5191945301568939058" border="0" /&gt;&lt;/a&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" alt="" style="'width:398.25pt;height:273pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtml1\01\clip_image002.gif" href="http://facweb.cs.depaul.edu/msvcdocs/vc++.net/instru9.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;/p&gt;&lt;p style="margin-left: 0.5in;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-left: 0.5in;"&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;  &lt;/p&gt;  &lt;ol start="3" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Hit "OK".       Then you are back to the main screen.  Now you see several info      appeared in the "Solution Explore" pane on the left. &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p style="margin-left: 0.5in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7sVoTSdbv4c/SA1-9WFGZEI/AAAAAAAAATk/Gr4al3cYYMw/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_7sVoTSdbv4c/SA1-9WFGZEI/AAAAAAAAATk/Gr4al3cYYMw/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5191945537792140354" border="0" /&gt;&lt;/a&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1027" type="#_x0000_t75" alt="" style="'width:498.75pt;height:348pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtml1\01\clip_image003.jpg" href="http://facweb.cs.depaul.edu/msvcdocs/vc++.net/instru10.jpg"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-left: 0.5in;"&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;  &lt;/p&gt;  &lt;ol start="4" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Now you must add a file to      the project. &lt;/li&gt;&lt;ol start="1" type="a"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;u&gt;Case 1: If you are       creating a new file (source code):&lt;br /&gt;&lt;/u&gt;From the top menu-bar, select "&lt;b&gt;Project&lt;/b&gt;", then "&lt;b&gt;Add       New Item&lt;/b&gt;".  In the pop-up window, click on the "&lt;b&gt;C++File       (.cpp)&lt;/b&gt;" on the right pane, and enter "temp.cpp" (or any       name for the new file) in the "&lt;b&gt;Name&lt;/b&gt;" box.. &lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7sVoTSdbv4c/SA1_G2FGZFI/AAAAAAAAATs/mnYsECTViTw/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_7sVoTSdbv4c/SA1_G2FGZFI/AAAAAAAAATs/mnYsECTViTw/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5191945701000897618" border="0" /&gt;&lt;/a&gt;&lt;ol start="4" type="1"&gt;&lt;ol start="2" type="a"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;u&gt;Case 2: If you       already have a file&lt;br /&gt;&lt;/u&gt;From the top menu-bar, select "&lt;b&gt;Project&lt;/b&gt;", then "&lt;b&gt;Add       Existing Item&lt;/b&gt;".  In the pop-up window, select all files       with &lt;b&gt;.cpp extension (only -- &lt;/b&gt;DO NOT ADD header files!)  If       you have more than one .cpp file, hold down the control key and       single-click on all .cpp files.  &lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;  &lt;p style="margin-left: 0.5in;"&gt;  &lt;/p&gt;  &lt;ol start="5" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Hit ok.  You are back to      the main screen again.  If you are starting a new file, type in the      code on the right pane, and save the file by hitting the &lt;b&gt;Save&lt;/b&gt;      button at the top.  If you are working on an existing file (or      files), double-click on the icon of the file you like to work on in the      left "Solution Explore" pane (Note that icons for some files may      be under "Header Files" or "Resource Files"). &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1_VmFGZGI/AAAAAAAAAT0/JZY5tPZ5B7g/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1_VmFGZGI/AAAAAAAAAT0/JZY5tPZ5B7g/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5191945954403968098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p style="margin-left: 0.5in;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-left: 0.5in;"&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;  &lt;/p&gt;  &lt;ol start="6" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Now you build the project by      selecting &lt;b&gt;Build&lt;/b&gt; at the top menu-bar, then "&lt;b&gt;Build assign1&lt;/b&gt;".       You can see the progress of compilation in the "Output" pane at      the bottom.  If any syntax error is detected in your code, fix      it/them and do the Build procedure again. &lt;/li&gt;&lt;/ol&gt;  &lt;p style="margin-left: 0.5in;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1030" type="#_x0000_t75" alt="" style="'width:498.75pt;height:348pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtml1\01\clip_image006.gif" href="http://facweb.cs.depaul.edu/msvcdocs/vc++.net/instru13.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7sVoTSdbv4c/SA1_eGFGZHI/AAAAAAAAAT8/40yAvZPACw8/s1600-h/6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_7sVoTSdbv4c/SA1_eGFGZHI/AAAAAAAAAT8/40yAvZPACw8/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5191946100432856178" border="0" /&gt;&lt;/a&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;  &lt;/p&gt;  &lt;ol start="7" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;After the project is built,      you execute the project by selecting "&lt;b&gt;Debug&lt;/b&gt;" from the top      menu bar, then "&lt;b&gt;Start without debugging&lt;/b&gt;" .  The      program/project is executed and an MS-DOS window shows up with the output      of the program. &lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1_nmFGZII/AAAAAAAAAUE/XiF-ITNnom4/s1600-h/7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1_nmFGZII/AAAAAAAAAUE/XiF-ITNnom4/s400/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5191946263641613442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Refer this link   &lt;h3 style="text-align: center;" align="center"&gt;http://facweb.cs.depaul.edu/msvcdocs/vc++.net/instruction.html&lt;/h3&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-4033477039417752077?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/compiling-c-programs-using-vc-net.html</link><author>noreply@blogger.com (Bishar.B.N)</author><media:thumbnail url="http://4.bp.blogspot.com/_7sVoTSdbv4c/SA1-kmFGZCI/AAAAAAAAATU/jPMGqiTAJAU/s72-c/1.JPG" height="72" width="72" /><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-7451379727595085370</guid><pubDate>Tue, 22 Apr 2008 05:50:00 +0000</pubDate><atom:updated>2008-04-22T09:52:26.899+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">To compile a Visual C++ .NET console application on the command line</category><title>To compile a Visual C++ .NET console application on the command line</title><description>&lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Open the &lt;span class="ui"&gt;Visual Studio 2008 Command Prompt&lt;/span&gt; window.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;Click the &lt;span class="ui"&gt;Start&lt;/span&gt; button, point to &lt;span class="ui"&gt;All Programs&lt;/span&gt;, &lt;span class="ui"&gt;Microsoft Visual Studio 2008&lt;/span&gt;, &lt;span class="ui"&gt;Visual Studio Tools&lt;/span&gt;, and click &lt;span class="ui"&gt;Visual Studio 2008 Command Prompt&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;At the command prompt, type &lt;b&gt;notepad simpleclr.cpp&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;Click &lt;span class="ui"&gt;Yes&lt;/span&gt; when you are prompted to create a new file.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In Notepad, type the following lines:&lt;/p&gt;  &lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;int main()&lt;/pre&gt;&lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;{&lt;/pre&gt;&lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;    &lt;/span&gt;System::Console::WriteLine("This is a Visual C++ program.");&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;}&lt;/pre&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;On the &lt;span class="ui"&gt;File&lt;/span&gt; menu, click &lt;span class="ui"&gt;Save&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;You have created a Visual C++ source file that uses a .NET class (&lt;a href="http://msdn2.microsoft.com/en-us/library/system.console.aspx"&gt;Console&lt;/a&gt;) and is located in the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.aspx"&gt;System&lt;/a&gt; namespace.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;8.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;On the &lt;span class="ui"&gt;File&lt;/span&gt; menu, click &lt;span class="ui"&gt;Exit&lt;/span&gt; to close Notepad.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;9.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;At the command prompt, type &lt;b&gt;cl /clr simpleclr.cpp&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;. The &lt;b&gt;cl.exe&lt;/b&gt; compiler generates an executable program &lt;b&gt;simpleclr.exe&lt;/b&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;10.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To see a list of all files in the directory named &lt;b&gt;simpleclr&lt;/b&gt; with any extension, type &lt;b&gt;dir simpleclr.*&lt;/b&gt; and press Enter.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The &lt;b&gt;.obj&lt;/b&gt; file is an intermediate format file that you can safely ignore.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The &lt;b&gt;.manifest&lt;/b&gt; file is an XML file that contains information about the assembly. (An assembly is the .NET unit of deployment, such as an &lt;b&gt;.exe&lt;/b&gt; program or &lt;b&gt;.dll&lt;/b&gt; component or library.)&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;11.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To run the &lt;b&gt;simpleclr.exe&lt;/b&gt; program, type &lt;b&gt;simpleclr&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The program displays this text and exits:&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;&lt;span class="code"&gt;This is a Visual C++ program.&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;12.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To close the Command Prompt window, type &lt;span class="input"&gt;exit&lt;/span&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-7451379727595085370?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/to-compile-visual-c-net-console.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-4077306345500189537</guid><pubDate>Tue, 22 Apr 2008 05:43:00 +0000</pubDate><atom:updated>2008-04-22T09:46:58.251+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Compiling a Native C++ Program from the Command Line (C++)</category><title>Compiling a Native C++ Program from the Command Line (C++)</title><description>&lt;p style="font-weight: bold;" class="MsoNormal"&gt;Compiling a Native C++ Program from the Command Line (C++)&lt;/p&gt;  &lt;p&gt;Visual C++ includes a C++ compiler that you can use to create everything from simple Visual C++ programs to Windows Forms applications and components.&lt;/p&gt;  &lt;p&gt;In this procedure, you create simple Visual C++ programs by using a text editor and compile them on the command line.&lt;/p&gt;  &lt;p&gt;You can also compile Visual C++ programs that you created with a text editor by using the Visual Studio development environment. See &lt;a href="http://msdn2.microsoft.com/en-us/library/ms235635.aspx"&gt;Compiling a C++ Program that Targets the CLR in Visual Studio (C++)&lt;/a&gt; for more information.&lt;/p&gt;  &lt;p&gt;You can use your own Visual C++ programs instead of typing the simple programs shown in these procedures. You can also use any of the Visual C++ code sample programs in the help topics.&lt;/p&gt;  &lt;h3&gt;To create a Visual C++ source file and compile it on the command line&lt;/h3&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Open the &lt;span class="ui"&gt;Visual Studio 2008 Command Prompt&lt;/span&gt; window.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;Click the &lt;span class="ui"&gt;Start&lt;/span&gt; button, point to &lt;span class="ui"&gt;All Programs&lt;/span&gt;, &lt;span class="ui"&gt;Microsoft Visual Studio 2008&lt;/span&gt;, &lt;span class="ui"&gt;Visual Studio Tools&lt;/span&gt;, and then click &lt;span class="ui"&gt;Visual Studio 2008 Command Prompt&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;At the command prompt, type &lt;b&gt;notepad simple.cpp&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;Click &lt;span class="ui"&gt;Yes&lt;/span&gt; when you are prompted to create a new file.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In Notepad, type the following lines:&lt;/p&gt;  &lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;#include &lt;iostream&gt;&lt;/iostream&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;span style=""&gt;6.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;int main()&lt;span style=""&gt;&lt;span style=""&gt;&lt;br /&gt;7.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;{&lt;span style=""&gt;&lt;span style=""&gt;&lt;br /&gt;8.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;    &lt;/span&gt;std::cout &lt;&lt; "This is a native C++ program." &lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;9.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;    &lt;/span&gt;return 0;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in;"&gt;}&lt;/pre&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;10.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;On the &lt;span class="ui"&gt;File&lt;/span&gt; menu, click &lt;span class="ui"&gt;Save&lt;/span&gt;. You have created a Visual C++ source file.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;11.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;On the &lt;span class="ui"&gt;File&lt;/span&gt; menu, click &lt;span class="ui"&gt;Exit&lt;/span&gt; to close Notepad.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;12.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;At the command prompt, type &lt;b&gt;cl /EHsc simple.cpp&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;. The &lt;b&gt;/EHsc&lt;/b&gt; command-line option instructs the compiler to enable C++ exception handling. For more information, see &lt;a href="http://msdn2.microsoft.com/en-us/library/1deeycx5.aspx"&gt;/EH (Exception Handling Model)&lt;/a&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The &lt;b&gt;cl.exe&lt;/b&gt; compiler generates an executable program &lt;b&gt;simple.exe&lt;/b&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;You can see the executable program name in the lines of output information that the compiler displays. &lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;13.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To see a list of all files in the directory named &lt;b&gt;simple&lt;/b&gt; with any extension, type &lt;b&gt;dir simple.*&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The &lt;b&gt;.obj&lt;/b&gt; file is an intermediate format file that you can safely ignore.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;14.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To run the &lt;b&gt;simple.exe&lt;/b&gt; program, type &lt;b&gt;simple&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;The program displays this text and exits:&lt;/p&gt;  &lt;p style="margin-left: 0.5in;"&gt;&lt;span class="code"&gt;This is a native C++ program.&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;15.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;To close the Command Prompt window, type &lt;b&gt;exit&lt;/b&gt; and press &lt;span class="ui"&gt;Enter&lt;/span&gt;.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="ctl00_rs1_mainContentContainer_cpe374022_i" spid="_x0000_i1025" type="#_x0000_t75" alt="" style="'width:12pt;height:12pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtml1\01\clip_image001.gif" href="http://i.msdn.microsoft.com/Platform/Controls/CollapsibleArea/resources/minus.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///C:/DOCUME%7E1/bishar.SBL/LOCALS%7E1/Temp/msohtml1/01/clip_image001.gif" style="border-width: 0px; vertical-align: middle;" shapes="ctl00_rs1_mainContentContainer_cpe374022_i" border="0" height="16" width="16" /&gt;&lt;!--[endif]--&gt; Compiling a Visual C++ Program That Uses .NET Classes &lt;/p&gt;  &lt;p&gt;&lt;a name="sectionToggle0"&gt;&lt;/a&gt;This procedure shows the command line that you use to compile a Visual C++ program that uses .NET Framework classes.&lt;/p&gt;  &lt;p&gt;You must use the &lt;a href="http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx"&gt;/clr (Common Language Runtime Compilation)&lt;/a&gt; compiler option because this program uses .NET classes and requires the Visual C++ compiler to include the necessary .NET libraries. The Visual C++ compiler generates an .exe file that contains MSIL code instead of machine executable instructions.&lt;/p&gt;  &lt;p&gt;You can follow the steps in this procedure to compile any sample Visual C++ program in the help topics.&lt;/p&gt;  &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-4077306345500189537?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/compiling-native-c-program-from-command.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-5774859556698445004</guid><pubDate>Tue, 22 Apr 2008 04:54:00 +0000</pubDate><atom:updated>2008-04-22T09:03:57.304+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">install the software  only on one computer:</category><category domain="http://www.blogger.com/atom/ns#">How to add Software Expriation</category><title>How to add Software Expriation</title><description>&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;&lt;span style=""&gt; &lt;/span&gt;For 30 days or 60 days trial:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=";font-family:Arial;font-size:100%;"  &gt;check the date on installation or on first run of program(the setting variable will be 0 in first time):&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=";font-family:Arial;font-size:100%;"  &gt;save the current date in the  setting variable&lt;/span&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style=";font-family:Arial;font-size:100%;"  &gt;now every run read that variable and see if the software is expired: it is better to read the date from internet using web service&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;&lt;span style="font-family:Arial;"&gt;install the software on only one computer:&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;                                    &lt;p&gt;&lt;span style=";font-family:Arial;font-size:100%;"  &gt;Create setting variable for example &lt;em&gt;&lt;span style="font-family:Arial;"&gt;license&lt;/span&gt;&lt;/em&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;when the software run check this variable if it is not contain the correct value then:&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;1- the software read the processor number&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;2- the user give you the number by phone or email or...&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;3- you  generate the license key from processor number(by calculation manually or by calculation with small software)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;4- you  give it to the user&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;5- the software save it in setting variable&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;6- the software must check the setting variable and the processor number and make the calculation to see if it contain the current number before starting,if not it will give the processor number to user to send it to you&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;and so the license key will work only on one computer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-5774859556698445004?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/how-to-add-software-expriation.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-6907313977972635663</guid><pubDate>Thu, 10 Apr 2008 05:07:00 +0000</pubDate><atom:updated>2008-04-10T09:08:11.635+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Parsing XML with XmlDocument</category><title>Parsing XML with XmlDocument</title><description>Parsing XML with XmlDocument&lt;br /&gt;The XmlDocument class is modeled based on Document Object Model. XmlDocument class is appropriate if you need to extract data in a non-sequential manner. Figure 3 below outlines parsing of xml file with XmlDocument&lt;br /&gt; Collapse&lt;br /&gt;Imports System.IO&lt;br /&gt;Imports System.Xml&lt;br /&gt;Module ParsingUsingXmlDocument&lt;br /&gt;Sub Main()&lt;br /&gt;  Try&lt;br /&gt;    Dim m_xmld As XmlDocument&lt;br /&gt;    Dim m_nodelist As XmlNodeList&lt;br /&gt;    Dim m_node As XmlNode&lt;br /&gt;    'Create the XML Document&lt;br /&gt;&lt;br /&gt;    m_xmld = New XmlDocument()&lt;br /&gt;    'Load the Xml file&lt;br /&gt;&lt;br /&gt;    m_xmld.Load("C:\CMS\Personal\family.xml")&lt;br /&gt;    'Get the list of name nodes &lt;br /&gt;&lt;br /&gt;    m_nodelist = m_xmld.SelectNodes("/family/name")&lt;br /&gt;    'Loop through the nodes&lt;br /&gt;&lt;br /&gt;    For Each m_node In m_nodelist&lt;br /&gt;      'Get the Gender Attribute Value&lt;br /&gt;&lt;br /&gt;      Dim genderAttribute = m_node.Attributes.GetNamedItem("gender").Value&lt;br /&gt;      'Get the firstName Element Value&lt;br /&gt;&lt;br /&gt;      Dim firstNameValue = m_node.ChildNodes.Item(0).InnerText&lt;br /&gt;      'Get the lastName Element Value&lt;br /&gt;&lt;br /&gt;      Dim lastNameValue = m_node.ChildNodes.Item(1).InnerText&lt;br /&gt;      'Write Result to the Console&lt;br /&gt;&lt;br /&gt;      Console.Write("Gender: " &amp; genderAttribute _&lt;br /&gt;        &amp; " FirstName: " &amp; firstNameValue &amp; " LastName: " _&lt;br /&gt;        &amp; lastNameValue)&lt;br /&gt;      Console.Write(vbCrLf)&lt;br /&gt;    Next&lt;br /&gt;  Catch errorVariable As Exception&lt;br /&gt;    'Error trapping&lt;br /&gt;&lt;br /&gt;    Console.Write(errorVariable.ToString())&lt;br /&gt;  End Try&lt;br /&gt;End Sub&lt;br /&gt;End Module&lt;br /&gt;Figure 3: Xml Parsing with XmlDocument&lt;br /&gt;Compilation and Result&lt;br /&gt;Make sure you have vbc.exe in your path. From the command prompt go to C:\Personal&gt;. Compile ParsingUsingXmlTextReader.vb and ParsingUsingXmlDocument.vb.&lt;br /&gt;C:\Personal&gt;vbc /out:ParsingUsingXmlTextReadervb.exe ParsingUsingXmlTextReader.vb&lt;br /&gt;C:\Personal&gt;vbc /out:ParsingUsingXmlDocumentvb.exe ParsingUsingXmlDocument.vb&lt;br /&gt;When you run the individual program &lt;br /&gt;C:\Personal&gt;ParsingUsingXmlTextReadervb.exe &lt;br /&gt;OR&lt;br /&gt;C:\Personal&gt;ParsingUsingXmlDocumentvb.exe&lt;br /&gt;You will see the following result for both&lt;br /&gt;Gender: Male FirstName: Tom LastName: Smith&lt;br /&gt;&lt;br /&gt;Gender: Female FirstName: Dale LastName: Smith&lt;br /&gt;Conclusion&lt;br /&gt;There are different ways to parse XML files and the best method depends on your situation and the programming style preferred.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-6907313977972635663?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/parsing-xml-with-xmldocument.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-3812000589300228982</guid><pubDate>Thu, 10 Apr 2008 05:06:00 +0000</pubDate><atom:updated>2008-04-10T09:07:02.017+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Register Clients Script</category><title>Register Clients Script</title><description>Introduction&lt;br /&gt;Registering Client script from server itself useful when , you want certain java script to be executed when page finished loading or when user does a submit on the form .&lt;br /&gt;Background&lt;br /&gt;To get the complete idea about the clientside java script registration from server , u go through the URL http://msdn2.microsoft.com/en-us/library/ms178207.aspx&lt;br /&gt;Using the code&lt;br /&gt;You have a clientscriptmanager object on each aspx page you have . the object name is ClientScript , using ClientScript you can register the script in 4 modes&lt;br /&gt;1. RegisterClientScriptBlock:-Adds Script to the top of the page&lt;br /&gt;2.RegisterClientScriptInclude:- Refer to a external .js file &lt;br /&gt;3.RegisterStartupScript:- script is registered before onload event of a page&lt;br /&gt;4. RegisterOnSubmitStatement:- Script is registered on onSubmit event of page&lt;br /&gt;Have a look at the following example below which uses startupscript in my project, I used this one because I needed script to be executed and load a activex object before page is loaded.&lt;br /&gt; Collapse&lt;br /&gt;if (!ClientScript.IsClientScriptBlockRegistered("exampleScript"))&lt;br /&gt;    ClientScript.RegisterStartupScript(this.GetType(), "exampleScript","&lt;br /&gt;&lt;script language = "'javascript'"&gt;&lt;br /&gt;alert('you just registered the start up script')&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;");&lt;br /&gt;&lt;br /&gt; //you can also do the  Add script on the events of the controls , like button click&lt;br /&gt;&lt;br /&gt; //I wrote a generic method for adding confirm box to the web controls  as shown below&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static void ConfirmMessageBox(ref System.Web.UI.WebControls.WebControl webControl, string message, string webControlName, string eventName)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;StringBuilder sb = new StringBuilder();&lt;br /&gt;sb.AppendFormat("var str = trim(document.forms[0].{0}.value);", webControlName);&lt;br /&gt;sb.Append("if(str != null)");&lt;br /&gt;sb.Append("{");&lt;br /&gt;sb.Append("if(str != '')");&lt;br /&gt;sb.Append("{");&lt;br /&gt;sb.AppendFormat("var bRet = confirm('{0}');", message);&lt;br /&gt;sb.Append("if(!bRet)");&lt;br /&gt;sb.AppendFormat("document.forms[0].{0}.value = '';", webControlName);&lt;br /&gt;sb.Append("return bRet;");&lt;br /&gt;sb.Append("}");&lt;br /&gt;sb.Append("}");&lt;br /&gt;&lt;br /&gt;webControl.Attributes.Add(eventName, sb.ToString());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;//you can add this script to any textbox or button control  on page load as shown below&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;WebControl control = (WebControl)textBoxControl;&lt;br /&gt;ConfirmMessageBox(ref control, "Are you sure , you want to create this domain",&lt;br /&gt;textBoxControl.ClientID, "onblur");&lt;br /&gt;&lt;br /&gt;//Hope this helps in getting better understanding of the client side script registration from server &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  ClientScript.RegisterStartupScript(this.GetType(), "exampleScript", "&lt;script language = 'javascript'&gt;alert('You are not registered member please contact Bishar or mail to jobs@bisharbn.com')&lt;/script&gt;");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-3812000589300228982?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/register-clients-script.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-7309203694861153793</guid><pubDate>Thu, 10 Apr 2008 05:02:00 +0000</pubDate><atom:updated>2008-04-10T09:06:28.507+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Read and Write To XML</category><title>Programming Read and Write To XML</title><description>The XmlWriter and XmlTextWriter classes are defined in the System.XML namespace.&lt;br /&gt;The XmlTextWriter class is derived from XmlWriter class, which represents a writer that provides fast non-cached forward-only way of generating XML documents based on  the W3C Extensible Markup Language (XML) 1.0 specification.&lt;br /&gt;In this article, I will show you how to use XmlTextWriter class to create an XML document and write data to the document.&lt;br /&gt;Adding namespace Reference&lt;br /&gt;Since Xml classes are defined in the System.XML namespace, so first thing you need to do is to Add the System.XML reference to the project.&lt;br /&gt;using System.Xml;&lt;br /&gt;Creating an XML Document&lt;br /&gt;The constructor of the XmlTextWriter class creates an XML file if file doesn't exist. In this sample, I create a new XML file called xmltest.xml in C\temp directory.&lt;br /&gt;XmlTextWriter writer = new XmlTextWriter("C:\\temp\\xmltest.xml", null);&lt;br /&gt;NOTE: If you don't want to write data in an XML file and want to display XML contents on the Console, pass Console.Out as a parameter of the constructor.&lt;br /&gt;XmlTextWriter writer = new XmlTextWriter(Console.Out);&lt;br /&gt;Adding Data to the Document&lt;br /&gt;The WriteStartDocument method starts a new document. The WriteStartElement and the WriteEndElement pair is used to add a new element to the document. The WriteString writes a string to the document. &lt;br /&gt;writer.WriteStartDocument();&lt;br /&gt;writer.WriteComment("Commentss: XmlWriter Test Program");&lt;br /&gt;writer.WriteProcessingInstruction("Instruction","Person Record");&lt;br /&gt;writer.WriteStartElement("p", "person", "urn:person");&lt;br /&gt;writer.WriteStartElement("LastName","");&lt;br /&gt;writer.WriteString("Chand");&lt;br /&gt;writer.WriteEndElement();&lt;br /&gt;writer.WriteElementInt16("age","", 25);&lt;br /&gt;writer.WriteEndDocument();&lt;br /&gt;Souce Code:   Attachment createxml1.cs 2 KB&lt;br /&gt;namespace WriteToXML &lt;br /&gt;{ &lt;br /&gt;using System; &lt;br /&gt;using System.Xml; &lt;br /&gt;/// &lt;summary&gt; &lt;br /&gt;/// Summary description for Class1. &lt;br /&gt;/// &lt;/summary&gt; &lt;br /&gt;public class Class1 &lt;br /&gt;{ &lt;br /&gt;public Class1() &lt;br /&gt;{ &lt;br /&gt;} &lt;br /&gt;public static int Main(string[] args) &lt;br /&gt;{ &lt;br /&gt;try &lt;br /&gt;{ &lt;br /&gt;// Creates an XML file is not exist &lt;br /&gt;XmlTextWriter writer = new XmlTextWriter("C:\\temp\\xmltest.xml", null); &lt;br /&gt;// Starts a new document &lt;br /&gt;writer.WriteStartDocument(); &lt;br /&gt;//Write comments &lt;br /&gt;writer.WriteComment("Commentss: XmlWriter Test Program"); &lt;br /&gt;writer.WriteProcessingInstruction("Instruction","Person Record"); &lt;br /&gt;// Add elements to the file &lt;br /&gt;writer.WriteStartElement("p", "person", "urn:person"); &lt;br /&gt;writer.WriteStartElement("LastName",""); &lt;br /&gt;writer.WriteString("Chand"); &lt;br /&gt;writer.WriteEndElement(); &lt;br /&gt;writer.WriteStartElement("FirstName",""); &lt;br /&gt;writer.WriteString("Mahesh"); &lt;br /&gt;writer.WriteEndElement(); &lt;br /&gt;writer.WriteElementInt16("age","", 25); &lt;br /&gt;// Ends the document &lt;br /&gt;writer.WriteEndDocument(); &lt;br /&gt;} &lt;br /&gt;catch (Exception e) &lt;br /&gt;{ &lt;br /&gt;Console.WriteLine ("Exception: {0}", e.ToString()); &lt;br /&gt;} &lt;br /&gt;return 0; &lt;br /&gt;} &lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-7309203694861153793?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/programming-read-and-write-to-xml.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-5314548948916108626</guid><pubDate>Thu, 10 Apr 2008 04:49:00 +0000</pubDate><atom:updated>2008-04-10T09:02:10.236+04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">active desktop recovery</category><title>Active desktop recovery</title><description>&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;desktop&lt;/span&gt;&lt;/strong&gt;.htt pretty much controls the size and position of your &lt;strong&gt;&lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;desktop&lt;/span&gt;&lt;/strong&gt;. IE7 is a little bit incompatible with the old profile you may have had already. To fix it go Start &gt;Run, type and enter regedit&lt;br /&gt;Go to this key:&lt;br /&gt;HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components&lt;br /&gt;Change the value of DeskHtmlVersion to zero instead of decimal 272.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-5314548948916108626?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/04/active-desktop-recovery.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-7293415668156541333</guid><pubDate>Thu, 13 Mar 2008 05:32:00 +0000</pubDate><atom:updated>2008-03-13T09:41:03.084+04:00</atom:updated><title>Configure Asp.Net with IIS</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7sVoTSdbv4c/R9i-LN8AS8I/AAAAAAAAASY/-OVVMs2LfiQ/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_7sVoTSdbv4c/R9i-LN8AS8I/AAAAAAAAASY/-OVVMs2LfiQ/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5177096871591562178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1.Go  to the Control Panel-&gt; Add/remove Program -&gt;Add/Remove Windows Component&lt;br /&gt;2.There you can see a Window pop up in that Look for IIS (internet Information System)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7sVoTSdbv4c/R9i-Ct8AS7I/AAAAAAAAASQ/t5QQ5dVb8ak/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_7sVoTSdbv4c/R9i-Ct8AS7I/AAAAAAAAASQ/t5QQ5dVb8ak/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5177096725562674098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;3)Click the  Details button from it is active (Tick almost all the Check Box) and Click Ok.&lt;br /&gt;4)You need the OS(Operating System) CD to install these.So put the OS CD in Drive.and Insatll&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5.After Installations has been finished.Make Sure that it had its Service  Running in the Windows Services&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To run a  local Web site in IIS 6.0&lt;br /&gt;1. On the Start menu, click Run.&lt;br /&gt;2. In the Open box, type inetmgr and then click OK.&lt;br /&gt;3. In IIS Manager, expand the local computer, right-click the Web Sites folder,&lt;br /&gt;4. There you see the that the IIS is running.if Not make it Run&lt;br /&gt;&lt;br /&gt;Figure of IIS:-This what it look like&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7sVoTSdbv4c/R9i-Qd8AS9I/AAAAAAAAASg/8XoFtPHvlLk/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_7sVoTSdbv4c/R9i-Qd8AS9I/AAAAAAAAASg/8XoFtPHvlLk/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5177096961785875410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All these are You can Make sure that IIS has been Configured.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Still You have Problem&lt;br /&gt;&lt;br /&gt;Please Check these reasons&lt;br /&gt;1.Make Sure  that All components in the IIS has been installed.(look at Add/remove Windows Components)&lt;br /&gt;2.If that all installed and its showing in the intemgr.But Still Can’t run the Website.Go to Step 3&lt;br /&gt;3.Register the IIS with Asp.net&lt;br /&gt;4.Go to Visual Studio Command Prompt or .Net framework Command Prompt&lt;br /&gt;5. register ASP.NET with my IIS Web Server&lt;br /&gt;Please follow the procedure below to register ASP.NET:&lt;br /&gt;1. Open Command Prompt.&lt;br /&gt;2. Change directory as follows:&lt;br /&gt;o For 32-bit machines change to:&lt;br /&gt;Microsoft.NET\Framework\\&lt;br /&gt;o For 64-bit machines change to:&lt;br /&gt;Microsoft.NET\Framework64\\&lt;br /&gt;3. Run the command ‘aspnet_regiis.exe -i’ and press enter.&lt;br /&gt;If This Doesn’t Solve the Problem.Please make a Comment along with the error or mail to me.&lt;br /&gt;Sure that we  can find  a solution for any reasonable doubts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-7293415668156541333?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/03/configure-aspnet-with-iis.html</link><author>noreply@blogger.com (Bishar.B.N)</author><media:thumbnail url="http://3.bp.blogspot.com/_7sVoTSdbv4c/R9i-LN8AS8I/AAAAAAAAASY/-OVVMs2LfiQ/s72-c/2.JPG" height="72" width="72" /><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-4347942938016997314</guid><pubDate>Thu, 13 Mar 2008 05:31:00 +0000</pubDate><atom:updated>2008-03-13T09:32:22.419+04:00</atom:updated><title>Secrets of Successful Software Requirements</title><description>&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Although most companies do some form of requirements, there is often a lack of understanding as to exactly why the requirements need to be created and the level of detail that should be included in the requirements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Software is always created to solve a need for a client. The client may be an internal client, an external client, or even the general public. Detailed requirements are important to ensure that a program correctly and fully addresses client’s needs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Detailed requirements make initial development easier and faster because the developers know exactly what should be developed and do not need to make their best guess at the functionality to be implemented or delay development by creating requirements during development. Giving the developers accurate requirements will also result in less rework at the end of development because the stakeholder’s requirements will have been implemented correctly initially and will not be arrived at through trial and error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;A project manager can use the detailed requirements to create accurate timelines and give correct estimates to the client. This ensures that stakeholders are completely aware how long development will take so they can adjust the scope of a project or proactively add resources if necessary.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Finally, testers can use the requirements to create test plans while development is ongoing rather than waiting until development is complete. The requirements give them information about what the program will do so there cannot be disputes between developers and testers as to what the program functionality should be. High quality requirements also describe problem paths that may need additional testing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Even though highly detailed requirements make development easier in future phases, this is not always possible due to time constraints imposed by the client or market conditions. With this in mind, let’s look at some secrets to improve your requirements process even under tight deadlines.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2&gt;Include Use Cases &lt;/h2&gt;  &lt;p&gt;Use cases look at the requirements from the standpoint of an end user working with the program and how the program responds to the user’s inputs. At its simplest level, a use case can be thought of as a play where the end user is one actor and the program is another actor. These two actors then have dialogs which explain the interactions between the actors. More complicated scenarios can have additional actors including other programs, other types of users, and even hardware. Use cases have proven to be very easy to read and understand even for non-technical clients.&lt;/p&gt;  &lt;p&gt;Each use case explores what happens when something goes wrong in addition to the “normal” interactions. The exploration of these failure conditions is very important because these cases are the most difficult to code and can cause the most amount of testing. Traditional requirements often ignore these cases. It can be helpful to have developers and testers both think of additional possible failures in a use case so they can be fully documented in the requirements.&lt;/p&gt;  &lt;p&gt;Use cases do not provide a complete picture of the system though. A technical specification should also be included in the requirements to detail formulas and routines that take place behind the scenes.&lt;/p&gt;  &lt;h2&gt;Prototype Screens with a Design Tool&lt;/h2&gt;  &lt;p&gt;A user of the program only interacts with a program through the user interface so it makes sense to spend a significant amount of time during requirements to ensure that the user interface makes sense, that all functionality is included, and that the most commonly used functionality is easily accessible. The easiest way of doing this is using a screen prototype. There are a variety of methods of making screen prototypes which range from simply drawing the interface with a pen and paper to building “working” prototypes in a higher level language like Visual Basic which allows rapid screen design. However, each of these extremes has serious drawbacks. A pen and paper prototype does not allow users to interact with the prototype and it is more difficult to change. A “working” prototype done in a programming language like Visual Basic can lead the client to believe that the program is nearly complete and that development should not take very long or it can lead the client to believe that changes to the prototype will be costly making them reluctant to make necessary suggestions to improve the program.&lt;/p&gt;  &lt;p&gt;Between these two extremes lies screen design applications which allow you to draw the screens and model interactions between screens. High quality prototyping tools allow you to enter sample data and allow users to move between screens by pressing buttons so they can easily understand the interface and its functionality. Most prototyping tools produce the final output in an HTML format so they can be easily shared even if a client is not in the same office where requirements are being developed.&lt;/p&gt;  &lt;p&gt;When looking for a prototyping tool, make sure to select a tool which is easy enough to use that you can easily prototype screens while your customer is in the room. This will allow you to brainstorm and make changes to the screens without delays. A prototyping tool should already have common controls already defined to maintain design standards and improve the appearance of your screens. Being able to enter sample data in each screen can allow the customer to pinpoint areas that may be incorrect.&lt;/p&gt;  &lt;h2&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/h2&gt;  &lt;h2&gt;Work Directly with End Users&lt;/h2&gt;  &lt;p&gt;When designing a new application or making revisions to an existing application, there is no substitute for the direct experience that end users have. An end user can give immediate feedback on your design to point out awkward or incorrect functionality. They also help to ensure that all controls are logically placed for the most efficient use of the system.&lt;/p&gt;  &lt;p&gt;Using an interactive prototyping tool allows you to walk a user through the interface or even allow them to work directly with the prototype so they can quickly suggest improvements. As use cases are being developed, it is a good idea to walk users through the use case to ensure that the use case is well thought out and that all functionality is captured both in the use case and the prototype.&lt;/p&gt;  &lt;h2&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;A user of the program only interacts with a program through the user interface so it makes sense to spend a significant amount of time during requirements to ensure that the user interface makes sense, that all functionality is included, and that the most commonly used functionality is easily accessible. The easiest way of doing this is using a screen prototype. There are a variety of methods of making screen prototypes which range from simply drawing the interface with a pen and paper to building “working” prototypes in a higher level language like Visual Basic which allows rapid screen design. However, each of these extremes has serious drawbacks. A pen and paper prototype does not allow users to interact with the prototype and it is more difficult to change. A “working” prototype done in a programming language like Visual Basic can lead the client to believe that the program is nearly complete and that development should not take very long or it can lead the client to believe that changes to the prototype will be costly making them reluctant to make necessary suggestions to improve the program.&lt;/p&gt;  &lt;p&gt;Between these two extremes lies screen design applications which allow you to draw the screens and model interactions between screens. High quality prototyping tools allow you to enter sample data and allow users to move between screens by pressing buttons so they can easily understand the interface and its functionality. Most prototyping tools produce the final output in an HTML format so they can be easily shared even if a client is not in the same office where requirements are being developed.&lt;/p&gt;  &lt;p&gt;When looking for a prototyping tool, make sure to select a tool which is easy enough to use that you can easily prototype screens while your customer is in the room. This will allow you to brainstorm and make changes to the screens without delays. A prototyping tool should already have common controls already defined to maintain design standards and improve the appearance of your screens. Being able to enter sample data in each screen can allow the customer to pinpoint areas that may be incorrect.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;Work Directly with End Users&lt;/h2&gt;  &lt;p&gt;When designing a new application or making revisions to an existing application, there is no substitute for the direct experience that end users have. An end user can give immediate feedback on your design to point out awkward or incorrect functionality. They also help to ensure that all controls are logically placed for the most efficient use of the system.&lt;/p&gt;  &lt;p&gt;Using an interactive prototyping tool allows you to walk a user through the interface or even allow them to work directly with the prototype so they can quickly suggest improvements. As use cases are being developed, it is a good idea to walk users through the use case to ensure that the use case is well thought out and that all functionality is captured both in the use case and the prototype.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-4347942938016997314?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/03/secrets-of-successful-software.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-1486756867989059196</guid><pubDate>Thu, 13 Mar 2008 05:30:00 +0000</pubDate><atom:updated>2008-03-13T09:31:47.881+04:00</atom:updated><title>Storing Images to Database and Retrieving to GridView</title><description>&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 24pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Storing Images to Database and Retrieving to GridView &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Over the internet, one can easily find a lot of references for uploading images to a database. The major problem arises when one has to retrieve these images and display them in some server control, like the GridView control. In this article we will tackle exactly that. So let's begin... shall we?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Prerequisites&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;This tutorial assumes that you own a copy of Visual Studio 2005 or Visual Web Developer Express. It also assumes that you are familiar with ASP.Net 2.0 basics and have worked with SQL Express before.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Creating the File Upload page:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;We will start with the default page, from where we will provide the user the functionality to upload the images. Open Default.aspx and switch to design-view. Drag-n-drop controls from the toolbox onto the page to create a similar form:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="Picture_x0020_5" spid="_x0000_i1029" type="#_x0000_t75" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-Upload.jpg" style="'width:381pt;height:88.5pt;visibility:visible;mso-wrap-style:square'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.jpg" title="Image-Upload"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///C:/DOCUME%7E1/bishar.SBL/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image001.jpg" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-Upload.jpg" shapes="Picture_x0020_5" height="118" width="508" /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;The Text-Box followed by the Browse button is the HTML File Input control. After adding this control onto the form switch to Source-View and add modify the control's source to include &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;"&gt;runat&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;="server"&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;. This will allow us to use the control as a server control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;In the above page, the controls are as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;fileUpload - To select the file to upload.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;txtTitle - The title of the image.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;btnUpload - On click uploads the selected image.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;lnkView - The View Images link that loads the images      from the databases inside a GridView.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Validation Controls - The Required Field Validation      Controls in order to make sure that Title and File are selected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Let us suppose that the Database File already exists. If not then add one now by right-clicking the Project and clicking on Add Item. Select Database and name it imgDB.mdf. The database will contain one table which is as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="Picture_x0020_6" spid="_x0000_i1028" type="#_x0000_t75" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-List.jpg" style="'width:202.5pt;height:108pt;visibility:visible;mso-wrap-style:square'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtmlclip1\01\clip_image002.jpg" title="Image-List"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///C:/DOCUME%7E1/bishar.SBL/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image002.jpg" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-List.jpg" shapes="Picture_x0020_6" height="144" width="270" /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Switch to the code-behind class of Default.aspx and add a button click event handler for btnUpload.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;Protected&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; btnUpload_Click(&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;...&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;,&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; ...&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; btnUpload.Click&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; intLength &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Integer&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; arrContent &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Byte&lt;/span&gt;()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;If&lt;/span&gt; fileUpload.PostedFile &lt;span style="color: blue;"&gt;Is&lt;/span&gt; &lt;span style="color: blue;"&gt;Nothing&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            lblStatus.Text = &lt;span style="color: maroon;"&gt;"No file specified."&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Exit&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Else&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; fileName &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = fileUpload.PostedFile.FileName&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; ext &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = fileName.Substring(fileName.LastIndexOf(&lt;span style="color: maroon;"&gt;"."&lt;/span&gt;))&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            ext = ext.ToLower&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; imgType = fileUpload.PostedFile.ContentType&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;If&lt;/span&gt; ext = &lt;span style="color: maroon;"&gt;".jpg"&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;ElseIf&lt;/span&gt; ext = &lt;span style="color: maroon;"&gt;".bmp"&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;ElseIf&lt;/span&gt; ext = &lt;span style="color: maroon;"&gt;".gif"&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;ElseIf&lt;/span&gt; ext = &lt;span style="color: maroon;"&gt;"jpg"&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;ElseIf&lt;/span&gt; ext = &lt;span style="color: maroon;"&gt;"bmp"&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;ElseIf&lt;/span&gt; ext = &lt;span style="color: maroon;"&gt;"gif"&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Else&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;                lblStatus.Text = &lt;span style="color: maroon;"&gt;"Only gif, bmp, or jpg format files supported."&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;                &lt;span style="color: blue;"&gt;Exit&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            intLength = Convert.ToInt32(fileUpload.PostedFile.InputStream.Length)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;ReDim&lt;/span&gt; arrContent(intLength)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            fileUpload.PostedFile.InputStream.Read(arrContent, 0, intLength)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;If&lt;/span&gt; Doc2SQLServer(txtTitle.Text.Trim, arrContent, intLength, imgType) = &lt;span style="color: blue;"&gt;True&lt;/span&gt; &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;                lblStatus.Text = &lt;span style="color: maroon;"&gt;"Image uploaded successfully."&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Else&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;                lblStatus.Text = &lt;span style="color: maroon;"&gt;"An error occured while uploading Image... Please try again."&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;End&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;What this function does is that it grabs the file selected in the File Input control and gets its extension. If the file is of type jpg, bmp, or gif, then it proceeds otherwise it throws an error. This terminates upload if the selected file is not an image of supported format.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;After checking the file format, we get the length of the file and create a Byte Array of that same length. This Byte Array will store our file/image for us. Using the InputStream.Read method of fileUpload control, we load the image into the Byte Array.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;After having saved the file into the byte array, we call our function Doc2SQLServer to store the file. We pass in the title that was supplied by the user, the byte array (which is our image), the total length, and the type of image.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;In the Doc2SQLServer method, we create a connection to our SQL Express database and create an insertion command. After connecting to the database, we execute the query and store our image and its information to the database. Below is the Doc2SQLServer method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;Protected&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Function&lt;/span&gt; Doc2SQLServer(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; title &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; Content &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Byte&lt;/span&gt;(), &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; Length &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Integer&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; strType &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt;) &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Boolean&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Try&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; cnn &lt;span style="color: blue;"&gt;As&lt;/span&gt; Data.SqlClient.SqlConnection&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; cmd &lt;span style="color: blue;"&gt;As&lt;/span&gt; Data.SqlClient.SqlCommand&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; param &lt;span style="color: blue;"&gt;As&lt;/span&gt; Data.SqlClient.SqlParameter&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; strSQL &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            strSQL = &lt;span style="color: maroon;"&gt;"Insert Into tblImage(imgData,imgTitle,imgType,imgLength) Values(@content,@title,@type,@length)"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; connString &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = &lt;span style="color: maroon;"&gt;"Data Source=.\SQLEXPRESS;AttachDbFilename=""|DataDirectory|\imgDB.mdf"";Integrated Security=True;User Instance=True"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cnn = &lt;span style="color: blue;"&gt;New&lt;/span&gt; Data.SqlClient.SqlConnection(connString)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cmd = &lt;span style="color: blue;"&gt;New&lt;/span&gt; Data.SqlClient.SqlCommand(strSQL, cnn)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param = &lt;span style="color: blue;"&gt;New&lt;/span&gt; Data.SqlClient.SqlParameter(&lt;span style="color: maroon;"&gt;"@content"&lt;/span&gt;, Data.SqlDbType.Image)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param.Value = Content&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cmd.Parameters.Add(param)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param = &lt;span style="color: blue;"&gt;New&lt;/span&gt; Data.SqlClient.SqlParameter(&lt;span style="color: maroon;"&gt;"@title"&lt;/span&gt;, Data.SqlDbType.VarChar)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param.Value = title&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cmd.Parameters.Add(param)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param = &lt;span style="color: blue;"&gt;New&lt;/span&gt; Data.SqlClient.SqlParameter(&lt;span style="color: maroon;"&gt;"@type"&lt;/span&gt;, Data.SqlDbType.VarChar)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param.Value = strType&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cmd.Parameters.Add(param)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param = &lt;span style="color: blue;"&gt;New&lt;/span&gt; Data.SqlClient.SqlParameter(&lt;span style="color: maroon;"&gt;"@length"&lt;/span&gt;, Data.SqlDbType.BigInt)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            param.Value = Length&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cmd.Parameters.Add(param)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cnn.Open()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cmd.ExecuteNonQuery()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            cnn.Close()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Return&lt;/span&gt; &lt;span style="color: blue;"&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue;"&gt;As&lt;/span&gt; Exception&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Return&lt;/span&gt; &lt;span style="color: blue;"&gt;False&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Try&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;End&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Function&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;The Image Grabber&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Next we create a web-page that will grab the image whose id is passed to it as a query string. Right-click the project in solution explorer and add a web-page imgGrab.aspx.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Define the page_load method as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;Protected&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; Page_Load(...,...) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; &lt;span style="color: blue;"&gt;Me&lt;/span&gt;.Load&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Try&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; ds &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;New&lt;/span&gt; DataSet&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; da &lt;span style="color: blue;"&gt;As&lt;/span&gt; SqlClient.SqlDataAdapter&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; arrContent &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Byte&lt;/span&gt;()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; dr &lt;span style="color: blue;"&gt;As&lt;/span&gt; DataRow&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; strSql &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            strSql = &lt;span style="color: maroon;"&gt;"Select * from tblImage Where imgId="&lt;/span&gt; &amp;amp; Request.QueryString(&lt;span style="color: maroon;"&gt;"ID"&lt;/span&gt;)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; connString &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = &lt;span style="color: maroon;"&gt;"Data Source=.\SQLEXPRESS;AttachDbFilename=""|DataDirectory|\imgDB.mdf"";Integrated Security=True;User Instance=True"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            da = &lt;span style="color: blue;"&gt;New&lt;/span&gt; SqlClient.SqlDataAdapter(strSql, connString)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            da.Fill(ds)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            dr = ds.Tables(0).Rows(0)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            arrContent = &lt;span style="color: blue;"&gt;CType&lt;/span&gt;(dr.Item(&lt;span style="color: maroon;"&gt;"imgData"&lt;/span&gt;), &lt;span style="color: blue;"&gt;Byte&lt;/span&gt;())&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; conType &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = dr.Item(&lt;span style="color: maroon;"&gt;"imgType"&lt;/span&gt;).ToString()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            Response.ContentType = conType&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            Response.OutputStream.Write(arrContent, 0, dr.Item(&lt;span style="color: maroon;"&gt;"imgLength"&lt;/span&gt;))&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            Response.End()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue;"&gt;As&lt;/span&gt; Exception&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Try&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;End&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;What this does is quite simple. It gets the image data whose id is passed in and writes it to the web-page. Response.ContentType sets the web-page as an image content holder and when we write the complete byte array to the response stream, we actually get the image.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Loading Images into the GridView Control&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;A major problem faced by developers is when loading images back into the datagrid or the new gridview control. I myself faced long hours trying to come up with a solution for this, which in the end was a simple procedure.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Create a new-page, Viewer.aspx and add a GridView onto it. (This page is linked from the Default.aspx page via lnkView). Name the GridView imgGrid and click on the small box located at the upper-right corner of the control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="Picture_x0020_7" spid="_x0000_i1027" type="#_x0000_t75" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-GridView.jpg" style="'width:362.25pt;height:144.75pt;visibility:visible;mso-wrap-style:square'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtmlclip1\01\clip_image003.jpg" title="Image-GridView"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///C:/DOCUME%7E1/bishar.SBL/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image003.jpg" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-GridView.jpg" shapes="Picture_x0020_7" height="193" width="483" /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Click on Edit Columns to open the Fields Dialog as shown below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="Picture_x0020_8" spid="_x0000_i1026" type="#_x0000_t75" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-GridView-Columns.jpg" style="'width:386.25pt;height:315pt;visibility:visible;mso-wrap-style:square'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtmlclip1\01\clip_image004.jpg" title="Image-GridView-Columns"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///C:/DOCUME%7E1/bishar.SBL/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image004.jpg" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-GridView-Columns.jpg" shapes="Picture_x0020_8" height="420" width="515" /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;In this dialog, uncheck "Auto-generate fields" and add two fields; a bound field and an image field. For the bound field set the column header text to Title and the DataField property to imgTitle (This will bind this column to the imgTitle column in the dataset to which we will load our table data). As for the image field, set the caption to Picture and the DataImageUrlField to imgFile. You might think where this imgFile comes from, especially since the database does not contain a column with such a name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Switch to the code-behind class and create the page_load event as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;Protected&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; Page_Load(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Object&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: blue;"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; &lt;span style="color: blue;"&gt;Me&lt;/span&gt;.Load&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; ds &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;New&lt;/span&gt; DataSet&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; da &lt;span style="color: blue;"&gt;As&lt;/span&gt; SqlClient.SqlDataAdapter&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; strSQL &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        strSQL = &lt;span style="color: maroon;"&gt;"Select imgId,imgTitle from tblImage"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; connString &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = &lt;span style="color: maroon;"&gt;"Data Source=.\SQLEXPRESS;AttachDbFilename=""|DataDirectory|\imgDB.mdf"";Integrated Security=True;User Instance=True"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        da = &lt;span style="color: blue;"&gt;New&lt;/span&gt; SqlClient.SqlDataAdapter(strSQL, connString)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        da.Fill(ds)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        ds.Tables(0).Columns.Add(&lt;span style="color: maroon;"&gt;"imgFile"&lt;/span&gt;)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;For&lt;/span&gt; &lt;span style="color: blue;"&gt;Each&lt;/span&gt; tempRow &lt;span style="color: blue;"&gt;As&lt;/span&gt; DataRow &lt;span style="color: blue;"&gt;In&lt;/span&gt; ds.Tables(0).Rows&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;            tempRow.Item(&lt;span style="color: maroon;"&gt;"imgFile"&lt;/span&gt;) = (&lt;span style="color: maroon;"&gt;"imgGrab.aspx?id="&lt;/span&gt; &amp;amp; tempRow.Item(&lt;span style="color: maroon;"&gt;"imgID"&lt;/span&gt;))&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        &lt;span style="color: blue;"&gt;Next&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        imgGrid.DataSource = ds&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;        imgGrid.DataBind()&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;End&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;What this function does is the simple task of grabbing data from the database. It grabs two columns, imgId and imgTitle. What it does afterwards is the key concept... and the few-lines of code that marks the solution to a big problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;After filling in the dataset, we know that it contains one table, at index 0 of course. We add a custom column "imgFile" to it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;After that, we traverse through each dataRow in the table. And for each row, we make a call to our imgGrab.aspx page with the id from that row. We set this equal to the record for imgFile for that row.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Thus on display of the GridView, for each row being displayed, the imgGrab.aspx web-page is called and the image is displayed in return.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;A screen-shot of the resulting grid:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="Picture_x0020_9" spid="_x0000_i1025" type="#_x0000_t75" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-Sample.jpg" style="'width:219pt;height:639pt;visibility:visible;mso-wrap-style:square'"&gt;    &lt;v:imagedata src="file:///C:\DOCUME~1\bishar.SBL\LOCALS~1\Temp\msohtmlclip1\01\clip_image005.jpg" title="Image-Sample"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///C:/DOCUME%7E1/bishar.SBL/LOCALS%7E1/Temp/msohtmlclip1/01/clip_image005.jpg" alt="http://www.beansoftware.com/ASP.NET-Tutorials/Images/Image-Sample.jpg" shapes="Picture_x0020_9" height="852" width="292" /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt;" valign="top"&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;And   all things must come to an end&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;The main emphasis in this article   was on uploading images to a SQL Express database and then displaying those   images in the GridView control. I know there are a lot of different articles   explaining the technique for uploading to the database, but none for   explaining a simple method to retrieve them to a GridView or similar control.   Please download the code for this article and play around with it to learn   more about it. I hope you found this article interesting and informative. I   am open for suggestions and remarks, both negative and positive. Feel free to   contact me at &lt;/span&gt;&lt;a href="mailto:salman@premierpos.com"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;salman@premierpos.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;&lt;b&gt;Related articles:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Dynamic-User-Interface.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Dynamic User Interface in ASP.NET Web Applications&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;2. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/GridView-Hidden-Column.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;GridView Hidden Column Problem (And Two Common Solutions)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;3. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/DataSet-DataAdapter.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;DataSet and DataAdapter in ASP.NET 2.0 - Part 1 of 2&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;4. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/DataSet-DataProvider.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;DataSet and DataAdapter in ASP.NET 2.0 - Part 2 of 2&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;5. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/GridView-Control.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;About GridView Control&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;6. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Data-Source-Controls.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Data Source Controls in ASP.NET 2.0&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;7. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Picture-Album.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Developing a picture album in ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;8. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Binary-Files-To-Database.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Storing Binary Data to Database using ASP.NET 2.0&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;9. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ImageMap-Control.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;How to use ImageMap Control&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;10. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/NET-Tutorials/Excel-ADO.NET-Database.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Using Excel Sheets as a Database Backend&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;11. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Save-Read-Image-Database.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Save &amp;amp; Read Image From Database&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;12. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ADO.NET-DAL.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Using ADO.NET to Develop Data Access Logic (DAL)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;13. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ObjectDataSource-GridView.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Working With ObjectDataSource And GridView&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;14. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ListView-DataPager.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;How to Use ASP.NET 3.5 ListView &amp;amp; DataPager&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Tutorial toolbar:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;  &lt;/span&gt;&lt;a href="mailto:?subject=Interesting%20tutorial:%20Storing%20Images%20to%20Database%20and%20Retrieving%20to%20GridView&amp;amp;body=Hi,%20I%20found%20an%20interesting%20ASP.NET%20tutorial:%20Storing%20Images%20to%20Database%20and%20Retrieving%20to%20GridView%20on%20http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Tell A Friend&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;  |  &lt;/span&gt;&lt;a href="javascript:addbookmark('Storing%20Images%20to%20Database%20and%20Retrieving%20to%20GridView',%20'http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx');"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Add to &lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;a href="javascript:addbookmark('Storing%20Images%20to%20Database%20and%20Retrieving%20to%20GridView',%20'http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx');"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;favorites&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;  |  &lt;/span&gt;&lt;a href="mailto:info@beansoftware.com?Subject=Tutorial%20Feedback:%20Storing%20Images%20to%20Database%20and%20Retrieving%20to%20GridView"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Feedback&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Copyright © 2002-2008 Bean Software. All rights reserved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Related articles:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Dynamic-User-Interface.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Dynamic User Interface in ASP.NET Web Applications&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;2. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/GridView-Hidden-Column.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;GridView Hidden Column Problem (And Two Common Solutions)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;3. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/DataSet-DataAdapter.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;DataSet and DataAdapter in ASP.NET 2.0 - Part 1 of 2&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;4. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/DataSet-DataProvider.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;DataSet and DataAdapter in ASP.NET 2.0 - Part 2 of 2&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;5. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/GridView-Control.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;About GridView Control&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;6. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Data-Source-Controls.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Data Source Controls in ASP.NET 2.0&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;7. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Picture-Album.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Developing a picture album in ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;8. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Binary-Files-To-Database.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Storing Binary Data to Database using ASP.NET 2.0&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;9. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ImageMap-Control.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;How to use ImageMap Control&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;10. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/NET-Tutorials/Excel-ADO.NET-Database.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Using Excel Sheets as a Database Backend&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;11. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Save-Read-Image-Database.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Save &amp;amp; Read Image From Database&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;12. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ADO.NET-DAL.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Using ADO.NET to Develop Data Access Logic (DAL)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;13. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ObjectDataSource-GridView.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Working With ObjectDataSource And GridView&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt;14. &lt;/span&gt;&lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/ListView-DataPager.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;How to Use ASP.NET 3.5 ListView &amp;amp; DataPager&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-1486756867989059196?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/03/storing-images-to-database-and.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-3070985526915258428</guid><pubDate>Thu, 13 Mar 2008 05:21:00 +0000</pubDate><atom:updated>2008-03-13T09:30:42.949+04:00</atom:updated><title>How to: Implement Simple Forms Authentication</title><description>&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 13.5pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;To configure the application for forms authentication&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="line-height: normal;"&gt;This example in this topic presents a simple implementation of ASP.NET forms authentication. It is intended to illustrate the fundamentals of how to use forms authentication to log users into an ASP.NET application.&lt;/p&gt;&lt;p class="MsoNormal" style="line-height: normal;"&gt;In the scenario for the example, users request a protected resource, namely a page named Default.aspx. Only one user has access to the protected resource: jchen@contoso.com, with a password of "37Yj*99P". The user name and password are hard-coded into the Logon.aspx file. The example requires three files: the Web.config file, a page named Logon.aspx, and a page named Default.aspx. The files reside in the application root directory.&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: 13.5pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/xdt4thhy.aspx"&gt;&lt;span style="text-decoration: underline;"&gt;More Details&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-3070985526915258428?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/03/how-to-implement-simple-forms.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-8139730441655527989</guid><pubDate>Fri, 22 Feb 2008 16:12:00 +0000</pubDate><atom:updated>2008-02-22T20:12:46.800+04:00</atom:updated><title>Asp.net request  handling</title><description>&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;An Overview of ASP.NET Request Handling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;To understand how HttpModules and HttpHandlers fit into the scheme of things, you have to understand the way that ASP.NET handles a request. When a request is received by Internet Information Server (IIS), it looks at the extension to determine which ISAPI filter should handle the request. For any of the supported file extensions, such as .aspx or .asmx, the answer is aspnet_isapi.dll. When ASP.NET fires up, it performs almost the same process again. It looks at the request and compares it to the &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;httphandlers&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; section of the .config file. By default, machine.config maps .aspx files to the PageHandlerFactory and .asmx files to the WebServiceHandlerFactory. This mapping determines the HttpHandler (class) that is responsible for handling the request. With the concept of mapping, you can create a new HttpHandler and map it to a new type of request. In fact, this is exactly what Microsoft did with Trace.axd. You will find that it is a new HttpHandler that is registered in machine.config for any request path that ends in trace.axd.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;While processing a request received from IIS, ASP.NET raises several events. They are raised in the following order:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;BeginRequest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;AuthenticateRequest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;AuthorizeRequest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;AcquireRequestState&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;ResolveRequestCache&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Page Constructor&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;PreRequestHandlerExecute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Page.Init&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Page.Load&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;PostRequestHandlerExecute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;ReleaseRequestState&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;UpdateRequestCache&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;EndRequest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;PreSendRequestHeaders&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;PreSendRequestContent&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;The items in bold represent several of the page-level events that are raised during the execution of a page. Each of these events can be sunk, providing opportunities to participate in the processing of each page in an application. In Chapter 7, "Security," we looked at handling the AuthenticateRequest and AuthorizeRequest events.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-8139730441655527989?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/02/aspnet-request-handling.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-280311569357177275</guid><pubDate>Fri, 22 Feb 2008 16:11:00 +0000</pubDate><atom:updated>2008-02-22T20:12:20.394+04:00</atom:updated><title>Reading Image From DB</title><description>&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;Image tempImg = pictureBox1.Image;&lt;br /&gt;System.IO.MemoryStream memBuffer = &lt;span style="color: blue;"&gt;new&lt;/span&gt; System.IO.MemoryStream();&lt;br /&gt;tempImg.Save(memBuffer, System.Drawing.Imaging.ImageFormat.Bmp);&lt;br /&gt;byte[] output = &lt;span style="color: blue;"&gt;new&lt;/span&gt; byte[memBuffer.Length];&lt;br /&gt;memBuffer.Read(output, 0, (&lt;span style="color: blue;"&gt;int&lt;/span&gt;)memBuffer.Length);&lt;br /&gt;&lt;span style="color: green;"&gt;// Write to SQL here &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;// Read from SQL here &lt;/span&gt;&lt;br /&gt;memBuffer.Write(output, 0, output.Length);&lt;br /&gt;tempImg = Image.FromStream(memBuffer);&lt;br /&gt;pictureBox1.Image = tempImg; &lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;br /&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-280311569357177275?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/02/reading-image-from-db.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-5632269788732558530</guid><pubDate>Fri, 22 Feb 2008 16:10:00 +0000</pubDate><atom:updated>2008-02-22T20:11:45.434+04:00</atom:updated><title>ASP.NET Email Tutorial</title><description>&lt;p class="MsoNormal" style="margin-bottom: 12pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;ASP.NET Email Tutorial&lt;br /&gt;This tutorial will show you how to send a simple email message using ASP.NET 2.0 and C#&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.aspnettutorials.com/downloads/email/SendEmailCSharp2005.zip"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;color:blue;"   &gt;Download the Full Working Version of this Project written with Visual Studio.NET C# 2005 Here!&lt;/span&gt;&lt;/a&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;Sending a email using ASP.NET 2.0 and C# 2.0 is actually very simple.&lt;br /&gt;&lt;br /&gt;First, you will need to import the &lt;b&gt;System.Net.Mail &lt;/b&gt;namespace.&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;System.Net.Mail&lt;/b&gt; namespace contains the &lt;b&gt;SmtpClient&lt;/b&gt; and &lt;b&gt;MailMessage&lt;/b&gt; Classes that we need in order to send the email.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(153, 153, 153) none repeat scroll 0% 50%; width: 356.25pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="0" cellpadding="0" cellspacing="1" width="475"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 3.75pt; background: whitesmoke none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;using System.Net.Mail;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;br /&gt;We use the btnSubmit_Click event to do the work.&lt;br /&gt;&lt;br /&gt;We then call the emailClient.Send to send the message using the variables from our ASP.NET coded page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(153, 153, 153) none repeat scroll 0% 50%; width: 356.25pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="0" cellpadding="0" cellspacing="1" width="475"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 3.75pt; background: whitesmoke none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;protected void   btnSubmit_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt; try&lt;br /&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;MailMessage message = new   MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);&lt;br /&gt; SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text);&lt;br /&gt; emailClient.Send(message);&lt;br /&gt; litStatus.Text = "Message Sent";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;}&lt;br /&gt; catch (Exception ex)&lt;br /&gt; {&lt;br /&gt; litStatus.Text=ex.ToString();&lt;br /&gt; }&lt;br /&gt; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;br /&gt;&lt;br /&gt;The front end .aspx page looks something like this: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(153, 153, 153) none repeat scroll 0% 50%; width: 356.25pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="0" cellpadding="0" cellspacing="1" width="475"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 3.75pt; background: whitesmoke none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;table align="center" bgcolor="#cccccc" border="0" cellpadding="5" cellspacing="1" width="600"&gt;&lt;br /&gt; &lt;tbody&gt;&lt;tr&gt;&lt;br /&gt; &lt;td class="header1" align="right" bgcolor="#eeeeee" width="100"&gt; To&lt;/td&gt;&lt;br /&gt; &lt;td bgcolor="#ffffff"&gt;&lt;asp:textbox id="txtTo" runat="server" columns="50"&gt;&lt;/asp:textbox&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt; &lt;tr&gt;&lt;br /&gt; &lt;td class="header1" align="right" bgcolor="#eeeeee" width="100"&gt; From&lt;/td&gt;&lt;br /&gt; &lt;td bgcolor="#ffffff"&gt;&lt;asp:textbox id="txtFrom" runat="server" columns="50"&gt;&lt;/asp:textbox&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt; &lt;tr&gt;&lt;br /&gt; &lt;td class="header1" align="right" bgcolor="#eeeeee"&gt; SMTP Server&lt;/td&gt;&lt;br /&gt; &lt;td bgcolor="#ffffff"&gt;&lt;asp:textbox id="txtSMTPServer" runat="server" columns="50"&gt;&lt;/asp:textbox&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt; &lt;tr&gt;&lt;br /&gt; &lt;td class="header1" align="right" bgcolor="#eeeeee" width="100"&gt; Subject&lt;/td&gt;&lt;br /&gt; &lt;td bgcolor="#ffffff"&gt;&lt;asp:textbox id="txtSubject" runat="server" columns="50"&gt;&lt;/asp:textbox&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt; &lt;tr&gt;&lt;br /&gt; &lt;td class="header1" align="right" bgcolor="#eeeeee" width="100"&gt; Body&lt;/td&gt;&lt;br /&gt; &lt;td bgcolor="#ffffff"&gt;&lt;asp:textbox id="txtBody" runat="server" columns="40" textmode="MultiLine"&gt;&lt;/asp:textbox&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt; &lt;tr&gt;&lt;br /&gt; &lt;td class="header1" align="right" bgcolor="#eeeeee"&gt;Action&lt;/td&gt;&lt;br /&gt; &lt;td bgcolor="#ffffff"&gt;&lt;asp:button id="btnSubmit" runat="server" text="Send Email" onclick="btnSubmit_Click"&gt;&lt;/asp:button&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt; &lt;tr&gt;&lt;br /&gt; &lt;td class="header1" align="right" bgcolor="#eeeeee" width="100"&gt;Status&lt;/td&gt;&lt;br /&gt; &lt;td class="basix" bgcolor="#ffffff"&gt;&lt;asp:literal id="litStatus" runat="server"&gt;&lt;/asp:literal&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;br /&gt;&lt;br /&gt;The flow for the code behind page is as follows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(153, 153, 153) none repeat scroll 0% 50%; width: 356.25pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" border="0" cellpadding="0" cellspacing="1" width="475"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 3.75pt; background: whitesmoke none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;using System;&lt;br /&gt; using System.Data;&lt;br /&gt; using System.Configuration;&lt;br /&gt; using System.Web;&lt;br /&gt; using System.Web.Security;&lt;br /&gt; using System.Web.UI;&lt;br /&gt; using System.Web.UI.WebControls;&lt;br /&gt; using System.Web.UI.WebControls.WebParts;&lt;br /&gt; using System.Web.UI.HtmlControls;&lt;br /&gt; using System.Net.Mail;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;public partial class _Default :   System.Web.UI.Page&lt;br /&gt; {&lt;br /&gt; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;}&lt;br /&gt; protected void btnSubmit_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt; try&lt;br /&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;MailMessage message = new MailMessage(txtFrom.Text,   txtTo.Text, txtSubject.Text, txtBody.Text);&lt;br /&gt; SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text);&lt;br /&gt; emailClient.Send(message);&lt;br /&gt; litStatus.Text = "Message Sent";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;}&lt;br /&gt; catch (Exception ex)&lt;br /&gt; {&lt;br /&gt; litStatus.Text=ex.ToString();&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:12;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.aspnettutorials.com/downloads/email/SendEmailCSharp2005.zip"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:12;color:blue;"   &gt;Download the Full Working Version of this Project written with Visual Studio.NET C# 2005 Here!&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:12;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-5632269788732558530?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/02/aspnet-email-tutorial.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total><enclosure url="http://www.aspnettutorials.com/downloads/email/SendEmailCSharp2005.zip" length="15858" type="application/x-zip-compressed" /><media:content url="http://www.aspnettutorials.com/downloads/email/SendEmailCSharp2005.zip" fileSize="15858" type="application/x-zip-compressed" /><itunes:explicit>yes</itunes:explicit><itunes:subtitle>ASP.NET Email Tutorial This tutorial will show you how to send a simple email message using ASP.NET 2.0 and C# Download the Full Working Version of this Project written with Visual Studio.NET C# 2005 Here! Sending a email using ASP.NET 2.0 and C# 2.0 is a</itunes:subtitle><itunes:author>noreply@blogger.com (Bishar.B.N)</itunes:author><itunes:summary>ASP.NET Email Tutorial This tutorial will show you how to send a simple email message using ASP.NET 2.0 and C# Download the Full Working Version of this Project written with Visual Studio.NET C# 2005 Here! Sending a email using ASP.NET 2.0 and C# 2.0 is actually very simple. First, you will need to import the System.Net.Mail namespace. The System.Net.Mail namespace contains the SmtpClient and MailMessage Classes that we need in order to send the email. using System.Net.Mail; We use the btnSubmit_Click event to do the work. We then call the emailClient.Send to send the message using the variables from our ASP.NET coded page. protected void btnSubmit_Click(object sender, EventArgs e) { try { MailMessage message = new MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text); SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text); emailClient.Send(message); litStatus.Text = "Message Sent"; } catch (Exception ex) { litStatus.Text=ex.ToString(); } } The front end .aspx page looks something like this: To From SMTP Server Subject Body Action Status The flow for the code behind page is as follows. using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Net.Mail; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSubmit_Click(object sender, EventArgs e) { try { MailMessage message = new MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text); SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text); emailClient.Send(message); litStatus.Text = "Message Sent"; } catch (Exception ex) { litStatus.Text=ex.ToString(); } } } Download the Full Working Version of this Project written with Visual Studio.NET C# 2005 Here! </itunes:summary></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-766184496316729940</guid><pubDate>Fri, 22 Feb 2008 16:08:00 +0000</pubDate><atom:updated>2008-02-22T20:10:04.084+04:00</atom:updated><title>Measuring the Size of Uploaded Images</title><description>&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;It's not uncommon that you want to check the dimensions of an image that a user uploads to your web site. For example, you may want to check the size of an uploaded banner in an advertising web site, or check the size of an image that is shown in a news article. You could, of course, just allow any uploaded image and resize it on the fly, but in many cases you end up with distorted images because they have been resized with incorrect proportions. So, depending on your requirements, it can be a good idea to check the dimensions of the image, and reject the uploaded file if it doesn't meet your requirements. By checking the dimensions of the uploaded file before it's saved to disk, you save yourself the trouble from deleting the temporary image when it doesn't meet the specifications. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Fortunately, this is all quite easy to accomplish. The code download at the end of the article contains a small web site with a fully working example in both VB.NET and C#. The web site contains a web.config file with two appSettings keys for the required dimensions:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;appsettings&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;add key="RequiredHeight" value="184"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;add key="RequiredWidth" value="370"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/appsettings&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;The values for the height and width are arbitrary in the sample application and can easily be changed to meet your requirements. These values are read and stored in private variables in the page when it is posted back (that is, when a file has been uploaded) with the following code (I am showing the C# version here, but you can find similar code for VB.NET in the demo application which you can download at the end of this article): &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;if (Page.IsPostBack)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;height = Convert.ToInt32(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;ConfigurationManager.AppSettings.Get("RequiredHeight"));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;width = Convert.ToInt32(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;ConfigurationManager.AppSettings.Get("RequiredWidth"));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;These values are used to validate the dimensions of the image, which is shown later.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;The markup of the demo page contains an &lt;asp:fileupload&gt; control, a Button and a number of validator controls, used to ensure the user has selected a file and to provide feedback about the uploaded file and whether it meets the validation rules.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;When the user has selected a file and clicked the Upload button, the following code is triggered:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;Page.Validate();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;if (Page.IsValid)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;if (FileUpload1.HasFile)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;string extension = Path.GetExtension(FileUpload1.PostedFile.FileName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;switch (extension.ToLower())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;// Only allow uploads that look like images.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;case ".jpg":&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;case ".jpeg":&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;case ".gif":&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;case ".bmp":&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;if (ValidateFileDimensions())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;string fileName = Path.GetFileName(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                &lt;/span&gt;FileUpload1.PostedFile.FileName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;string saveAsName = Path.Combine(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                &lt;/span&gt;Server.MapPath("~/Uploads/"), fileName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;FileUpload1.PostedFile.SaveAs(saveAsName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;lblSucces.Visible = true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;valInvalidDimensions.IsValid = false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;valInvalidDimensions.ErrorMessage = &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;String.Format(valInvalidDimensions.ErrorMessage, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;height, width);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;catch&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;// Unable to read the file dimensions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;// The uploaded file is probably not an image.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;          &lt;/span&gt;valInvalidFile.IsValid = false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;default: // The uploaded file has an incorrect extension&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;valInvalidFile.IsValid = false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;The code first checks if a file has been uploaded by checking the HasFile property of the FileUpload control. It then proceeds to check the extension of the uploaded file to see if it's an image or not. You can add or remove case blocks to the switch statement to change the type of files that your users are allowed to upload.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;When the uploaded file looks like an image, the method ValidateFileDimensions (shown later) is called to check the dimensions of the uploaded image. If this method returns true, the image meets the specifications and it is saved to disk using the SaveAs method of the PostedFile. If the image has incorrect dimensions, the CustomValidator called valInvalidDimensions is shown to the user. Notice how String.Format is used to embed the required height and width into the ErrorMessage of the validator. In the markup, the ErrorMessage property contains two placeholders that are replaced by String.Format to inject the dimensions in the message:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;asp:customvalidator&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;ID="valInvalidDimensions" &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;runat="server" &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;ErrorMessage="The image you uploaded has incorrect dimensions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;Please select a file with a height of {0}px and a width of {1}px." &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;Display="Dynamic" &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;EnableViewState="false"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/asp:CustomValidator&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;The most important part of the sample page is the ValidateFileDimensions method which is remarkably simple:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;public bool ValidateFileDimensions()&lt;br /&gt;{&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;using (System.Drawing.Image myImage =&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream))&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;{&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;return (myImage.Height == height &amp;amp;&amp;amp; myImage.Width == width);&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;br /&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;This code creates a new &lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.drawing.image.aspx" target="_blank"&gt;&lt;span style="color: blue;"&gt;Image&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt; (3) object by calling &lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.drawing.image.fromstream.aspx" target="_blank"&gt;&lt;span style="color: blue;"&gt;Image.FromStream&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt; (4) and passing it the InputStream property of the PostedFile. This creates an in-memory representation of the image which exposes properties like Height and Width. Those are then used to check the dimensions of the image against the required height and width fields. The method returns true when the image has the exact same dimensions as specified in the private height and width fields. Otherwise it returns false. When the uploaded file doesn't contain a valid image at all, Image.FromStream raises an exception which is handled in the calling code. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;The code contains a using block to ensure that the image is disposed of as soon as it's not needed anymore.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Notice I am prefixing the Image class with its full System.Drawing namespace to avoid name collisions with the Image class from the System.Web.UI.WebControls namespace which is imported by default. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Summary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Checking the dimensions of an image that is uploaded by your users is useful in many situations. Being able to check the image before it's even saved to disk is even better, as it frees you from deleting invalid images after they have been uploaded. With the code from this article you can now perform the validation while the image is still in memory and only save it to disk when it meets your requirements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 18pt; line-height: 115%;"&gt;Download Files&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a href="http://imar.spaanjaars.com/Downloads/Articles/MeasuringImageSize/MeasuringImageSize.zip"&gt;&lt;span style="font-size: 12pt; line-height: 115%; color: blue;"&gt;Source Code for this Article&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; line-height: 115%;"&gt; (7) The download contains a working example in both C# and VB.NET. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-766184496316729940?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/02/measuring-size-of-uploaded-images.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total><enclosure url="http://imar.spaanjaars.com/Downloads/Articles/MeasuringImageSize/MeasuringImageSize.zip" length="5477" type="application/x-zip-compressed" /><media:content url="http://imar.spaanjaars.com/Downloads/Articles/MeasuringImageSize/MeasuringImageSize.zip" fileSize="5477" type="application/x-zip-compressed" /><itunes:explicit>yes</itunes:explicit><itunes:subtitle>Introduction It's not uncommon that you want to check the dimensions of an image that a user uploads to your web site. For example, you may want to check the size of an uploaded banner in an advertising web site, or check the size of an image that is show</itunes:subtitle><itunes:author>noreply@blogger.com (Bishar.B.N)</itunes:author><itunes:summary>Introduction It's not uncommon that you want to check the dimensions of an image that a user uploads to your web site. For example, you may want to check the size of an uploaded banner in an advertising web site, or check the size of an image that is shown in a news article. You could, of course, just allow any uploaded image and resize it on the fly, but in many cases you end up with distorted images because they have been resized with incorrect proportions. So, depending on your requirements, it can be a good idea to check the dimensions of the image, and reject the uploaded file if it doesn't meet your requirements. By checking the dimensions of the uploaded file before it's saved to disk, you save yourself the trouble from deleting the temporary image when it doesn't meet the specifications. Fortunately, this is all quite easy to accomplish. The code download at the end of the article contains a small web site with a fully working example in both VB.NET and C#. The web site contains a web.config file with two appSettings keys for the required dimensions: The values for the height and width are arbitrary in the sample application and can easily be changed to meet your requirements. These values are read and stored in private variables in the page when it is posted back (that is, when a file has been uploaded) with the following code (I am showing the C# version here, but you can find similar code for VB.NET in the demo application which you can download at the end of this article): if (Page.IsPostBack) { height = Convert.ToInt32( ConfigurationManager.AppSettings.Get("RequiredHeight")); width = Convert.ToInt32( ConfigurationManager.AppSettings.Get("RequiredWidth")); } These values are used to validate the dimensions of the image, which is shown later. The markup of the demo page contains an control, a Button and a number of validator controls, used to ensure the user has selected a file and to provide feedback about the uploaded file and whether it meets the validation rules. When the user has selected a file and clicked the Upload button, the following code is triggered: Page.Validate(); if (Page.IsValid) { if (FileUpload1.HasFile) { string extension = Path.GetExtension(FileUpload1.PostedFile.FileName); switch (extension.ToLower()) { // Only allow uploads that look like images. case ".jpg": case ".jpeg": case ".gif": case ".bmp": try { if (ValidateFileDimensions()) { string fileName = Path.GetFileName( FileUpload1.PostedFile.FileName); string saveAsName = Path.Combine( Server.MapPath("~/Uploads/"), fileName); FileUpload1.PostedFile.SaveAs(saveAsName); lblSucces.Visible = true; } else { valInvalidDimensions.IsValid = false; valInvalidDimensions.ErrorMessage = String.Format(valInvalidDimensions.ErrorMessage, height, width); } } catch { // Unable to read the file dimensions. // The uploaded file is probably not an image. valInvalidFile.IsValid = false; } break; default: // The uploaded file has an incorrect extension valInvalidFile.IsValid = false; break; } } } The code first checks if a file has been uploaded by checking the HasFile property of the FileUpload control. It then proceeds to check the extension of the uploaded file to see if it's an image or not. You can add or remove case blocks to the switch statement to change the type of files that your users are allowed to upload. When the uploaded file looks like an image, the method ValidateFileDimensions (shown later) is called to check the dimensions of the uploaded image. If this method returns true, the image meets the specifications and it is saved to disk using the SaveAs method of the PostedFile. If the image has incorrect dimensions, the CustomValidator called valInvalidDimensions is shown to the user. Notice how String.Format is used to embed the required height and width into the ErrorMessage of the validator. In the markup, the ErrorMessage property contains two placeholders that are replaced by String.Format to inject the dimensions in the message: ID="valInval</itunes:summary></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-5128523737400683771</guid><pubDate>Fri, 15 Feb 2008 07:54:00 +0000</pubDate><atom:updated>2008-02-15T11:55:02.140+04:00</atom:updated><title>HTTP 500 - Internal server error</title><description>&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;When viewing an ASP page in a web browser, visitors see the following error:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 464px; height: 46px;" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;HTTP 500.100 - Internal Server   Error - ASP&lt;br /&gt;  Internet Information Services&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; The error above was generated using an IIS 5.0 web server running on Windows 2000. The error message may differ depending on your web server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 13.5pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Reason&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;The web server is having a problem processing the ASP page. The problem could either be with the ASP code itself, the database connection or the SQL code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 13.5pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Solution&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;        &lt;p class="MsoNormal"&gt;Please Register the IIS with asp.net using the command prompt of asp.net&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;cmd&gt;aspnetreg_iis –I &lt;span style=""&gt;   &lt;/span&gt;this will register the iis with asp.net&lt;br /&gt;also want to know more command type help&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-5128523737400683771?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/02/http-500-internal-server-error.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7839837632136915848.post-2058965542945026247</guid><pubDate>Fri, 15 Feb 2008 07:49:00 +0000</pubDate><atom:updated>2008-02-15T11:52:28.488+04:00</atom:updated><title>Configuring SQL Server Express 2005 for Remote Access</title><description>&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Errors connecting to SQL Server Express 2005&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Are you getting errors connecting to SQL Server Express 2005 via remote client software and yet have no problem connecting to it on the local machine? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Some of the errors you might be seeing are: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;sql server does not allow      remote connections&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;SQL Network Interfaces, error:      26 - Error Locating Server/Instance Specified&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;An error has occured while      establishing a connection to the server. When connecting to SQL Server      2005,this failure may be caused by the fact that under the default      settings SQL Server does not allow remote connections.(provider:Named      Pipes Provider,error:40-Could not open connection to SQL Server))&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Server does not exist or access      denied &lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;If yes, then read on because SQL Server Express 2005 is not automatically configured for remote access during installation. It can be enabled however, so the problems you are having are more of a &lt;i&gt;"feature"&lt;/i&gt; than a bug. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;i&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Why this page?&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Well, we too ran into this problem - just as you have now. In recognition of all of the kind help we received from the Internet newsgroups we thought it might be useful to collect the information here so as to provide assistance to others in the same position. If you have any suggestions for updates to this page please &lt;/span&gt;&lt;a href="mailto:info@net2000ltd.com?subject=Comments%20on%20the%20SQL%20Server%20Express%202005%20Remote%20Network%20Configuration%20Page"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;let us know&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Here's a quick summary of the actions you need to take. The first three actions have a separate page which provides more details and some screen shots of the procedure.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;[&lt;/span&gt;&lt;a href="http://www.datamasker.com/SSE2005_SAC.htm" target="The Surface Area Configuration Utility"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Link&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;] Enable the TCP/IP protocol      using the Surface Area Configuration Utility &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;[&lt;/span&gt;&lt;a href="http://www.datamasker.com/SSE2005_SCM1.htm"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Link&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;] Make sure the TCP/IP protocol      is enabled in the SQL Server Configuration Utility &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;[&lt;/span&gt;&lt;a href="http://www.datamasker.com/SSE2005_SCM2.htm" title="Start the SQL Server Browser"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Link&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;] Make sure the SQL Server      browser is started. Note this step is optional. It is possible to set the      SQL Server instance to use a fixed IP address - but this is non-standard      for named instances. See &lt;/span&gt;&lt;a href="http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;sqlexpress's WebLog&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; for details. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Make sure SQL Server and SQL Server Browser are      exempted by the firewall on the server machine. This is done by putting &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;sqlservr.exe&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; and &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;sqlbrowser.exe&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; as an exception in the windows firewall. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;      In order to get things to work. You might need to completely reboot the      server machine after making the changes. There have been reports (&lt;i&gt;thanks      P.C.&lt;/i&gt;) that starting and stopping the SQL Server and Browser software      is not enough. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Client software for testing remote connectivity to SQL Server Express 2005&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Need some software to test out remote connectivity to SQL Server Express 2005? Probably there are lots of ways. Here are four to try out: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Download and install the &lt;i&gt;SQL Server Management      Studio Express Community Technical Preview&lt;/i&gt;. SSMSECTP (as it is      affectionately known) is a freebie, upgraded and cut down version of the      SQL Server 2000 management software. Works pretty well for simple      management tasks, has a T-SQL window and, of course, nicely tests out      remote connectivity. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;To install SSMSE you will need the following (note the 2.0 Beta version of the .NET framework is &lt;b&gt;not&lt;/b&gt; acceptable. Uninstall it first if you have it.). It is probably best to install them in the order below &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;displaylang=en"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Microsoft .NET Framework Version 2.0 Redistributable Package &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=993c0bcf-3bcf-4009-be21-27e85e1857b1&amp;amp;displaylang=en"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Microsoft Core XML Services (MSXML) 6.0&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=82AFBD59-57A4-455E-A2D6-1D4C98D40F6E&amp;amp;displaylang=en"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Microsoft SQL Server Management Studio Express - Community Technology Preview (CTP) November 2005&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Or try the &lt;/span&gt;&lt;a href="http://www.datamasker.com/SSE2005_Note2.htm"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;ADO bare bones Connection tip using &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;.udl&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt; files&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;      sent in by Kieran H and Dan P. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Or try the client side &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;osql.exe&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;      utility with the following command line: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;osql -S SERVERNAME\SQLEXPRESS -U &lt;username&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;To use OSQL, start up a Windows command session (&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Start:Run...:cmd&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;) and type in the above command. On our test machine the OSQL binaries are located in the &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;C:\Program Files\Microsoft SQL Server\90\Tools\Binn&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; directory. If you do not have this directory somewhere it probably means you did not install the client side tools. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;So of course now the question is &lt;i&gt;""how to install the OSQL tool (and others) on the client"&lt;/i&gt; Well fortunately it is not too difficult as they are co-located in the same installation package as the SQL Server Express 2005 software. To install them just go back to the same installer you used to create the SQL Server Express 2005 instance on the remote system and run it on your client system. Instead of accepting the default install (which installs the server engine) choose to install only the client side utilities. This will create the above directory and install the tools without installing the database on your client machine. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;For further testing you can also dig around a bit and find out how to use the &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;SQLCMD.exe&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; utility. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Or use the following snippet of C# code. &lt;b&gt;Note:&lt;/b&gt;      If you are using the Visual Studio 2005 environment you might want to read      the page entitled &lt;/span&gt;&lt;a href="http://www.datamasker.com/SSE2005_Note1.htm" title="Using Visual Studio 2005 to Connect to SQL Servers by Name"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; color: blue;"&gt;Using Visual Studio 2005 to Connect to SQL      Servers by Name&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private void button1_Click(object sender, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;System.EventArgs e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;SqlDataReader rdr = null;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// 1. Instantiate the connection&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// test by server name instance name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// SqlConnection conn = new SqlConnection(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;//&lt;span style=""&gt;   &lt;/span&gt;"Data Source=MYSERVERNAME\\SQLEXPRESS; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;//&lt;span style=""&gt;   &lt;/span&gt;Initial Catalog=Northwind; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;//&lt;span style=""&gt;   &lt;/span&gt;User ID=sa; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;//&lt;span style=""&gt;   &lt;/span&gt;Password=sa");&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// test by ip address, port and instance name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;SqlConnection conn = new SqlConnection(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;"Data Source=123.123.123.123,1066;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;Network Library=DBMSSOCN;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;Initial Catalog=Northwind;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;User ID=sa;Password=sa;");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// 2. Open the connection&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;conn.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;         &lt;/span&gt;// 3. Pass the connection to a command object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;SqlCommand cmd = new SqlCommand(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;"select * from Customers", conn);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// 4. Use the connection&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;rdr = cmd.ExecuteReader();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// print the CustomerID of each record&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;while (rdr.Read())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;Console.WriteLine(rdr[0]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// close the reader&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;if (rdr != null)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;rdr.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;// 5. Close the connection&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;if (conn != null)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;conn.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;        &lt;/span&gt;MessageBox.Show("Done", &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;"Done", &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;MessageBoxButtons.OK, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;MessageBoxIcon.Exclamation);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Again it shows errors please consult with the system admin or the network admin that this will due to prohbition made onthe firewall...&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7839837632136915848-2058965542945026247?l=programsolution.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://programsolution.blogspot.com/2008/02/configuring-sql-server-express-2005-for.html</link><author>noreply@blogger.com (Bishar.B.N)</author><thr:total>0</thr:total></item><language>en-us</language><media:rating>adult</media:rating></channel></rss>

