<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3349302965505178934</id><updated>2011-11-27T16:27:03.185-08:00</updated><category term='What is Cookie'/><category term='Make your Business Better'/><category term='inheritance in Asp.net'/><category term='How to use cookie in asp.net'/><category term='generate random number from stored procedure'/><category term='how to use enum values?'/><category term='IT'/><category term='Website payment pro'/><category term='How to display report in crystal'/><category term='How to dynamically change meta tags in ASP.NET and C#'/><category term='Dynamically change Meta Tag in ASP.NET and C#'/><category term='how to use Inheritance'/><category term='generate random number function ms-sql'/><category term='Paypal payment api'/><category term='inheritance'/><category term='Serialization in Asp.Net'/><category term='Direct payment api of paypal'/><category term='Freelancer'/><category term='Cookies in Asp.net'/><category term='X Enumeration in Asp.net'/><category term='generate random number from t-sql'/><category term='Seo - Search engine optimization'/><category term='Market Value'/><category term='Dynamically change Meta Tag using C'/><category term='Information Technology'/><category term='Services'/><category term='Outsourcing'/><category term='source code of paypal payment pro api'/><category term='Reflection in asp.net'/><category term='Search Engine Marketing'/><category term='Exporting GridView to Excel with c#'/><category term='Sql server random password'/><category term='Crystal report in asp.net'/><category term='Serialization in c#'/><category term='How to get enum values'/><category term='Tutorial : Cookies'/><category term='tips and tricks'/><category term='Display report in crystal'/><category term='freelancing career'/><category term='tips and tricks when u resign'/><category term='oops concept'/><category term='Dynamically change Meta Tag using ASP.NET'/><category term='freelancing tips'/><category term='what is Serialization'/><category term='generate random number from trigger'/><category term='ASP.Net 2.0: Export GridView to Excel'/><category term='How to export GridView to Excel'/><category term='SEO'/><category term='C# code for paypal payment pro api'/><category term='10 things you should do when you resign from your company'/><category term='DeSerialization'/><category term='Serialization'/><title type='text'>Ultimate solutions from IT Expert</title><subtitle type='html'>This blog is dedicated to all IT and non-IT guys.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-8507617656741365735</id><published>2008-11-13T00:33:00.000-08:00</published><updated>2008-11-13T00:37:01.114-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips and tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='freelancing tips'/><category scheme='http://www.blogger.com/atom/ns#' term='freelancing career'/><category scheme='http://www.blogger.com/atom/ns#' term='Freelancer'/><title type='text'>Common tips for a freelancer</title><content type='html'>Freelance contractors have become more commonplace than ever before. This article explores five simple ways to protect yourself as a freelance contractor.&lt;br /&gt;&lt;br /&gt;1. &lt;span style="font-weight:bold;"&gt;Never pay someone to give you a freelance contract&lt;/span&gt;: A legitimate freelance contract will not require you to pay money to the employer in order to provide a job or freelance contract. While some internet sites require users to purchase a membership to bid on freelance jobs, the person who awards the freelance job should never charge a fee in order to gain the freelance contract.&lt;br /&gt;&lt;br /&gt;2. &lt;span style="font-weight:bold;"&gt;Create a division between work and home&lt;/span&gt;. It’s helpful to have a designated work space — ideally, an office or studio space outside of your home. If this isn’t possible, a home office with a door you can close is your next best option. Don’t have a room to set aside for an office? Go to your local Pier 1, buy a Chinese screen and section off a corner of a room. Voilà: instant office.&lt;br /&gt;&lt;br /&gt;3. &lt;span style="font-weight:bold;"&gt;Get to work on time&lt;/span&gt;. You’ve cut out the commute, which means you’ve bought yourself a little time. So go ahead and have that extra cup of coffee; but it’s nice for your family, friends, clients and personal sanity if you keep at least relatively normal business hours. &lt;br /&gt;&lt;br /&gt;4. &lt;span style="font-weight:bold;"&gt;Don’t watch TV in the middle of the day&lt;/span&gt;. Or go to the movies or do your laundry. You’re working, so work. However, occasional naps are perfectly acceptable and a great way to remind yourself that while you might not have technical support or a supply closet, your life is still pretty awesome. &lt;br /&gt;&lt;br /&gt;5. &lt;span style="font-weight:bold;"&gt;Do not give employers personal information.&lt;/span&gt;Go to this IRS website and apply for an employer identification number (EIN). This will prevent you from having to provide the freelance employer your social security number. After you have this number, you need not provide the employer with any other information besides your business name and EIN.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;All The Best for your freelancing career.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-8507617656741365735?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/8507617656741365735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=8507617656741365735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8507617656741365735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8507617656741365735'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/11/common-tips-for-freelancer.html' title='Common tips for a freelancer'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-3799969501698569475</id><published>2008-11-03T23:44:00.000-08:00</published><updated>2008-11-03T23:49:33.062-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Outsourcing'/><category scheme='http://www.blogger.com/atom/ns#' term='IT'/><category scheme='http://www.blogger.com/atom/ns#' term='Market Value'/><category scheme='http://www.blogger.com/atom/ns#' term='Information Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Services'/><title type='text'>Outsourcing Information Technology</title><content type='html'>&lt;div class="KonaBody"&gt;The information technology industry has truly transformed the way the world looks at India. Rapidly capturing global imagination, the success of its IT industry has placed India at the forefront of the emerging global knowledge economy. According to the National Association of Software and Service Companies (NASSCOM), the apex body for software services in India, the revenue of the information technology sector has grown from 1.2 per cent of the gross domestic product (GDP) in FY 1998 to an estimated 5.5 per cent in FY 2008. The net value added by this sector, to the economy, is estimated to be 3.3 to 3.9 per cent for FY 2008.&lt;br /&gt;&lt;br /&gt;India's IT growth in the world is primarily dominated by IT software and services such as Custom Application Development and Maintenance (CADM), System Integration, IT Consulting, Application Management, Infrastructure Management Services, Software testing, Service-oriented architecture and Web services.&lt;br /&gt;&lt;br /&gt;The government expects the exports turnover to touch US$ 80 billion by 2011, growing at an annual rate of 30 per cent per annum, from the earlier few million dollars worth exports in early 1990s.&lt;br /&gt;&lt;br /&gt;As per NASSCOM's latest findings:&lt;br /&gt;&lt;br /&gt;    * Indian IT-BPO sector grew by 33 per cent in FY 2008 to reach US$ 64 billion in aggregate revenue (including hardware). Of this, the software and services segment accounted for US$ 52 billion, growing by 28 per cent over FY 2007.&lt;br /&gt;    * Software and services exports (including exports of IT services, BPO, engineering services and R&amp;D and software products) reached US$ 40.4 billion, contributing nearly 63 per cent to the overall IT-BPO revenue aggregate.&lt;br /&gt;    * IT-BPO exports (including hardware exports) grew by 28 per cent from US$ 31.8 billion in FY 2007 to US$ 40.9 billion in FY 2008.&lt;br /&gt;    * While the US (61 per cent) and the UK (18 per cent) remained the largest IT-BPO export markets in FY 2007, the industry is now making a mark in other countries as well - with exports to Continental Europe in particular, growing at a compound annual growth rate (CAGR) of more than 55 per cent over FY 2004-2007.&lt;br /&gt;    * Domestic IT market (including hardware) reached US$ 23.1 billion in FY 2008 as against US$ 16.2 billion in FY 2007, a growth of 43 per cent. Hardware remained the largest segment of the domestic market with a growth rate of 44 per cent in FY 2008. Software and services spending grew by over 41 per cent during the year.&lt;br /&gt;    * The industry's vertical market exposure was well diversified across several mature and emerging sectors. Banking, financial services and insurance (BFSI) remained the largest vertical market for Indian IT-BPO exports, followed by high-technology and telecom. These sectors together accounted for nearly 60 per cent of the Indian IT-BPO exports in FY 2007.&lt;br /&gt;    * Manufacturing, retail, media, healthcare, airlines and transportation, and utilities were the other key segments. &lt;br /&gt;&lt;br /&gt;Moreover, according to a study by Springboard Research, the Indian IT services market is estimated to remain the fastest growing in the Asia-Pacific region with a CAGR of 18.6 per cent.&lt;br /&gt;&lt;br /&gt;Outsourcing&lt;br /&gt;&lt;br /&gt;A research by Gartner forecasts India as the undisputed leader in the outsourcing space in the year 2008. The Outsourcing Service Provider Performance Study 2007, undertaken by sourcing advisory firm Equa Terra, reported that the majority of UK businesses offshore all or parts of their IT functions to India and plan to continue with this strategy as India continued to be the favourite outsourcing destination for businesses in UK in terms of satisfaction.&lt;br /&gt; &lt;!-- Begin BidVertiser code --&gt;&lt;br /&gt;&lt;SCRIPT LANGUAGE="JavaScript1.1" &lt;br /&gt;&lt;br /&gt;SRC="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=174881%26bid=423786" &lt;br /&gt;&lt;br /&gt;type="text/javascript"&gt;&lt;/SCRIPT&gt;&lt;br /&gt;&lt;noscript&gt;&lt;a href="http://www.bidvertiser.com"&gt;make money online&lt;/a&gt;&lt;/noscript&gt;&lt;br /&gt;&lt;!-- End BidVertiser code --&gt; &lt;br /&gt;India's most prized resource is its readily available technical work force. India has the second largest English-speaking scientific professionals in the world, second only to the US. It is estimated that India has over 4 million technical workers, over 1,832 educational institutions and polytechnics, which train more than 67,785 computer software professionals every year. The enormous base of skilled manpower is a major draw for global customers. According to a Gartner study, India remains the undisputed leader in offshore services and tops the list of 30 countries on criteria's such as language, government support, labour pool, infrastructure, educational system, cost, political and economic environment, cultural compatibility, global and legal maturity, and data and intellectual property, security and privacy.&lt;br /&gt; &lt;!-- Begin BidVertiser code --&gt;&lt;br /&gt;&lt;SCRIPT LANGUAGE="JavaScript1.1" &lt;br /&gt;&lt;br /&gt;SRC="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=174881%26bid=423786" &lt;br /&gt;&lt;br /&gt;type="text/javascript"&gt;&lt;/SCRIPT&gt;&lt;br /&gt;&lt;noscript&gt;&lt;a href="http://www.bidvertiser.com"&gt;make money online&lt;/a&gt;&lt;/noscript&gt;&lt;br /&gt;&lt;!-- End BidVertiser code --&gt; &lt;br /&gt;Twenty-nine India-based companies including Tata Consultancy Services, HCL Technologies, Genpact, and WNS Global Services amongst others, have been listed among the best 100 IT service providers in a new survey carried out with a view to assist business heads of major outsourcers identify reliable, innovative and tech-savvy partners.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="www.ibef.org"&gt;IBEF&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-3799969501698569475?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/3799969501698569475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=3799969501698569475' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/3799969501698569475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/3799969501698569475'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/11/outsourcing-information-technology.html' title='Outsourcing Information Technology'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-3013748377814322096</id><published>2008-10-04T00:35:00.000-07:00</published><updated>2008-10-06T06:51:56.666-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Serialization in Asp.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='DeSerialization'/><category scheme='http://www.blogger.com/atom/ns#' term='what is Serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='Serialization in c#'/><title type='text'>Serialization in Asp.Net</title><content type='html'>&lt;div class="KonaBody"&gt;&lt;br /&gt;Serialization, as implemented in the System.Runtime.Serialization namespace, is the process of serializing and deserializing objects so that they can be stored or transferred and then later recreated. Serializing is the process of converting an object into the linear seqence of bytes that can be stored or transferred.Deserializing is the process of converting a previously serialized sequence of bytes into an object.Basically if you want to store an object in a file for later retrieval, you store the output of serialization.The next time you want to read the objects, you call the deserialization methods, and your object is recreated exactly as it had been previosly.&lt;br /&gt;&lt;br /&gt;  &lt;!-- Begin BidVertiser code --&gt;&lt;br /&gt;&lt;SCRIPT LANGUAGE="JavaScript1.1" SRC="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=174881%26bid=423786" type="text/javascript"&gt;&lt;/SCRIPT&gt;&lt;br /&gt;&lt;noscript&gt;&lt;a href="http://www.bidvertiser.com"&gt;make money online&lt;/a&gt;&lt;/noscript&gt;&lt;br /&gt;&lt;!-- End BidVertiser code --&gt; &lt;br /&gt;&lt;br /&gt;How to serialize an Object:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;At a high level, the steps for serializing an object are as follows:&lt;br /&gt;&lt;br /&gt;1.Create a stream object to hold a serializing output.&lt;br /&gt;&lt;br /&gt;2. Create a BinaryFormatter object(located in System.Runtime.Serialization.Formatters.Binary).&lt;br /&gt;&lt;br /&gt;3. Call the BinaryFormatter.Serialize method to serialize the object, and output the result of the stream.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;// C#&lt;br /&gt;&lt;br /&gt;string data=”This must be stored in a file.”;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;// Create file to save the data to&lt;br /&gt;&lt;br /&gt;FileStream fs= new FileStream(”SerializedString.Data”,FileMode.Create);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;// Create a BinaryFormatter object to perform the serialization&lt;br /&gt;&lt;br /&gt;BinaryFormatter bf=new BinaryFormatter();&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;// Use the BinaryFormatter object to serialized the data to the file&lt;br /&gt;&lt;br /&gt;bf.Serialize(fs, data);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;// Close the file&lt;br /&gt;&lt;br /&gt;fs.close();&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-3013748377814322096?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/3013748377814322096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=3013748377814322096' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/3013748377814322096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/3013748377814322096'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/10/serialization-in-aspnet.html' title='Serialization in Asp.Net'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-8789500834616335662</id><published>2008-10-03T04:46:00.000-07:00</published><updated>2008-10-03T04:48:46.085-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to display report in crystal'/><category scheme='http://www.blogger.com/atom/ns#' term='Display report in crystal'/><category scheme='http://www.blogger.com/atom/ns#' term='Crystal report in asp.net'/><title type='text'>Crystal report in Asp.net</title><content type='html'>&lt;div class="KonaBody"&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Basic steps needed to display a simple report in crystal&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step1:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; Create a web application project.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step2:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; Add new item and select crystal report from the template. This adds a new RPT file in your solution explorer.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step3:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; Double click on the RPT file click on Crystal reports field explorer. You should see the field explorer toolbar.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step4:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; Right click on 'Database field’s on the field explorer -&amp;gt;then click on database expert -&amp;gt;Expand create new connection -&amp;gt; Expand OLE DB ADO  -&amp;gt; Select Microsoft OLEDB provider for SQL Server (this depends on what kind of data you want to connect) -&amp;gt; Give the server credentials and Click  finish and done.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step5:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; Right click on 'Database fields' on the field explorer -&amp;gt; then click on the database expert -&amp;gt; Expand the server, database and select table which you want to add to the report. &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step6:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; Expand database fields -&amp;gt; table. Now you can drag and drop the fields on the report.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step7:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; We now need to display the report on the ASPX page. For that we need the 'CrysalReportViewer' control. So we expand the crystal reports section of the toolbar and drag the component on the ASPX page.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt;Step8:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; Now we need to go to code behind and specify the report source. That's it now compile and run the project and you can see your report live in action.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt"&gt;&lt;span style="font-size: 8.5pt; font-family: Verdana;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-8789500834616335662?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/8789500834616335662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=8789500834616335662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8789500834616335662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8789500834616335662'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/10/crystal-report-in-aspnet.html' title='Crystal report in Asp.net'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-6364330286371388528</id><published>2008-09-24T03:26:00.000-07:00</published><updated>2008-09-24T04:37:15.980-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is Cookie'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial : Cookies'/><category scheme='http://www.blogger.com/atom/ns#' term='How to use cookie in asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Cookies in Asp.net'/><title type='text'>Understanding Cookies</title><content type='html'>&lt;div class="KonaBody"&gt;&lt;br /&gt;&lt;P&gt;&lt;h1&gt;Cookies&amp;nbsp;&lt;/h1&gt;&lt;br /&gt;&lt;p&gt;A Cookie is a small text file that the browser creates and stores on the hard drive of your machine. Cookie is just one or more pieces of information stored as text strings. A Web server sends you a cookie and the browser stores it. The browser then returns the cookie to the server the next time the page is referenced. The most common use of a cookie is to store&amp;nbsp;information about the user and&amp;nbsp;preferences&amp;nbsp;the&amp;nbsp;user makes. For example, assume&amp;nbsp;you&amp;nbsp;like DVD's and register with Ebay to participate in&amp;nbsp;online auctions. You are required to fill out a form with your name, credit card details and address.&amp;nbsp;Ebay assigns you an ID, stores your information with that ID in its database on the server, and sends the ID to your browser as a cookie. Your browser stores the ID on your hard disk. The next time you go to&amp;nbsp;Ebay, the ID is sent back to the server. The server looks you up by your ID and customizes the Web page it sends back to you. The page might say, "Cheap rates on your favorite DVD's". &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Creating cookies with ASP.NET is simple and straight forward. The System.Web namespace offers a class called HttpCookie to create cookies. The following code demonstrates the creation of&amp;nbsp;cookies. The code assumes that you have a TextBox,&amp;nbsp;two Buttons and a RadioButtonList control with some items in it on a Web Forms page. Check the live code demo at the bottom of this page for more. &lt;/p&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;TABLE width="100%" border="0"&gt;&lt;br /&gt;  &lt;TBODY&gt;&lt;br /&gt;    &lt;TR&gt;&lt;br /&gt;      &lt;TD&gt;Private Sub Select_Click(ByVal sender As System.Object, ByVal e As_&lt;BR&gt;&lt;br /&gt;        System.EventArgs) Handles Select.Click&lt;BR&gt;&lt;br /&gt;        Dim newCookie As HttpCookie = New HttpCookie("Books")&lt;BR&gt;&lt;br /&gt;        newCookie.Values.Add("Name", TextBox1.Text)&lt;BR&gt;&lt;br /&gt;        newCookie.Values.Add("FavBook", RadioButtonList1.SelectedItem.Text)&lt;BR&gt;&lt;br /&gt;        newCookie.Expires = #12/31/2008#&lt;BR&gt;&lt;br /&gt;        Response.Cookies.Add(newCookie)&lt;BR&gt;&lt;br /&gt;        Label3.Text = "Cookie Created"&lt;BR&gt;&lt;br /&gt;        Select.Visible = False&lt;BR&gt;&lt;br /&gt;        TextBox1.Visible = False&lt;BR&gt;&lt;br /&gt;        Label1.Visible = False&lt;BR&gt;&lt;br /&gt;        Label2.Visible = False&lt;BR&gt;&lt;br /&gt;        RadioButtonList1.Visible = False&lt;BR&gt;&lt;br /&gt;        End Sub &lt;/TD&gt;&lt;br /&gt;    &lt;/TR&gt;&lt;br /&gt;  &lt;/TBODY&gt;&lt;br /&gt;&lt;/TABLE&gt;&lt;br /&gt;&lt;p&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;STRONG&gt;Understanding the Code&lt;/STRONG&gt; &lt;/P&gt;&lt;br /&gt;First, we created a variable called newCookie and an HttpCookie object is instantiated. This object enables us to pass a string when we create it to identify the name that the browser will use to store the cookie. We called it Books.&lt;BR&gt;&lt;br /&gt;  After we created the object, we added information to it using the Values property and the Add method.&lt;BR&gt;&lt;br /&gt;  To ensure that the cookie stays on the user's hard drive for a while we set it's date using the HttpCookie object's Expires property.&lt;BR&gt;&lt;br /&gt;To get this cookie sent back to the browser and stored on the hard drive we used the Response object. &lt;br /&gt;&lt;P&gt;The code listing above&amp;nbsp;creates and stores the cookie on the user's hard drive&amp;nbsp;which is&amp;nbsp;fine. To retrieve them at a later date, what should be done? &lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;STRONG&gt;Retriving the cookie&lt;/STRONG&gt; &lt;/P&gt;&lt;br /&gt;The code below demonstrates how to retrieve a cookie and display information to the user based on&amp;nbsp;his preferences.&amp;nbsp;&lt;P&gt;&lt;br /&gt;&lt;TABLE  width="100%" border="0"&gt;&lt;br /&gt;  &lt;TBODY&gt;&lt;br /&gt;    &lt;TR&gt;&lt;br /&gt;      &lt;TD&gt;Private Sub Retrieve_Click(ByVal sender As System.Object, ByVal e As_&lt;BR&gt;&lt;br /&gt;        System.EventArgs) Handles Retrieve.Click&lt;BR&gt;&lt;br /&gt;        Label3.visible=False &lt;BR&gt;&lt;br /&gt;        Label4.Text = "Hello" &amp;amp;" "&amp;amp; Request.Cookies("Books")("Name") &amp;amp; "."&amp;amp;_&lt;BR&gt;&lt;br /&gt;"We have a new book for you:"&lt;BR&gt;&lt;br /&gt;        If Request.Cookies("Books")("FavBook") = "VB" Then&lt;BR&gt;&lt;br /&gt;        Label5.text="XYZ VB Book"&lt;BR&gt;&lt;br /&gt;        ElseIf Request.Cookies("Books")("FavBook") = "C#" Then&lt;BR&gt;&lt;br /&gt;        Label5.text="ABC C# Book"&lt;BR&gt;&lt;br /&gt;        Else&lt;BR&gt;&lt;br /&gt;        Label5.text="Ultimate Solution "&lt;BR&gt;&lt;br /&gt;        End If&lt;BR&gt;&lt;br /&gt;        End Sub &lt;/TD&gt;&lt;br /&gt;    &lt;/TR&gt;&lt;br /&gt;  &lt;/TBODY&gt;&lt;br /&gt;&lt;/TABLE&gt;&lt;br /&gt;&lt;p&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;STRONG&gt;Understanding the Code&lt;/STRONG&gt; &lt;/P&gt;&lt;br /&gt;&lt;p&gt;First, we used the Request object to retrieve the cookie and display a message to the user.&lt;BR&gt;&lt;br /&gt;    Based on the&amp;nbsp;user's&amp;nbsp;selection first time&amp;nbsp;he accessed the page, we display a&amp;nbsp;new book to him using&amp;nbsp; If..Then..Else conditional.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; The path to the location on the hard drive where cookies are stored is &lt;BR&gt;&lt;br /&gt;    C:\Documents and Settings\Administrator\Cookies. &lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-6364330286371388528?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/6364330286371388528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=6364330286371388528' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/6364330286371388528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/6364330286371388528'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/understanding-cookies.html' title='Understanding Cookies'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-1504418996442592371</id><published>2008-09-22T23:03:00.000-07:00</published><updated>2008-09-22T23:04:13.946-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='how to use enum values?'/><category scheme='http://www.blogger.com/atom/ns#' term='Reflection in asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='How to get enum values'/><category scheme='http://www.blogger.com/atom/ns#' term='X Enumeration in Asp.net'/><title type='text'>Enumeration in Asp.net</title><content type='html'>&lt;div class="KonaBody"&gt; &lt;br /&gt;&lt;p class="MsoNormal"&gt; &lt;span style="font-size: 10pt;font-family:"&gt;How to get Enum values:&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;First of all i will tell you what is Enum in asp.net?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;An Enum is a named constant whose underlying type is any integral type except Char. If no underlying type is explicitly declared, Int32 is used. Programming languages typically provide syntax to declare an enumeration that consists of a set of named constants and their values. &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;Class Enum is derived from class ValueType; that is, Enum is itself a reference type, not a value type. &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;Enum provides methods to compare instances of this class, convert the value of an instance to its string representation, convert the string representation of a number to an instance of this class, and create an instance of a specified enumeration and value. &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;How to declare Enum?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;// Declare the Enumeration&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;public enum MessageSize { &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;Small = 0,&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;Medium = 1,&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;Large = 2&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;} &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;// Create a Field or Property&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;public MessageSize msgsize; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;// Assign to the property using the Enumeration values&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;msgsize = Small; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;How to Use Enum Using MemberInfo?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;do remember to include System.Reflection;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;Here is the Example to get the enum values through memberInfo :&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;MemberInfo[] memberInfos = typeof(MessageSize).GetMembers(BindingFlags.Public | BindingFlags.Static);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;&lt;span&gt; &lt;/span&gt;for (int i = 0; i &amp;lt; memberInfos.Length; i++)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;&lt;span&gt; &lt;/span&gt;ddProperty.Items.Add(new ListItem(memberInfos[i].Name, memberInfos[i].GetType().Name));&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;in the above example i m adding the Values of enum to a DropDown list-ddlProperty.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt;font-family:"&gt;i hope its enough to get the values of enum using MemberInfo(Thanks to Reflection)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-1504418996442592371?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/1504418996442592371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=1504418996442592371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/1504418996442592371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/1504418996442592371'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/enumeration-in-aspnet.html' title='Enumeration in Asp.net'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-1726890390624446322</id><published>2008-09-09T19:44:00.000-07:00</published><updated>2008-09-17T00:03:39.464-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exporting GridView to Excel with c#'/><category scheme='http://www.blogger.com/atom/ns#' term='How to export GridView to Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net 2.0: Export GridView to Excel'/><title type='text'>ASP.Net 2.0: Export GridView to Excel + c#</title><content type='html'>&lt;div class="KonaBody"&gt;  &lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;I faced a problem yesterday where I have to export a gridview content to excel. The problem was as follows :&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;User is genearating some reports –those reports are displaying in&lt;span&gt; &lt;/span&gt;grdviews and he also wants to download these reports into a xls file. So here is the solution-&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;I cerated a class GridViewExportToExcel,there is a method: &lt;/span&gt;&lt;span style="font-size: 10pt;font-family:"&gt;Export which will perform the necessary task.&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt; &lt;span&gt; &lt;/span&gt;GridViewExportToExcel’s code &lt;span&gt; &lt;/span&gt;is given below :-&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;using&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System;&lt;/span&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Data;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Configuration;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.IO;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Web;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Web.Security;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Web.UI;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Web.UI.WebControls;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; System.Web.UI.HtmlControls;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana;color: blue"&gt;public&lt;/span&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: teal"&gt;GridViewExportToExcel&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Export(&lt;span style="color: blue"&gt;string&lt;/span&gt; fileName, &lt;span style="color: teal"&gt;GridView&lt;/span&gt; gv)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;HttpContext&lt;/span&gt;.Current.Response.Clear();&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;//Export will take two parameter first one the name of Excel File, and second one for gridview to be exported&lt;br /&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;HttpContext&lt;/span&gt;.Current.Response.AddHeader(&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: maroon"&gt;"content-disposition"&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: maroon"&gt;"attachment; filename={0}"&lt;/span&gt;, fileName));&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;HttpContext&lt;/span&gt;.Current.Response.ContentType = &lt;span style="color: maroon"&gt;"application/octet-stream"&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: teal"&gt;StringWriter&lt;/span&gt; strWriter = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;StringWriter&lt;/span&gt;())&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: teal"&gt;HtmlTextWriter&lt;/span&gt; htmlWriter = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;HtmlTextWriter&lt;/span&gt;(strWriter))&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;span&gt; &lt;/span&gt;Create a form to contain the grid&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;Table&lt;/span&gt; table = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;Table&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;span&gt; &lt;/span&gt;add the header row to the table&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (gv.HeaderRow != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;GridViewExportToExcel&lt;/span&gt;.ExportControl(gv.HeaderRow);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;table.Rows.Add(gv.HeaderRow);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;span&gt; &lt;/span&gt;add each of the data rows to the table&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: teal"&gt;GridViewRow&lt;/span&gt; row &lt;span style="color: blue"&gt;in&lt;/span&gt; gv.Rows)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;GridViewExportToExcel&lt;/span&gt;.ExportControl(row);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;table.Rows.Add(row);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;span&gt; &lt;/span&gt;add the footer row to the table&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (gv.FooterRow != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;GridViewExportToExcel&lt;/span&gt;.ExportControl(gv.FooterRow);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;table.Rows.Add(gv.FooterRow);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;span&gt; &lt;/span&gt;render the table into the htmlwriter&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;table.RenderControl(htmlWriter);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;span&gt; &lt;/span&gt;render the htmlwriter into the response&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;HttpContext&lt;/span&gt;.Current.Response.Write(strWriter.ToString());&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;HttpContext&lt;/span&gt;.Current.Response.End();&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Replace controls with literals&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ExportControl(&lt;span style="color: teal"&gt;Control&lt;/span&gt; control)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; control.Controls.Count; i++)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;Control&lt;/span&gt; current = control.Controls[i];&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (current &lt;span style="color: blue"&gt;is&lt;/span&gt; &lt;span style="color: teal"&gt;LinkButton&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.Remove(current);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.AddAt(i, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;LiteralControl&lt;/span&gt;((current &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: teal"&gt;LinkButton&lt;/span&gt;).Text));&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (current &lt;span style="color: blue"&gt;is&lt;/span&gt; &lt;span style="color: teal"&gt;ImageButton&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.Remove(current);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.AddAt(i, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;LiteralControl&lt;/span&gt;((current &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: teal"&gt;ImageButton&lt;/span&gt;).AlternateText));&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (current &lt;span style="color: blue"&gt;is&lt;/span&gt; &lt;span style="color: teal"&gt;HyperLink&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.Remove(current);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.AddAt(i, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;LiteralControl&lt;/span&gt;((current &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: teal"&gt;HyperLink&lt;/span&gt;).Text));&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (current &lt;span style="color: blue"&gt;is&lt;/span&gt; &lt;span style="color: teal"&gt;DropDownList&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.Remove(current);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.AddAt(i, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;LiteralControl&lt;/span&gt;((current &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: teal"&gt;DropDownList&lt;/span&gt;).SelectedItem.Text));&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (current &lt;span style="color: blue"&gt;is&lt;/span&gt; &lt;span style="color: teal"&gt;CheckBox&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.Remove(current);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;control.Controls.AddAt(i, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: teal"&gt;LiteralControl&lt;/span&gt;((current &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: teal"&gt;CheckBox&lt;/span&gt;).Checked ? &lt;span style="color: maroon"&gt;"True"&lt;/span&gt; : &lt;span style="color: maroon"&gt;"False"&lt;/span&gt;));&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;//Like that you may convert any control to literals&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (current.HasControls())&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: teal"&gt;GridViewExportToExcel&lt;/span&gt;.ExportControl(current);&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;span&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8.5pt;font-family: Verdana"&gt;&lt;br /&gt;Using the above code you may export any data representation control’s data to Excel.&lt;br /&gt;Leave comments if its help you and your suggestion are also welcome.&lt;br /&gt;Happy Programming….:)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-1726890390624446322?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/1726890390624446322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=1726890390624446322' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/1726890390624446322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/1726890390624446322'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/aspnet-20-export-gridview-to-excel-c.html' title='ASP.Net 2.0: Export GridView to Excel + c#'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-6697891815147099648</id><published>2008-09-08T09:29:00.000-07:00</published><updated>2008-09-16T23:49:20.843-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='inheritance'/><category scheme='http://www.blogger.com/atom/ns#' term='how to use Inheritance'/><category scheme='http://www.blogger.com/atom/ns#' term='inheritance in Asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='oops concept'/><title type='text'>What is inheritance</title><content type='html'>&lt;div class="KonaBody"&gt;  &lt;br /&gt;&lt;h3&gt;What is Inheritance&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;The .NET framework has thousands of classes, and each class has many different methods and properties. Keeping track of all these classes and members would be impossible if the .NET framework were not implemented extremely consistently. For example, every class has a ToString method that performs exactly the same task – converting an instance of the class into a string. Similarly many classes support the same operators, such as comparing two instances of a class for equality. &lt;br /&gt;This consistency is possible because of inheritance and interfaces. Use inheritance to create new classes from existing ones. &lt;br /&gt;&lt;br /&gt;You can easily create a custom exception class by inheriting from System.ApplicationException, as shown below:&lt;br /&gt;&lt;br /&gt;//C#&lt;br /&gt;class DerivedException : System.ApplicationException&lt;br /&gt;{&lt;br /&gt;Public override string Message&lt;br /&gt;{&lt;br /&gt;get { return “An error occurred in the application.”;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You can throw and catch the new exception because the custom class inherits that behavior of its base class, as shown here:&lt;br /&gt;&lt;br /&gt;//C#&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;throw new DerivedException();&lt;br /&gt;}&lt;br /&gt;catch (DerivedException ex)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(“Source: {0},Error: {1}”, ex.Source, ex.Message);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Notice that the custom exception not only supports the throw/catch behavior, but it also includes a Source member (as well as others) inherited from System.ApplicationException.&lt;br /&gt;&lt;br /&gt;Another benefit of inheritance is the ability to use derived classes interchangeably. For example, there are five classes that inherit from the System.Drawing.Brush base class: HatchBrush, LinearGradientBrush, PathGradientBrush, SolidBrush and TextureBrush. The Graphics.DrawRectangle method requires a Brush object as one of its parameters; however, tou will never pass an object of the base Brush class to Graphics.DrawRectangle. Instead, you will pass an object of one of the derived classes. Because they are each derived from the Brush class, the Graphics.DrawRectangle method can accept any of them. Similarly, if you were to create a custom class derived from the Brush class, you could also pass an object of that class to Graphics.DrawRectangle.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-6697891815147099648?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/6697891815147099648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=6697891815147099648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/6697891815147099648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/6697891815147099648'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/what-is-inheritance.html' title='What is inheritance'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-1134391293116705002</id><published>2008-09-07T02:21:00.000-07:00</published><updated>2008-09-16T23:47:38.718-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips and tricks when u resign'/><category scheme='http://www.blogger.com/atom/ns#' term='10 things you should do when you resign from your company'/><title type='text'>10+ things you should do when you resign</title><content type='html'>&lt;div class="KonaBody"&gt;  &lt;br /&gt; Hey guys I found this article on the net : -http://blogs.techrepublic.com.com/10things/?p=326&amp;amp;tag=rbxccnbtr1 &lt;br /&gt;   &lt;br /&gt; I think this could also help you when you want to resign from your company, &lt;strong&gt;BE Professional&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt; #1: Write the resignation letter &lt;/strong&gt; &lt;br /&gt; Even though a resignation letter might not be required, it’s a nice touch, and writing one is the professional thing to do. The letter needn’t be long. All it really need say is that you’re resigning and the date of the resignation. Do you need to give a reason or disclose your new job? It’s up to you, if you’re comfortable with it. In any event, avoid blasting or dumping on your boss or company. Try to find something good to say if you can and end with thanks for the job you’re leaving. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #2: Be clear about your last day, but be flexible if necessary  &lt;/strong&gt;&lt;br /&gt; In that resignation letter, or in your verbal announcement to your boss, be clear about your final date. In particular, avoid giving just a date alone, without more detail. If, for example, you say, “I am resigning on June 1,” what does that mean? Should the boss expect you to be there on June 1, or is your last day really the previous work day, or something else? I recommend an unambiguous statement such as, “I am resigning &lt;em&gt;&lt;span style="font-family: Verdana"&gt;at the close of business&lt;/span&gt;&lt;/em&gt; June 1.” &lt;br /&gt; Be prepared to be flexible about that last day, though, because the boss might want you to finish an assignment, or least your part of an assignment. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #3: Confirm the handling of unused vacation days  &lt;/strong&gt;&lt;br /&gt; Let’s say, using the above example, that you have no time off coming to you — that is, you have no vacation days, no compensatory days, no sick days, or anything else. In that case, your last day really IS your “last day.” Suppose, however, that you have four vacation days remaining, and that June 1 is a Monday. If you’re able to do so, the best action is to make your last official day Friday, June 5, but be clear to your boss that you will be on “vacation” those last four days. &lt;br /&gt; It’s trickier if, at the time you give your two weeks of notice, your boss says, “Forget the two weeks, leave right now.” In this case, the company may not owe you for those two weeks, but rather only for the number of days you worked since your past pay date (assuming the standard practice of paying in arrears — that is, after the work is completed). And if you have unused vacation days or other time off, the company might or might not owe you for that time, depending on your state and whether you have any kind of employment agreement vs. being employed “at will.” &lt;br /&gt; Whatever the policy your company has, it’s better to find it out before making your announcement. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #4: Remove important personal effects prior to your announcement  &lt;/strong&gt;&lt;br /&gt; This point is irrelevant if you actually get to stay until the final date you announce. However, it can be critical if you are told to leave immediately. In that case, you’ll have little time to pack your things and instead will receive them later via the mail. If you have personal items that are really important to you, think about inconspicuously removing them in the days before your announcement. &lt;br /&gt; Just don’t be like the mother who called her son’s school, irate because his towel had been stolen during gym class. When asked to describe the towel, the mother snapped, “It’s white and says ‘Holiday Inn.’” Take only those things that truly are yours. The property of your employer should remain with the employer. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #5: Leave on the best note possible  &lt;/strong&gt;&lt;br /&gt; We can laugh at what Johnny Paycheck says to his boss about the job. Generally, though, it’s better to leave on the best terms possible, with respect to both your boss and your co-workers. Yes, they might have been insufferable and intolerable. On the other hand, you must have learned &lt;em&gt;&lt;span style="font-family: Verdana"&gt;something&lt;/span&gt;&lt;/em&gt; from working with them. Think of that or something else you can thank them for, as long as it doesn’t sound insincere or sarcastic. You can even be frank about it, and say, “Even though we had our moments, I really appreciate learning from you about [topic x].” If nothing else, maybe you can just wish them well. You never know when you might run into them again. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #6: Let your important contacts know  &lt;/strong&gt;&lt;br /&gt; You might have contacts outside your immediate department. Perhaps you were working with clients, suppliers, or co-workers from other departments. Let them know about your departure so they can make appropriate adjustments. In particular, tell them the status of any open items, so that they can follow up themselves. &lt;br /&gt; For example, suppose you’re doing problem resolution and have an open problem ticket from the vendor. Let your contact know those details, as well as who is taking over your responsibilities. The best approach is to have a turnover/transition meeting, where you, your contact, and your replacement all sit down and review those items. &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt; #7: Document your current work  &lt;/strong&gt;&lt;br /&gt; Prepare a document that shows all of your current assignments. In that document, list the names of people you’re working with, major issues, and important future dates. This document will allow someone else to take over your job once you’re gone. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #8: Work diligently until your last day  &lt;/strong&gt;&lt;br /&gt; Don’t be known as a “short timer.” People may think you have no interest in your work because you’re soon leaving. Prove them wrong. You might run into your co-workers again, and the impression you leave with them could be critical in the future. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #9: Double-check on insurance coverage  &lt;/strong&gt;&lt;br /&gt; Make sure you have no gaps in health or disability insurance, particularly if you plan to have unpaid time off between your old and new jobs. Be aware of coverage that may be available to you under the &lt;a href="http://www.dol.gov/dol/topic/health-plans/cobra.htm" target="_blank"&gt;Consolidated Omnibus Budget Reconciliation Act&lt;/a&gt; — COBRA, for short. Under this act, generally speaking, workers who leave a company can continue the health benefits they had from that company (although they may have to start paying for those benefits themselves). Such coverage, if available, can be obtained for certain limited periods of time and is designed to cover workers who make a transition from one job to another. &lt;br /&gt;   &lt;br /&gt;&lt;strong&gt; #10: Adjust your voicemail greeting and (if possible) disable voicemail messaging &lt;/strong&gt;&lt;br /&gt; In the late summer of 2006, a woman from an organization called me and asked whether I could give a talk to one of their departments. Unfortunately, things didn’t work out. A few weeks later, I called to follow up, and left her a voicemail message. After a few days, I didn’t hear back, so I left a second voicemail, and again heard nothing. Two weeks later, I called this woman’s co-worker and was told the woman had left the organization about two weeks before my first call. It gets better: About a year later, I called this woman’s number by accident, and &lt;em&gt;&lt;span style="font-family: Verdana"&gt;still&lt;/span&gt;&lt;/em&gt; heard her voicemail greeting. &lt;br /&gt;Retaining that greeting for so long makes the organization look foolish. More seriously, it leaves open the chance that you will miss important calls. What’s worse, it could be that those messages are non-retrievable even by the voicemail system administrator. So before you leave, re-record your greeting to tell callers that fact. Even better: if your system allows it, also set your extension to “announce only” mode. That is, disable its ability to receive messages. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-1134391293116705002?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/1134391293116705002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=1134391293116705002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/1134391293116705002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/1134391293116705002'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/10-things-you-should-do-when-you-resign.html' title='10+ things you should do when you resign'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-8164325706962867014</id><published>2008-09-07T02:15:00.000-07:00</published><updated>2008-09-16T23:44:42.879-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dynamically change Meta Tag using ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Dynamically change Meta Tag in ASP.NET and C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Dynamically change Meta Tag using C'/><category scheme='http://www.blogger.com/atom/ns#' term='How to dynamically change meta tags in ASP.NET and C#'/><title type='text'>How to dynamically change meta tags when using MasterPage in ASP.NET and C#</title><content type='html'>&lt;div class="KonaBody"&gt;  &lt;br /&gt;Hii Guys,&lt;br /&gt;Someone asked me yesterday that -&lt;br /&gt;How to dynamically change meta tags when using MasterPage in ASP.NET and C#&lt;br /&gt;I hope lots of beginners are searching the solution all over the net but some articles could be difficult to understand to the beginners so try this one:-&lt;br /&gt;If you have lots of dynamic pages instead of static, and you may want to change the Meta Keywords dynamically which is helpful in SEO, here is the solution :&lt;br /&gt;&lt;br /&gt;First of all Provide a id to your Head Tag in Master Page : &lt;br /&gt;&lt;br /&gt;&amp;lt;head runat="server" id ="mainHead"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now in the page where you want to change the Meta tags dynamically add the Following code on the page load event :&lt;br /&gt;&lt;br /&gt;//Find the Head Tag in Master Page&lt;br /&gt;HtmlHead hdMain = (HtmlHead)Page.Master.FindControl("mainHead");&lt;br /&gt;HtmlMeta htmMeta = new HtmlMeta();&lt;br /&gt;htmMeta.Attributes.Add("name","description");&lt;br /&gt;htmMeta.Attributes.Add("content", "This is content");&lt;br /&gt;//Add Meta Tag to Head &lt;br /&gt;&lt;br /&gt;hdMain.Controls.Add(htmMeta);&lt;br /&gt;&lt;br /&gt;//Adding keyword Meta Tag to Head Section&lt;br /&gt;HtmlMeta hm2 = new HtmlMeta();&lt;br /&gt;hm2.Attributes.Add("name", "keywords");&lt;br /&gt;hm2.Attributes.Add("content", "Here you can pass your keywords");&lt;br /&gt;hdMain.Controls.Add(hm2);&lt;br /&gt;&lt;br /&gt;And that’s it now view the page source of your page and you will find the description and keyword tags there.&lt;br /&gt;&lt;br /&gt;Cool huh?&lt;br /&gt;&lt;br /&gt;Happy Programming !!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-8164325706962867014?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/8164325706962867014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=8164325706962867014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8164325706962867014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8164325706962867014'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/how-to-dynamically-change-meta-tags.html' title='How to dynamically change meta tags when using MasterPage in ASP.NET and C#'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-8046266875361813930</id><published>2008-09-07T02:10:00.000-07:00</published><updated>2008-09-17T00:15:42.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='generate random number from t-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='generate random number from trigger'/><category scheme='http://www.blogger.com/atom/ns#' term='Sql server random password'/><category scheme='http://www.blogger.com/atom/ns#' term='generate random number function ms-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='generate random number from stored procedure'/><title type='text'>Generate random number using t-sql</title><content type='html'>&lt;div class="KonaBody"&gt; &lt;br /&gt;you can generate random number from ms-sql using Rand() function but you have to use some trick as well.&lt;br /&gt;&lt;br /&gt;Here i will create a random password between 1000 - 99999 ;&lt;br /&gt;&lt;br /&gt;Check out the code for ms-sql server :&lt;br /&gt;&lt;br /&gt;DECLARE @Password int;&lt;br /&gt;DECLARE @Upper int;&lt;br /&gt;DECLARE @Lower int&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;SET @Lower = 1000;&lt;br /&gt;SET @Upper = 99999&lt;br /&gt;SELECT @Password = Round(((@Upper - @Lower -1) * Rand() + @Lower), 0)&lt;br /&gt;&lt;br /&gt;you can put the above code in stored procedure or in a function.&lt;br /&gt;Leave comment if its useful to you&lt;br /&gt;Happy Programming !!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-8046266875361813930?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/8046266875361813930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=8046266875361813930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8046266875361813930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/8046266875361813930'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/generate-random-number-using-t-sql.html' title='Generate random number using t-sql'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-2779055833330423058</id><published>2008-09-07T02:03:00.000-07:00</published><updated>2008-09-16T23:36:36.977-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Search Engine Marketing'/><category scheme='http://www.blogger.com/atom/ns#' term='Seo - Search engine optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><category scheme='http://www.blogger.com/atom/ns#' term='Make your Business Better'/><title type='text'>SEO - Search Engine Optimization Make your business better</title><content type='html'>&lt;div class="KonaBody"&gt;  &lt;br /&gt;&lt;strong&gt;Search engine optimization&lt;/strong&gt; (&lt;strong&gt;SEO&lt;/strong&gt;) is the process of improving the volume and quality of traffic to a web site from search engines via "natural" ("organic" or "algorithmic") search results for targeted keywords. Usually, the earlier a site is presented in the search results or the higher it "ranks", the more searchers will visit that site. SEO can also target different kinds of search, including image search, local search, and industry-specific vertical search engines.&lt;br /&gt;&lt;br /&gt;As a marketing strategy for increasing a site's relevance, SEO considers how search algorithms work and what people search for. SEO efforts may involve a site's coding, presentation, and structure, as well as fixing problems that could prevent search engine indexing programs from fully spidering a site. Another class of techniques, known as black hat SEO or spamdexing, use methods such as link farms and keyword stuffing that tend to harm search engine user experience. Search engines look for sites that employ these techniques and may remove them from their indices.&lt;br /&gt;&lt;br /&gt;The initialism "SEO" can also refer to "search engine optimizers", terms adopted by an industry of consultants who carry out optimization projects on behalf of clients, and by employees who perform SEO services in-house. Search engine optimizers may offer SEO as a stand-alone service or as a part of a broader marketing campaign. Because effective SEO may require changes to the HTML source code of a site, SEO tactics may be incorporated into web site development and design. The term "search engine friendly" may be used to describe web site designs, menus, content management systems, URLs, and shopping carts that are easy to optimize.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-2779055833330423058?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/2779055833330423058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=2779055833330423058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/2779055833330423058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/2779055833330423058'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/seo-search-engine-optimization-make.html' title='SEO - Search Engine Optimization Make your business better'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3349302965505178934.post-722998895264146707</id><published>2008-09-06T23:50:00.002-07:00</published><updated>2008-09-24T06:20:02.967-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='source code of paypal payment pro api'/><category scheme='http://www.blogger.com/atom/ns#' term='Paypal payment api'/><category scheme='http://www.blogger.com/atom/ns#' term='Website payment pro'/><category scheme='http://www.blogger.com/atom/ns#' term='Direct payment api of paypal'/><category scheme='http://www.blogger.com/atom/ns#' term='C# code for paypal payment pro api'/><title type='text'>Paypal payment pro using c#</title><content type='html'>&lt;form id="cse-search-box" action="http://www.google.co.in/cse" target="_blank"&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;input type="hidden" value="partner-pub-2272315469361049:rhpensdrl64" name="cx"&gt;&lt;br /&gt;&lt;input type="hidden" value="ISO-8859-1" name="ie"&gt;&lt;br /&gt;&lt;input name="q"&gt;&lt;br /&gt;&lt;input type="submit" value="Search" name="sa"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;script src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;div class="KonaBody"&gt; &lt;br /&gt;&lt;p&gt;This article will help you to integrate the &lt;strong&gt;"Website payment pro"&lt;/strong&gt; - &lt;strong&gt;direct payment api using c# .net&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;the code is given below which is self explamentory, but i will also provide you the explaination of this code in coming days.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Happy Programming !!&lt;br /&gt;&lt;br /&gt;Here is the code in c# :-&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&lt;span style="color:#000000;"&gt;using System;&lt;br /&gt;&lt;br /&gt;using System.Data;&lt;br /&gt;&lt;br /&gt;using System.Configuration;&lt;br /&gt;&lt;br /&gt;using System.Collections;&lt;br /&gt;&lt;br /&gt;using System.Web;&lt;br /&gt;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;&lt;br /&gt;using com.paypal.sdk.profiles;&lt;br /&gt;&lt;br /&gt;using com.paypal.sdk.services;&lt;br /&gt;&lt;br /&gt;using com.paypal.sdk.services;&lt;br /&gt;&lt;br /&gt;using log4net;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&lt;span style="color:#000000;"&gt;public partial class PaypalPayment : System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&lt;span style="color:#000000;"&gt;&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;/div&gt;&lt;br /&gt;&lt;div&gt;CallerServices caller = new CallerServices();&lt;/div&gt;&lt;br /&gt;&lt;div&gt;IAPIProfile profile = ProfileFactory.CreateAPIProfile();&lt;/div&gt;&lt;br /&gt;&lt;div&gt;profile.APIUsername ="nitin._1214308341_biz_api1.gmail.com";// "sdk-seller_api1.sdk.com";&lt;/div&gt;&lt;br /&gt;&lt;div&gt;profile.APIPassword ="1214308348";// "12345678";&lt;/div&gt;&lt;br /&gt;&lt;div&gt;profile.Environment ="sandbox";&lt;br /&gt;&lt;br /&gt;profile.Subject ="";&lt;br /&gt;&lt;br /&gt;profile.APISignature ="A5GwH2U8prt9wuPnGmlizZVpeMthAn39AxoXc.I0NyrkrNlL8dUfnjII";&lt;/div&gt;&lt;br /&gt;&lt;div&gt;caller.APIProfile = profile;&lt;br /&gt;&lt;br /&gt;com.paypal.soap.api.DoDirectPaymentRequestDetailsType directPaymentDetails = new com.paypal.soap.api.DoDirectPaymentRequestDetailsType();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Set Credit Card&lt;/div&gt;&lt;br /&gt;&lt;div&gt;com.paypal.soap.api.CreditCardDetailsType cc = new com.paypal.soap.api.CreditCardDetailsType();&lt;br /&gt;&lt;br /&gt;cc.CreditCardType = com.paypal.soap.api.CreditCardTypeType.Visa;&lt;br /&gt;&lt;br /&gt;cc.CreditCardNumber ="4111111111111111";&lt;/div&gt;&lt;br /&gt;&lt;div&gt;cc.ExpMonth=10;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;cc.ExpYear = 2009;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;cc.CVV2 ="123";&lt;br /&gt;&lt;br /&gt;//Set Credit Card.CardOwner&lt;/div&gt;&lt;br /&gt;&lt;div&gt;com.paypal.soap.api.PayerInfoType theCardOwner = new com.paypal.soap.api.PayerInfoType();&lt;br /&gt;&lt;br /&gt;com.paypal.soap.api.PersonNameType thePayerName = new com.paypal.soap.api.PersonNameType();&lt;br /&gt;&lt;br /&gt;thePayerName.FirstName ="John";&lt;br /&gt;&lt;br /&gt;thePayerName.LastName ="Doe";&lt;br /&gt;&lt;br /&gt;theCardOwner.PayerName = thePayerName;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;com.paypal.soap.api.AddressType theAddress = new com.paypal.soap.api.AddressType();&lt;br /&gt;&lt;br /&gt;theAddress.Street1 ="123 Main";&lt;br /&gt;&lt;br /&gt;theAddress.Street2 ="Apt 23";&lt;br /&gt;&lt;br /&gt;theAddress.CityName ="Hill Side";&lt;br /&gt;&lt;br /&gt;theAddress.StateOrProvince ="FL";&lt;br /&gt;&lt;br /&gt;theAddress.PostalCode ="32550";&lt;br /&gt;&lt;br /&gt;theAddress.Country = com.paypal.soap.api.CountryCodeType.US;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;theCardOwner.Address = theAddress;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;cc.CardOwner = theCardOwner;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;directPaymentDetails.CreditCard = cc;&lt;br /&gt;&lt;br /&gt;//Set Order Total&lt;/div&gt;&lt;br /&gt;&lt;div&gt;com.paypal.soap.api.BasicAmountType temp = new com.paypal.soap.api.BasicAmountType();&lt;br /&gt;&lt;br /&gt;com.paypal.soap.api.PaymentDetailsType payDetailType = new com.paypal.soap.api.PaymentDetailsType();&lt;br /&gt;&lt;br /&gt;temp.Value ="118.25";&lt;br /&gt;&lt;br /&gt;temp.currencyID = com.paypal.soap.api.CurrencyCodeType.USD;payDetailType.OrderTotal = temp;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;directPaymentDetails.PaymentDetails = payDetailType;&lt;br /&gt;&lt;br /&gt;//Set IP&lt;/div&gt;&lt;br /&gt;&lt;div&gt;directPaymentDetails.IPAddress ="192.168.200.195";&lt;/div&gt;&lt;br /&gt;&lt;div&gt;//Set Transaction Type&lt;/div&gt;&lt;br /&gt;&lt;div&gt;directPaymentDetails.PaymentAction = com.paypal.soap.api.PaymentActionCodeType.Sale;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Set Request&lt;/div&gt;&lt;br /&gt;&lt;div&gt;com.paypal.soap.api.DoDirectPaymentRequestType request = new com.paypal.soap.api.DoDirectPaymentRequestType();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Set Payment Detail&lt;/div&gt;&lt;br /&gt;&lt;div&gt;request.DoDirectPaymentRequestDetails = directPaymentDetails;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;/p&gt;&lt;br /&gt;&lt;div&gt;request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.CountrySpecified =true;&lt;br /&gt;&lt;br /&gt;com.paypal.soap.api.DoDirectPaymentResponseType response = (com.paypal.soap.api.DoDirectPaymentResponseType)caller.Call("DoDirectPayment"&lt;br /&gt;&lt;br /&gt;, request);&lt;br /&gt;&lt;br /&gt;Response.Write("response=" + response.Ack);&lt;br /&gt;&lt;br /&gt;Response.Write(&lt;br /&gt;&lt;br /&gt;"&amp;lt;BR&amp;gt;response=" + response.Errors[0].LongMessage.ToString() + " - " + response.Errors[0].ErrorCode.ToString());&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3349302965505178934-722998895264146707?l=kaniks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaniks.blogspot.com/feeds/722998895264146707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3349302965505178934&amp;postID=722998895264146707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/722998895264146707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3349302965505178934/posts/default/722998895264146707'/><link rel='alternate' type='text/html' href='http://kaniks.blogspot.com/2008/09/blog-post_06.html' title='Paypal payment pro using c#'/><author><name>Niks</name><uri>http://www.blogger.com/profile/06279222633568012379</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
