tag:blogger.com,1999:blog-90269545616857362672024-02-20T16:29:32.192-08:00Tech Tweets !!Useful Stuffs for asp.net web developersKiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-9026954561685736267.post-41267098921917640392010-01-18T23:55:00.001-08:002010-01-19T00:04:15.169-08:00How to Connect remote SQL Server 2005 database via CC Proxy-googl<div><span style="font-size: x-small;">Most of organizations use proxy server shared internet connection for their internal network. Browsing </span><a href="http://www.dhanashree.com/web-development-services/asp-php-web-development"><span style="color: blue;"><u><span style="font-size: x-small;">websi</span></u></span><span style="color: blue;"><u><span style="font-size: x-small;">t</span></u></span><span style="color: blue;"><u><span style="font-size: x-small;">es</span></u></span></a><span style="font-size: x-small;"> via proxy server requires few settings in browser itself where we set proxy server IP and port to 8080 which is default port, doing so is enough for any 1 to surf internet. But </span><span style="font-size: x-small;">as an SQL server </span><a href="http://www.dhanashree.com/web-development-services/asp-php-web-development/dot-net-web-designing"><span style="color: blue;"><u><span style="font-size: x-small;">database programmers</span></u></span></a><span style="font-size: x-small;">/</span><a href="http://www.dhanashree.com/web-development-services/dedicated-php-dotnet-developer/dedicated-asp-net-developer"><span style="color: blue;"><u><span style="font-size: x-small;">developers</span></u></span></a><span style="font-size: x-small;"> uses SQL server management studio to connect to remote database from their client computers. Problem arises when a </span><a href="http://www.dhanashree.com/web-development-services/dedicated-php-dotnet-developer/dedicated-php-developer"><span style="color: blue;"><u><span style="font-size: x-small;">developer</span></u></span></a><span style="font-size: x-small;"> tries to connect a remote database server through SQL server management studio but CC Proxy won’t allow connecting to database directly even if developer uses all details correctly. </span><br />
<span class="Apple-style-span" style="font-size: small;"><br />
</span><br />
<div style="margin: 0pt;"> <b><span style="font-size: x-small;">Why is SQL server management studio not able to connect a remote database</span></b><b><span style="font-size: x-small;">?</span></b><br />
<br />
</div><br />
<span class="Apple-style-span" style="font-size: small;">A very basic thing about proxy server is that all client computers must have to pass all requests to proxy server IP, requests may be from internet browser Or FTP client Or even if its SQL server management studio.</span><br />
<br />
<div style="margin: 0pt;"><span style="font-size: x-small;">So now if we try to connect a database with original details, proxy server (say proxy server IP </span><span style="font-size: x-small;">is :</span><span style="font-size: x-small;"> 48.152.16.36 ) will not allow connecting to database using original Host name.</span><br />
<br />
</div><br />
<div style="margin: 0pt;"> <span style="font-size: x-small;">Because proxy cannot process any request directly, it must come to Proxy server IP first which is 48.152.16.36 (this is a dummy IP, I have used).</span><br />
<br />
</div><br />
<div style="margin: 0pt;"><b><span style="font-size: x-small;">How to solve the problem</span></b><b><span style="font-size: x-small;">:</span></b><br />
</div><div style="margin: 0pt;"><span class="Apple-style-span" style="font-size: small;"><b><br />
</b></span><br />
</div><div style="margin: 0pt;"> <span style="font-size: x-small;">Solution is simple</span><span style="font-size: x-small;">; we just have to follow 2 steps as described below. Here we will be configuring CC proxy, SQL server management studio & SQL server configuration manager.</span><br />
<br />
</div><br />
<div style="margin: 0pt;"><span class="Apple-style-span" style="font-size: small; font-weight: bold;">Step 1: Client side settings </span><br />
</div><span class="Apple-style-span" style="font-size: small;">Say for example we have following database server details:</span><br />
<br />
<span style="font-size: x-small;">Server </span><span style="font-size: x-small;">name :</span><span style="font-size: x-small;"> hostname</span><br />
<span style="font-size: x-small;">Login </span><span style="font-size: x-small;">ID :</span><span style="font-size: x-small;"> username</span><br />
<span style="font-size: x-small;">Password :</span><span style="font-size: x-small;"> password</span><br />
<span style="font-size: x-small;">Port : 1433 [ SQL server uses 1433 port by default, in case if </span><span style="font-size: x-small;">its</span><span style="font-size: x-small;"> different then we have to do settings in CC proxy accordingly ]</span><br />
<br />
<div style="margin: 0pt;"><span class="Apple-style-span" style="font-size: small;">Traditionally we use above given details directly to connect, if we connect from SSMS (SQL server management studio), it will take user to the screen as shown blow.</span><br />
</div><br />
<div style="margin: 0pt;"> <img alt="" height="311" src="http://docs.google.com/File?id=ddv9h9g_20cph9qfgz_b" style="border: none;" width="420" /><br />
<br />
</div><br />
<div style="margin: 0pt;"><span style="font-size: x-small;">Now in above screen if we use </span><b><span style="font-size: x-small;">Server name</span></b><b><span style="font-size: x-small;">:</span></b><span style="font-size: x-small;"> </span><b><span style="font-size: x-small;">hostname</span></b> <span style="font-size: x-small;">then</span><span style="font-size: x-small;"> proxy will not process the request and SSMS will fail to connect to database server.</span><br />
</div><br />
<span style="font-size: x-small;">So rather than providing </span><b><span style="font-size: x-small;">Server name</span></b><b><span style="font-size: x-small;">:</span></b><span style="font-size: x-small;"> </span><b><span style="font-size: x-small;">hostname</span></b> <span style="font-size: x-small;">we</span><span style="font-size: x-small;"> have to set CC Proxy’s server IP which is </span><b><span style="font-size: x-small;">48.152.16.36</span></b><b><span style="font-size: x-small;">. </span></b><span style="font-size: x-small;">But only this much will not work, because we also need to request CC proxy to a specific port which is not used anywhere else in proxy server. So we will use any port, say we use </span><b><span style="font-size: x-small;">PORT</span></b><b><span style="font-size: x-small;">: </span></b><b><span style="font-size: x-small;">1444 </span></b><span style="font-size: x-small;">instead</span><b><span style="font-size: x-small;"> 1433</span></b><span style="font-size: x-small;"> which is default port in SQL server.</span><br />
<br />
<div style="margin: 0pt;"> <span style="font-size: x-small;">So now in above screen we have to set [</span><b><span style="font-size: x-small;">Server</span></b><b><span style="font-size: x-small;"> name: 48.152.16.36, 1444</span></b><b><span style="font-size: x-small;">] </span></b><span style="font-size: x-small;">by </span><span style="font-size: x-small;">keeping </span><span style="font-size: x-small;">userID</span><span style="font-size: x-small;"> password as it is.</span><br />
<br />
</div><br />
<div style="margin: 0pt;"> <span style="font-size: x-small;">Ok so we are now done with client side settings. But this much will also not work as we have to do few </span><b><span style="font-size: x-small;">port map settings in CC proxy</span></b><span style="font-size: x-small;"> on server as well.</span><br />
<br />
</div><span class="Apple-style-span" style="font-size: small;"><b><br />
</b></span><br />
<div style="margin: 0pt;"><br />
<b><span style="font-size: x-small;">Step </span></b><b><span style="font-size: x-small;">2</span></b><b><span style="font-size: x-small;">: </span></b><b><span style="font-size: x-small;">Proxy server</span></b><b><span style="font-size: x-small;"> side settings </span></b><br />
<br />
</div><br />
<div style="margin: 0pt;"><span style="font-size: x-small;">Setting up above step 1 setting in client machine will now request proxy server with the port </span><b><span style="font-size: x-small;">1444</span></b><span style="font-size: x-small;">. So we have to define a PORT MAP setting in CC proxy for </span><b><span style="font-size: x-small;">port:</span></b> <b><span style="font-size: x-small;">1444</span></b><b><span style="font-size: x-small;">.</span></b><br />
</div><br />
<div style="margin: 0pt;"><span style="font-size: x-small;">Below are the steps to follow for port map settings:</span><br />
<br />
</div><ol type="1"><li><span style="font-size: x-small;">Open CC proxy 6.0</span><br />
</li>
<li><span style="font-size: x-small;">Go to </span><b><span style="font-size: x-small;">OPTIONS</span></b><br />
</li>
<li><span style="font-size: x-small;">Click on</span><b><span style="font-size: x-small;"> port map, </span></b><span style="font-size: x-small;">it will take you to the screen as shown below</span><br />
</li>
</ol><img alt="" height="369" src="http://docs.google.com/File?id=ddv9h9g_21d4vv2tmr_b" style="border: none;" width="475" /><br />
<div style="margin: 0pt 0pt 0pt 72pt;"><br />
</div><div style="margin: 0pt 0pt 0pt 36pt;"> <span style="font-size: x-small;">In above screen set the following:</span><br />
<br />
</div><div style="margin: 0pt 0pt 0pt 36pt;"><span class="Apple-style-span" style="font-size: small;"><br />
</span><br />
</div><div style="margin: 0pt 0pt 0pt 36pt;"><b><span style="font-size: x-small;"> </span></b><b><span style="font-size: x-small;">Dest</span></b> <b><span style="font-size: x-small;">Host :</span></b> <b><span style="font-size: x-small;">hostname</span></b><br />
<br />
</div><div style="margin: 0pt 0pt 0pt 36pt;"><br />
<b><span style="font-size: x-small;"> </span></b><b><span style="font-size: x-small;">Port </span></b><b><span style="font-size: x-small;">type :</span></b><b><span style="font-size: x-small;"> TCP</span></b><br />
<br />
</div><div style="margin: 0pt 0pt 0pt 36pt;"><br />
<b><span style="font-size: x-small;"> </span></b><b><span style="font-size: x-small;">Local </span></b><b><span style="font-size: x-small;">Port :</span></b><b><span style="font-size: x-small;"> 1444</span></b><br />
<br />
</div><div style="margin: 0pt 0pt 0pt 36pt;"><br />
<b><span style="font-size: x-small;"> </span></b><b><span style="font-size: x-small;">Dest</span></b> <b><span style="font-size: x-small;">Port :</span></b><b><span style="font-size: x-small;"> 1433</span></b><br />
<br />
</div><br />
<div style="margin: 0pt 0pt 0pt 36pt;"><span style="font-size: x-small;">Save all above </span><span style="font-size: x-small;">details ,</span><span style="font-size: x-small;"> and we are done.</span><br />
</div><br />
<div style="margin: 0pt;"><span style="font-size: x-small;">After this step all client machines must have to connect to database server using Proxy server IP only with a specific port </span><span style="font-size: x-small;">( in</span><span style="font-size: x-small;"> our case its 1444, however we can use any port but it should not be used anywhere else in proxy server).</span><br />
</div></div>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com0tag:blogger.com,1999:blog-9026954561685736267.post-16870223864305807342010-01-12T05:23:00.001-08:002010-01-12T23:04:12.643-08:00How to: publish a blog article via MS word 2007It always becomes a headache for any blog writers while publishing any article with a rich formatting like a word document, with lots of pictures added inside the blog post.<br />
<br />
For all the bloggers like me who have faced problem of rich formatting while posting an article in blog, so guys here is the easiest way to publish your well formatted articles from MS word 2007 itself , even without going to your Blog's dashboard <span style="font-family: Wingdings;">J</span><br />
<br />
Microsoft word 2007 is providing a great functionality of publishing your fully formatted word document direct to your blog from word 2007 itself. And it's even easier from the traditional way.<br />
<br />
Here are the few steps you have to follow and you are DONE!!<br />
<br />
<br />
<br />
<span style="color: #c0504d; font-size: 16pt; text-decoration: underline;">Creating Blog article in word </span><br />
<br />
<strong>Step 1: CREATING A NEW WORD BLOG POST<br />
</strong><br />
Open MS word 2007, go to menu and select <strong>NEW, <br />
</strong><br />
You will get the screen as shown below. Now choose "<strong>New blog post</strong>" as the RED arrow indicates below.<br />
<br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis15.png" /></a><br />
<br />
<br />
<br />
<br />
<strong>Step 2: WRITING A BLOG POST<br />
</strong><br />
Once you choose new blog post you will find the screen as shown below.<br />
<br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis21.png" /></a><br />
<br />
<br />
Now just like we prepare a word document prepare your full article here, with all formatting and pictures added.<br />
<br />
<br />
<br />
<strong>Step 3: SETTING BLOG POST TITLE<br />
</strong><br />
As shown in below screen shot set your article title at marked place.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis31.png" /></a><br />
</div><br />
<br />
<br />
<br />
<span style="color: #c0504d; font-size: 16pt; text-decoration: underline;">Publishing Blog article to your wordpress blog<br />
</span><br />
<strong>Step 1: REGISTER YOUR BLOG ACCOUNT IN WORD 2007</strong><br />
<b><br />
</b><br />
<strong><span style="font-weight: normal;"><a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis41.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis41.png" /></a></span></strong><br />
<br />
<span style="color: #c0504d; font-size: 16pt; text-decoration: underline;"><br />
</span><br />
As show in above picture, clicking on PUBLISH will ask you to register your existing blog account by using Blog URL and username/password.<br />
<br />
<br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis51.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis51.png" /></a><br />
<span style="color: #c0504d; font-size: 16pt; text-decoration: underline;"><br />
</span><br />
<br />
<br />
<strong>CHOOSE YOUR BLOG PROVIDER as shown below. – I have configured with my wordpress Blog</strong><br />
<span style="color: #c0504d; font-size: x-large;"><span style="font-size: 21px;"><br />
</span></span><br />
<strong><span style="font-weight: normal;"><a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis61.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis61.png" /></a></span></strong><br />
<br />
<br />
Fill out all your blog details as shown below.<br />
<br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis71.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis71.png" /></a><br />
<br />
<br />
After submitting above form MS word will validate the details, after verification it will pop up a success message as given in below screen.<br />
<br />
With above step now your Blog account got registered in MS word 2007.<br />
<span style="color: #c0504d; font-size: x-large;"><span style="font-size: 21px;"><br />
</span></span><br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis81.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis81.png" /></a><br />
<br />
<br />
Next to this step it will again ask for your blog's admin username/password to publish the blog on your original blog account.<br />
<br />
Finally you will get your article posted onto your blog and will get the message as shown below.<br />
<br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis91.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis91.png" /></a><br />
<br />
<br />
<span style="color: #c0504d; font-size: 16pt; text-decoration: underline;">Managing blog accounts and setting article categories in wordpress article<br />
</span><br />
Later on whenever you use word for publishing your blog articles, you will get your account registered and you can manage all your blog accounts as shown below. And also can mark any blog as default.<br />
<br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis101.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis101.png" /></a><br />
<br />
<br />
<strong>INSERT ARTICLE CATEGORIES IN BLOG POST<br />
</strong><br />
Again setting categories for your blog post is been very easy, all you have to do is just click on "<strong>insert category</strong>" button as shown below<br />
<br />
<strong>It will show a full list of all your wordpress blog existing categories in a drop down. <br />
</strong><br />
<strong>You can also type any new category over here if not in list of existing.<br />
</strong><br />
<strong><br />
</strong><br />
<br />
<a href="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis111.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://kirandangar.files.wordpress.com/2010/01/011210_1245_howtopublis111.png" /></a><br />
<br />
<br />
<span style="color: #1d1b11;"><strong>For this article I have given example of WORD PRESS blog, but we can also configure for other blog providers like blogger etc...<br />
</strong></span><br />
<span style="color: #1d1b11;"><strong>!!! ENJOY BLOGGING!!! <span style="font-family: Wingdings;">J</span></strong></span>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com0tag:blogger.com,1999:blog-9026954561685736267.post-14536598762847599202009-12-21T23:56:00.000-08:002010-01-15T01:30:34.812-08:00Custom error tracking library in asp.net using XML & C#<div class="MsoNormal">Being an asp.net developers we develop a web project and get it completed in a months of time as there are many organizations which works on very tight bound timeline for developing web sites Or web application projects. And delivers the project to client in months of time<br />
</div><div class="MsoNormal">While after project delivery if client come up saying that they are facing problems or application is giving errors, that time it always becomes a headache for a developer to test each things even whole project sometimes to find a smaller errors (by means of error here we are not talking about logical errors, we talking about exceptions which mostly responsible for errors in the application), there are many exceptions .net framework fires which we never come to find out while debugging or developing the application. Those exceptions never affect directly to the application but each small exception puts the unnecessary load on the server. <br />
</div><div class="MsoNormal">Here is the solution to track each and every smallest things happening inside your asp.net web application. Which I named as “<b style="mso-bidi-font-weight: normal;">Custom error tracking library</b>”<br />
</div><div class="MsoNormal"><u><span style="font-size: 14pt; line-height: 115%;">Custom error tracking library<o:p></o:p></span></u><br />
</div><div class="MsoNormal" style="tab-stops: 399.0pt;">Very first question will come is that, what is the core concept for this. <br />
</div><div class="MsoNormal">Concept is like we will be maintaining an XML file with a predefined structure which I have built which will contain all the required fields as nodes and subs. Which we call as <b style="mso-bidi-font-weight: normal;">errorlog.xml</b><br />
</div><div class="MsoNormal">There will be a CS library file which will track each and every minor errors/exceptions happens inside the application or .net framework and will put the error details inside the XML file.<br />
</div><div class="MsoNormal">Once we got CS library ready with us we just have to a simple function with 2 overload methods as per requirement in each <b style="mso-bidi-font-weight: normal;">try/catch</b> blocks of the code and also in <b style="mso-bidi-font-weight: normal;"><span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">Application_Error </span></b>event of <b style="mso-bidi-font-weight: normal;">Global.asax</b> file. <br />
</div><div class="MsoNormal"><br />
</div><h3>XML File (<span style="font-weight: normal;">errorlog.xml</span>)</h3><div class="MsoNormal"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">xml</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: red; font-family: 'Courier New'; font-size: 10pt;">version</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">=</span><span style="font-family: 'Courier New'; font-size: 10pt;">"<span style="color: blue;">1.0</span>"<span style="color: blue;"> </span><span style="color: red;">encoding</span><span style="color: blue;">=</span>"<span style="color: blue;">utf-8</span>"<span style="color: blue;">?><o:p></o:p></span></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"><</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">errorlog</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">error</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">datetime</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">datetime<span style="color: blue;"></span><span style="color: maroon;">datetime</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">filename</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">filename<span style="color: blue;"></span><span style="color: maroon;">filename</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">classname</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">classname<span style="color: blue;"></span><span style="color: maroon;">classname</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">methodname</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">methodname<span style="color: blue;"></span><span style="color: maroon;">methodname</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">errormethod</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">errormethod<span style="color: blue;"></span><span style="color: maroon;">errormethod</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">messsage</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">ErrorMessage<span style="color: blue;"></span><span style="color: maroon;">messsage</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">errordetails</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">Details goes here<span style="color: blue;"></span><span style="color: maroon;">errordetails</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">IP</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">IP adress<span style="color: blue;"></span><span style="color: maroon;">IP</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">url</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">URL<span style="color: blue;"></span><span style="color: maroon;">url</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">error</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">error</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">><o:p></o:p></span><br />
</div><div class="MsoNormal"><b style="mso-bidi-font-weight: normal;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"></span></b><b style="mso-bidi-font-weight: normal;"><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">errorlog</span></b><b style="mso-bidi-font-weight: normal;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">><o:p></o:p></span></b><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">Root node of XLM file will be <b style="mso-bidi-font-weight: normal;"><errorlog></errorlog></b> inside root node there will be a sub node <b style="mso-bidi-font-weight: normal;"><error></error></b> which will get duplicated for each error. For each error, library will generate a node will all the below listed details in XML file. Next to last error node. So for each error there will be a seaprate ERROR node.<o:p></o:p><br />
</div><div class="MsoNormal">Each fields of the above XML file is descibed beloe :<o:p></o:p><br />
</div><div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">1.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">Datetime : </b>date and time of the error/exception<b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">2.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">File name : </b>file name where exception or error happens <b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">3.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">Class name : </b>classname in which error occurred <b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">4.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">Methodname : </b>function name where errored<b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">5.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">Errormethod :</b> name of the function which contains error code.<b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">6.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;"> Message : </b>error message/exception message <b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; tab-stops: 40.5pt; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">7.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">Error details: </b>detailed error description which will show whole <b style="mso-bidi-font-weight: normal;">stack trace</b> of the functional execution.<b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">8.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">IP : </b>client IP address <b style="mso-bidi-font-weight: normal;"> <o:p></o:p></b><br />
</div><div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"><b style="mso-bidi-font-weight: normal;">9.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></b><b style="mso-bidi-font-weight: normal;">URL : </b>absolute error ULR <b style="mso-bidi-font-weight: normal;"><o:p></o:p></b><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><br />
</div><h3>CS library </h3><div class="MsoNormal"><br />
</div><div class="MsoNormal">There will be a CS library file where we will write all functionality for error handling and writing errors into XML file.<o:p></o:p><br />
</div><div class="MsoNormal"><b style="mso-bidi-font-weight: normal;">errorHamdler.cs </b>file will<b style="mso-bidi-font-weight: normal;"> </b>have 2 statis methods named<span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"> <b style="mso-bidi-font-weight: normal;">WriteError(), </b></span>there will be 2 overloaded methods for same functions with diff. parameters. <o:p></o:p><br />
</div><div class="MsoNormal"><b style="mso-bidi-font-weight: normal;">CS file will look as given below. We name it as errorHamdler.cs<o:p></o:p></b><br />
</div><h3>errorHandler.cs</h3><div class="MsoNormal"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Collections.Generic;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Text;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Xml;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Reflection;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Diagnostics;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">namespace</span><span style="font-family: 'Courier New'; font-size: 10pt;"> code_center<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: teal;">errorHandler<o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">string</span> _strErrorMessage, _strDetails, _strClassName, _strMethodName;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">DateTime</span> _dtOccuranceTime = <span style="color: blue;">new</span> <span style="color: teal;">DateTime</span>();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> errorHandler()<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> errorHandler(<span style="color: teal;">DateTime</span> time, <span style="color: blue;">string</span> className, <span style="color: blue;">string</span> methodName, <span style="color: blue;">string</span> errorMessage, <span style="color: blue;">string</span> details)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> _dtOccuranceTime = time;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> _strClassName = className;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> _strDetails = details;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> _strErrorMessage = errorMessage;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> _strMethodName = methodName;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">void</span> WriteError(<span style="color: teal;">Exception</span> ex)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> WriteError(ex, <span style="color: maroon;">""</span>);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 12pt;"> <b style="mso-bidi-font-weight: normal;"> <span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">void</span> WriteError(<span style="color: teal;">Exception</span> ex, <span style="color: blue;">string</span> fileName)<o:p></o:p></b></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">XmlDocument</span> doc = <span style="color: blue;">new</span> <span style="color: teal;">XmlDocument</span>();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">string</span> strRootPath = System.Configuration.<span style="color: teal;">ConfigurationManager</span>.AppSettings[<span style="color: maroon;">"logfilepath"</span>].ToString();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">string</span> xmlPath = System.Web.<span style="color: teal;">HttpContext</span>.Current.Server.MapPath(strRootPath);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> doc.Load(@xmlPath);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">XmlNode</span> newXMLNode, oldXMLNode;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> oldXMLNode = doc.ChildNodes[1].ChildNodes[0];<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode = oldXMLNode.CloneNode(<span style="color: blue;">true</span>);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">StackTrace</span> stackTrace = <span style="color: blue;">new</span> <span style="color: teal;">StackTrace</span>();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">StackFrame</span> stackFrame = stackTrace.GetFrame(1);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">MethodBase</span> methodBase = stackFrame.GetMethod();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[0].InnerText = <span style="color: teal;">DateTime</span>.Now.ToString();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[1].InnerText = fileName;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[2].InnerText = methodBase.DeclaringType.FullName;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[3].InnerText = methodBase.Name;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[4].InnerText = ex.TargetSite.Name;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[5].InnerText = ex.Message;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[6].InnerText = ex.StackTrace;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[7].InnerText = System.Web.<span style="color: teal;">HttpContext</span>.Current.Request.UserHostAddress;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> newXMLNode.ChildNodes[8].InnerText = System.Web.<span style="color: teal;">HttpContext</span>.Current.Request.Url.OriginalString;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> doc.ChildNodes[1].AppendChild(newXMLNode);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> doc.Save(@xmlPath);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> doc.RemoveAll();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;">}<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal">In above code there is a line “<span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">string</span><span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"> strRootPath = System.Configuration.<span style="color: teal;">ConfigurationManager</span>.AppSettings[<span style="color: maroon;">"logfilepath"</span>].ToString();</span>”<o:p></o:p><br />
</div><div class="MsoNormal">We need to give XML file path also where we have placed XML file in the project, so just have to add 1 line in web.config file as given below to store actual XML file path, which will be used in abiove functon. <o:p></o:p><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><h3><span style="font-weight: normal;">Code inside</span> web.config </h3><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"><</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">appSettings</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">add</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: red; font-family: 'Courier New'; font-size: 10pt;">key</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">=</span><span style="font-family: 'Courier New'; font-size: 10pt;">"<span style="color: blue;">logfilepath</span>"<span style="color: blue;"> </span><span style="color: red;">value</span><span style="color: blue;">=</span>"<span style="color: blue;">~/errorHandling/errorlog.xml</span>"<span style="color: blue;">/> <o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">appSettings</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span><br />
</div><h1><o:p> </o:p></h1><h1>How to use error handler in application <o:p></o:p></h1><div class="MsoNormal"><br />
</div><div class="MsoNormal">Now everything is ready to be used in real time application. In each <b style="mso-bidi-font-weight: normal;">try/catch </b>block we have to call <br />
</div><div class="MsoNormal"><b style="mso-bidi-font-weight: normal;">Writeerror()</b> function as described below .<br />
</div><div class="MsoNormal"><br />
</div><h3><span style="font-weight: normal;">Code inside</span> Default.aspx.vb </h3><div class="MsoNormal"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">protected</span> <span style="color: blue;">void</span> Page_Load(<span style="color: blue;">object</span> sender, <span style="color: teal;">EventArgs</span> e)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">try<o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: green;">throw new Exception("Custom error"); <o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">catch</span> (<span style="color: teal;">Exception</span> ex)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> Response.Write(ex.Message);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: 'Courier New'; font-size: 10pt;"> code_center.<span style="color: teal;">errorHandler</span>.WriteError(ex, <span style="color: maroon;">"Default.aspx.vb"</span>);<o:p></o:p></span></b><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">Apart from each <b style="mso-bidi-font-weight: normal;">try/catch</b> blocks we will put some code in <b style="mso-bidi-font-weight: normal;">Global.asax </b>file also, as given below.<br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">void</span> Application_Error(<span style="color: blue;">object</span> sender, <span style="color: teal;">EventArgs</span> e)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> code_center.<span style="color: teal;">errorHandler</span>.WriteError(Server.GetLastError().GetBaseException(), <span style="color: maroon;">"Global.asax"</span>);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal">The reason behin putting code in Global.asax file is very important and necessory as there might be many exceptions which occurs at application level and canot be tracable in any <b style="mso-bidi-font-weight: normal;">try/catch</b> blocks in any function or events. So anyerror except try/catch blocks will come in this event (<span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">Application_Error</span>) and will get inserted intoXML file.<o:p></o:p><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">That’s it, we have done with the error handling, and all errors will be tractable from the XML file which is being generated via the error handler.<br />
</div><br/><br />
<a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=3820048" rel="tag">CodeProject</a>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com0tag:blogger.com,1999:blog-9026954561685736267.post-57789914115274896672009-12-21T23:25:00.001-08:002009-12-22T01:16:41.495-08:00Developing custom AD rotator control with multiple Image Mapping using C#.net & XML<span style="color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px;"></span><br />
<div class="entry" style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 1em; padding-top: 0px;"><div class="snap_preview" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="line-height: normal;"><span style="line-height: 25px;"><span style="color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px;"></span></span></span><br />
<div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: #333333; font-family: Verdana, sans-serif; font-size: small;"><span style="font-size: 12px;"><span style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;"></span></span></span><br />
<span style="color: #333333; font-family: Verdana, sans-serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: Verdana, sans-serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: Verdana, sans-serif; font-size: small;"><div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 19.2pt; margin-bottom: 8.4pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Verdana, sans-serif; font-size: small;"><span style="font-size: 12px;"></span></span><br />
<span style="font-family: Verdana, sans-serif; font-size: small;"></span><br />
<span style="font-family: Verdana, sans-serif; font-size: small;"><div class="MsoNoSpacing">We are all familiar with AD rotator control asp.net provides to show rotating/random ads on every page refresh.<o:p></o:p><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">But I found a limitation of this control while I needed to develop functionality where AD banners get changed on every page refresh as well as each banners should have multiple links which navigates to diff. URLs ( multiple image mapping in each AD banners ) <br />
</div><div class="MsoNormal">As this is not possible with AD rotator I have developed a custom asp.net control which provides all this flexibilities with all AD rotator features.<br />
</div><div class="MsoNormal"><b style="mso-bidi-font-weight: normal;">Basic Concept:<o:p></o:p></b><br />
</div><div class="MsoNormal">To make the control easy to use & understand we will be keeping the concept of defining Ads same like AD rotator control using XML file.<br />
</div><div class="MsoNormal">Control will read the Ad banners from the XML file and render all the details with multiple image mappings in the aspx page.<br />
</div><div class="MsoNormal"><b style="mso-bidi-font-weight: normal;">XML file structure: <o:p></o:p></b><br />
</div><div class="MsoNormal">First and foremost step is to finalize the XML file structure that to be used in custom control to render the ads on random bases.<br />
</div><div class="MsoNormal">XML file will look as given in below sample file.<br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNoSpacing"><strong><span style="font-family: Calibri, sans-serif; font-size: 15pt;">bannes.xml<o:p></o:p></span></strong><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">xml</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: red; font-family: 'Courier New'; font-size: 10pt;">version</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">=</span><span style="font-family: 'Courier New'; font-size: 10pt;">"<span style="color: blue;">1.0</span>"<span style="color: blue;"> </span><span style="color: red;">encoding</span><span style="color: blue;">=</span>"<span style="color: blue;">utf-8</span>"<span style="color: blue;"> ?><o:p></o:p></span></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"><</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">banbers</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">banner</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">ImageUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">http://xyz.com/banner1.jpg<span style="color: blue;"></span><span style="color: maroon;">ImageUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">AlternateText</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">Site1 Main<span style="color: blue;"></span><span style="color: maroon;">AlternateText</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">mappings</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">left</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">0<span style="color: blue;"></span><span style="color: maroon;">left</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">top</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">0<span style="color: blue;"></span><span style="color: maroon;">top</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">right</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">50<span style="color: blue;"></span><span style="color: maroon;">right</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">bottom</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">50<span style="color: blue;"></span><span style="color: maroon;">bottom</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">navigateUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">google.com<span style="color: blue;"></span><span style="color: maroon;">navigateUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">mappings</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">banner</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">banner</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">ImageUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">banners/5.jpg<span style="color: blue;"></span><span style="color: maroon;">ImageUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">AlternateText</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">b5<span style="color: blue;"></span><span style="color: maroon;">AlternateText</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">mappings</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">left</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">left</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">top</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">top</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">right</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">right</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">bottom</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">bottom</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">navigateUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">google.com<span style="color: blue;"></span><span style="color: maroon;">navigateUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">left</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">left</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">top</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">top</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">right</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">right</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">bottom</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">bottom</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">navigateUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">google.com<span style="color: blue;"></span><span style="color: maroon;">navigateUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">left</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">left</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">top</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">top</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">right</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">right</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">bottom</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">bottom</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">navigateUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">google.com<span style="color: blue;"></span><span style="color: maroon;">navigateUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">left</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">left</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">top</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">top</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">right</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">right</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">bottom</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">bottom</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">navigateUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">google.com<span style="color: blue;"></span><span style="color: maroon;">navigateUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">left</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">left</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">top</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">top</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">right</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">right</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">bottom</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">10<span style="color: blue;"></span><span style="color: maroon;">bottom</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">navigateUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">google.com<span style="color: blue;"></span><span style="color: maroon;">navigateUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">left</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">left</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">top</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">top</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">right</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">right</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">bottom</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">25<span style="color: blue;"></span><span style="color: maroon;">bottom</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">navigateUrl</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">google.com<span style="color: blue;"></span><span style="color: maroon;">navigateUrl</span><span style="color: blue;">><o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">map</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">> <o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">mappings</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">banner</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">><o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"></span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">banbers</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">><o:p></o:p></span><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNoSpacing">Inside main <b style="mso-bidi-font-weight: normal;">banners</b> TAG there will be multiple banners TAG to be added for each AD banner, <o:p></o:p><br />
</div><div class="MsoNoSpacing">Each banner TAG will have child nodes(attributes) as listed below:<o:p></o:p><br />
</div><div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">1.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Image URL – AD image URL to be specified here <br />
</div><div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">2.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Alternate text – alt attribute for image <br />
</div><div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">3.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Mappings - list of all mappings with relative <b style="mso-bidi-font-weight: normal;">left-right-top-Bottom </b> attributes<br />
</div><div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level2 lfo1; text-indent: -.25in;">a.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Left – left side relative axis <br />
</div><div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level2 lfo1; text-indent: -.25in;">b.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Right – right side relative axis<br />
</div><div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level2 lfo1; text-indent: -.25in;">c.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Top– Top relative axis<br />
</div><div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level2 lfo1; text-indent: -.25in;">d.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Bottom– Bottom relative axis<br />
</div><div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level2 lfo1; text-indent: -.25in;">e.<span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span>Navigate URL – URL to navigate <br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><b style="mso-bidi-font-weight: normal;">Developing Custom Control:<o:p></o:p></b><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing">Now next step is to build a custom asp.net control which will read the above XML structure and renders the data accordingly on ASPX page.<br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><b style="mso-bidi-font-weight: normal;">C# code file will be as given below: <o:p></o:p></b><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><b style="mso-bidi-font-weight: normal;"><span style="font-size: 15pt;">ad-banners.cs</span><o:p></o:p></b><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing">this control will have 1 public property where the XML file path will be given called <br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Collections.Generic;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.ComponentModel;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Text;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Web;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Web.UI;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Web.UI.WebControls;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">using</span><span style="font-family: 'Courier New'; font-size: 10pt;"> System.Xml;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">namespace</span><span style="font-family: 'Courier New'; font-size: 10pt;"> InfoquestLibrary.Controls<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> [<span style="color: teal;">DefaultProperty</span>(<span style="color: maroon;">"Text"</span>)]<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> [<span style="color: teal;">ToolboxData</span>(<span style="color: maroon;">"<{0}:banner runat=server />"</span>)]<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: teal;">banner</span> : System.Web.UI.WebControls.<span style="color: teal;">WebControl<o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">string</span> _strImageURL, _strXMLpath;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> [<span style="color: teal;">Bindable</span>(<span style="color: blue;">true</span>)]<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> [<span style="color: teal;">Category</span>(<span style="color: maroon;">"Appearance"</span>)]<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> [<span style="color: teal;">DefaultValue</span>(<span style="color: maroon;">""</span>)]<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> [<span style="color: teal;">Localizable</span>(<span style="color: blue;">true</span>)]<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">string</span> ImageURL<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">get</span> { <span style="color: blue;">return</span> _strImageURL; }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">set</span> { _strImageURL = <span style="color: blue;">value</span>; }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">string</span> XMLpath<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">get</span> { <span style="color: blue;">return</span> _strXMLpath; }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">set</span> { _strXMLpath = <span style="color: blue;">value</span>; }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> RenderBeginTag(<span style="color: teal;">HtmlTextWriter</span> writer)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> RenderEndTag(<span style="color: teal;">HtmlTextWriter</span> writer)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> RenderContents(<span style="color: teal;">HtmlTextWriter</span> output)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">XmlDocument</span> xDoc = <span style="color: blue;">new</span> <span style="color: teal;">XmlDocument</span>();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">XmlNode</span> xRandomNode;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">bool</span> useMapping = <span style="color: blue;">true</span>;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">int</span> xIntRandomNumber;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">Random</span> r = <span style="color: blue;">new</span> <span style="color: teal;">Random</span>(); <o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> xDoc.Load(System.Web.<span style="color: teal;">HttpContext</span>.Current.Server.MapPath(<span style="color: blue;">this</span>.XMLpath));<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> xIntRandomNumber = r.Next(xDoc.ChildNodes[1].ChildNodes.Count);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> xRandomNode = xDoc.ChildNodes[1].ChildNodes[xIntRandomNumber];<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">if</span> (xRandomNode.ChildNodes[2].Equals(<span style="color: blue;">null</span>))<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> useMapping = <span style="color: blue;">false</span>;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">else<o:p></o:p></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">if</span> (xRandomNode.ChildNodes[2].ChildNodes.Count == 0)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> useMapping = <span style="color: blue;">false</span>;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">if</span> (xRandomNode.HasChildNodes)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">this</span>.ImageURL = xRandomNode.ChildNodes[0].InnerText;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Src, <span style="color: blue;">this</span>.ImageURL);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">if</span> (useMapping)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Usemap, <span style="color: maroon;">"#map"</span> + <span style="color: blue;">this</span>.ID);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Border, <span style="color: maroon;">"none"</span>);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">this</span>.AddAttributesToRender(output);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.RenderBeginTag(<span style="color: teal;">HtmlTextWriterTag</span>.Img);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">if</span> (useMapping)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">int</span> xIntMaps, xIntCounter;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> xIntMaps = xRandomNode.ChildNodes[2].ChildNodes.Count;<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Name, <span style="color: maroon;">"map"</span> + <span style="color: blue;">this</span>.ID);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Id, <span style="color: maroon;">"map"</span> + <span style="color: blue;">this</span>.ID);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">this</span>.AddAttributesToRender(output);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.RenderBeginTag(<span style="color: teal;">HtmlTextWriterTag</span>.Map);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">for</span> (xIntCounter = 0; xIntCounter < xIntMaps; xIntCounter++)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: teal;">XmlNode</span> xMap = xRandomNode.ChildNodes[2].ChildNodes[xIntCounter];<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">if</span> (xMap.HasChildNodes)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Shape, <span style="color: maroon;">"rect"</span>);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Coords, xMap.ChildNodes[0].InnerText + <span style="color: maroon;">","</span> + xMap.ChildNodes[1].InnerText + <span style="color: maroon;">","</span> + xMap.ChildNodes[2].InnerText + <span style="color: maroon;">","</span> + xMap.ChildNodes[3].InnerText);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Href, xMap.ChildNodes[4].InnerText);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Title, <span style="color: maroon;">""</span>);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.AddAttribute(<span style="color: teal;">HtmlTextWriterAttribute</span>.Alt, <span style="color: maroon;">""</span>);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.RenderBeginTag(<span style="color: teal;">HtmlTextWriterTag</span>.Area);<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.RenderEndTag();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> output.RenderEndTag();<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> OnPreRender(<span style="color: teal;">EventArgs</span> e)<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> {<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;"> }<o:p></o:p></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: 'Courier New'; font-size: 10pt;">}<o:p></o:p></span><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><b style="mso-bidi-font-weight: normal;">Using customer control in ASPX page:<o:p></o:p></b><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing">Now we are done with developing customer control with all the required functionality. <br />
</div><div class="MsoNoSpacing">And control now ready for use.<br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;">Registering custom control<o:p></o:p></i></b><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><span style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: yellow; background-image: initial; background-repeat: initial; font-family: 'Courier New'; font-size: 10pt;"></span><o:p></o:p><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><b style="mso-bidi-font-weight: normal;"><i style="mso-bidi-font-style: normal;">Defining Custom control in ASPX page<o:p></o:p></i></b><br />
</div><div class="MsoNoSpacing"><br />
</div><div class="MsoNoSpacing"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"><</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">TCC</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">:</span><span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;">banner</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: red;">ID</span><span style="color: blue;">="ads"</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: red;">XMLpath</span><span style="color: blue;">="~/banner-mapping/bannes.xml"</span> <span style="color: blue;">/><o:p></o:p></span></span><br />
</div></span><br />
</div></span><br />
</div></div></div></div>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com2tag:blogger.com,1999:blog-9026954561685736267.post-8028627511342350722009-12-21T23:21:00.000-08:002009-12-22T01:21:04.526-08:00Import Excel data into SQL Server 2005 table using distributed queries<span style="color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px;"></span><br />
<div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">/*SQL server configuration settings */<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">exec sp_configure<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">sp_configure ’show advanced options’, 1<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">reconfigure<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">exec sp_configure ‘Ad Hoc Distributed Queries’, 1<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">reconfigure<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">/*Excel import into sql table using distributed query*/<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">select * into XLimport from<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">openrowset(‘Microsoft.Jet.OLEDB.4.0′,<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">‘Excel 8.0;Database=C:\Documents and Settings\Administrator\Desktop\filename.xls’<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,[Sheet1$])<br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">select * from XLimport<br />
</div>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com0tag:blogger.com,1999:blog-9026954561685736267.post-53378208296782595692009-12-21T23:11:00.000-08:002009-12-22T01:22:06.999-08:00Storing and Retrieving image in SQL server 2005 & asp.net using large value data type & HTTP handler<span style="color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px;"></span><br />
<div class="entry" style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 1em; padding-top: 0px;"><div class="snap_preview" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">APSX page :</strong><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><form id="”form1″" runat="”server”"></form></div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><div 200px;”=""></div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><asp:image id="”imagebox”" imageurl="”~/sql-image-store/image-handler.ashx”" runat="”server”"></asp:image><br />
</div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></div></div><div id="_mcePaste" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Handler code: </strong>image-handler.ashx<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></strong><br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">using System;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">using System.Web;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">using System.IO;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">using System.Data;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">using System.Data.Sql;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">using System.Data.SqlClient;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">using System.Configuration;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">public class image_handler : IHttpHandler<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">public void ProcessRequest(HttpContext context)<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">string xStrCon = System.Configuration.ConfigurationManager.ConnectionStrings["conStrImage"].ConnectionString;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">SqlConnection xCon = new SqlConnection(xStrCon);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">xCon.Open();<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">SqlCommand xCom = new SqlCommand(“select * from images where”, xCon);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">SqlDataAdapter xAda = new SqlDataAdapter(xCom);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">DataSet ds = new DataSet();<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">xAda.Fill(ds);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">// Image processing starts<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">byte[] bytImage = ReadFile(context.Server.MapPath(“banner.JPG”));<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">xCom.CommandText = “insert into images values(2,’kensington’,@imagedata)”;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">xCom.Parameters.Add(new SqlParameter(“@imagedata”, (object)bytImage));<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">xCon.Close();<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">//Display image from SQL server<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">byte[] imageData = (byte[])ds.Tables[0].Rows[0][2];<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">context.Response.Clear();<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">context.Response.ContentType = “image/JPEG”;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">context.Response.OutputStream.Write(imageData, 0, imageData.Length);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">byte[] ReadFile(string sPath)<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">//Initialize byte array with a null value initially.<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">byte[] data = null;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">//Use FileInfo object to get file size.<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">FileInfo fInfo = new FileInfo(sPath);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">long numBytes = fInfo.Length;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">//Open FileStream to read file<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">FileStream fStream = new FileStream(sPath, FileMode.Open, FileAccess.Read);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">//Use BinaryReader to read file stream into byte array.<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">BinaryReader br = new BinaryReader(fStream);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">//When you use BinaryReader, you need to supply number of bytes to read from file.<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">//In this case we want to read entire file. So supplying total number of bytes.<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">data = br.ReadBytes((int)numBytes);<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">return data;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">public bool IsReusable<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">get<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">return false;<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}<br />
</div><div><br />
</div></div></div>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com0tag:blogger.com,1999:blog-9026954561685736267.post-56065279096251624402009-12-21T23:08:00.000-08:002009-12-22T01:22:20.283-08:00Writing recursive queries in SQL server 2005 using Common table expression (CTE)<span style="color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px;"></span><br />
<div class="entry" style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 1em; padding-top: 0px;"><div class="snap_preview" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">with </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">cte <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>empID<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span>manID<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span>depth<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span>hierarchy<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> <span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">as</span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: grey; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">select </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">e<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>employeeID<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span>e<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>managerID <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span>1 <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span> <span style="color: magenta; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">cast</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>e<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>employeeID <span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">as</span><span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">nvarchar</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: magenta; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">max</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">))</span><span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">as</span> hierarchy</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">from </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">humanresources<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>Employee <span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">as </span>e</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">where </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">managerID <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">is</span> <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">null</span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: green; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">union</span><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">all</span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /></span></span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">select </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">emp<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>employeeID<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span>emp<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>managerID <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span>depth<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">+</span>1 <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">,</span> hierarchy <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">+</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> </span><span style="color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">‘/’</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">+</span><span style="color: magenta; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">cast</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>emp<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>employeeID <span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">as</span><span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> </span><span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">nvarchar</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: magenta; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">max</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">))</span> <span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">as</span> hierarchy</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">from </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">humanresources<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>Employee emp</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: grey; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">inner</span><span style="color: grey; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">join</span> cte</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">on </span><span style="font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">emp<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>managerID<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=</span>cte<span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">.</span>empID</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: grey; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: grey; font-family: 'Courier New'; font-size: 10pt; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /></span><br />
</div><div class="MsoNormal" style="line-height: 1.6em; margin-bottom: 10pt; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">select</span><span style="font-family: 'Courier New'; font-size: 10pt; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> <span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</span><span style="color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> </span><span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">from</span> cte <span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">order </span><span style="color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">by</span> depth</span><br />
</div></div></div>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com0tag:blogger.com,1999:blog-9026954561685736267.post-85017479430967857682009-12-21T21:26:00.001-08:002010-01-12T23:06:15.302-08:00Setting up HTML signature in Outlook 2007<span style="color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px;"></span><br />
<span style="color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19px;"><div class="entry" style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 1em; padding-top: 0px;"><div class="snap_preview" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Step 1:</strong><br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Go to windows explorer and navigate to the below given path:<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">C:\Documents and Settings\Administrator\Application Data\Microsoft\Signatures<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Step 2:</strong><br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Place signature files in the above mentioned folder.<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">And make sure the signature files got copied properly at above mentioned path<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Step 3:</strong><br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Now open outlook 2007, go to …<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Tools > options > mail format > signatures<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">You will be able see the signature in list, now all you have to so is just choose your account and set the signature as default.<br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Step 4:</strong><br />
</div><div style="line-height: 1.6em; margin-bottom: 0.7em; margin-left: 0px; margin-right: 0px; margin-top: 0.7em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></strong>Now every time you compose email, your signature will automatically appear in email.<br />
</div><div><br />
</div></div></div></span>Kiran Dangarhttp://www.blogger.com/profile/16712126550684700468noreply@blogger.com0