<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7636731657540574947</id><updated>2026-10-10T00:43:52.070-07:00</updated><title type='text'>Geeks Of Web - Latest Around the World</title><subtitle type='html'>Latest News, Events, Discoveries and   happening around the globe.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-1480336690204227755</id><published>2014-11-04T01:26:00.000-08:00</published><updated>2014-11-04T01:26:13.648-08:00</updated><title type='text'>Android 5.0 Lollipop is available for public now</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
The long wait has come to end for those of you who eagerly wanted to see android lappypop on there devices. The Android Official Blog has put out a post saying that Android 5.0 Lollipop has started rolling out today. Google has confirmed that Android 5.0 Lollipop would be coming to all the Nexus devices – Nexus 4, Nexus 5 and tablets Nexus 7 (2012 and 2013 editi0ns) and Nexus 10. The Nexus 9 which has launched internationally comes baked in with Lollipop and so will the Google Nexus 6 when it comes out.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://phandroid.s3.amazonaws.com/wp-content/uploads/2014/10/Android-5.0-Lollipop-Bugdroid.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://phandroid.s3.amazonaws.com/wp-content/uploads/2014/10/Android-5.0-Lollipop-Bugdroid.png&quot; height=&quot;194&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
For those of you who already own Nexus devices and can’t wait for the Lollipop update notification can manually check for one.&lt;br /&gt;
&lt;br /&gt;
Just head to Settings&amp;gt;About Phone&amp;gt;System Update&amp;gt;Check Now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are best features announced in the latest Android OS:&lt;br /&gt;
&lt;br /&gt;
1. Pick up where you left off: Similar to Continuity in iOS 8, Lollipop lets you pick up where you left off, so the songs, photos, apps, and even recent searches from one of your Android devices can be immediately accessed across devices.&lt;br /&gt;
&lt;br /&gt;
2. Multiple device compatibility: Lollipop will support devices with different screen sizes including wearables such as smartwatches, TVs and cars. According to Google, it is designed to be flexible, so that it can work on all your devices and customised for your needs.&lt;br /&gt;
&lt;br /&gt;
3. Material Design: In order to maintain a consistent design experience across all Android devices, Lollipop uses the Material Design interface across devices it runs on.With Material Design, elements can dynamically shrink and expand, there’s more white space between elements, and gives a 3D appearance overall. While we are yet to try it out ourselves, Google claims that the new design is more intuitive and transitions between tasks are more fluid.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Updated camera: Lollipop makes it easier to support features like burst mode and fine settings tuning. You’ll be able to capture full resolution frames around 30fps, and shoot in raw formats like YUV and Bayer RAW. There’s also support for UHD 4K video playback, tunneled video for high quality video playback on Android TV and improved streaming. Lollipop adds professional features to control settings for the sensor, lens and flash per individual frame.&lt;br /&gt;
&lt;br /&gt;
5. Battery settings: There’s a new battery-saver feature that extends the life of your device by up to 90 minutes—helpful if you’re far from a power outlet. It’s also easier to manage your power usage. The OS adds a feature which gives the estimated time left before you need to charge and, when it’s charging, it tells you approximately how much time it will need to charge before it’s ready to go.&lt;br /&gt;
&lt;br /&gt;
6. Improved security: Share your device securely with guest user mode, create multiple user accounts to enable friends to log in on your device. In either case, no one will be able to access your private files. There’s Android Smart Lock to secure your phone or tablet by pairing it with a trusted device like your wearable or even your car. Google has enforced the SELinux security module for all apps to give better protection against vulnerabilities and malware.&lt;br /&gt;
&lt;br /&gt;
7. Updated notifications screen: You can now view and respond to messages directly from your lock screen, or hide notifications for sensitive content. Turning on Priority mode through your device’s volume button will allow only certain people and notifications get through.You can also choose to avoid calls from interrupting the game you are playing or the movie you are watching.&lt;br /&gt;
&lt;br /&gt;
8. New Quick Settings: The updated Quick Settings on the notification screen has new handy controls such as flashlight, hotspot, screen rotation and cast screen controls. While these settings were not on older stock-Android devices, they may already be present on other customised Android devices. Similarly, you can manually adjust the brightness for certain conditions, while adaptive brightness will kick in based on ambient lighting.&lt;br /&gt;
&lt;br /&gt;
9. Smoother experience: Google uses a new runtime on Android (called ART), which claims to improve app performance, battery life and responsiveness. Google claims that the new OS improves Android’s performance by four times. It compacts background apps and services so you can do more at once. There’s also support for 64-bit chips now.&lt;br /&gt;
&lt;br /&gt;
10. Tap and Go: Tap and Go for NFC devices lets you set up your new Android phone or tablet instantly by simply tapping it to your old one. Whenever you get a new Android phone or tablet, you can sync your apps from Google Play automatically from any of your old Android devices.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/1480336690204227755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/1480336690204227755' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/1480336690204227755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/1480336690204227755'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2014/11/android-50-lollipop-is-available-for.html' title='Android 5.0 Lollipop is available for public now'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-2254973574127901877</id><published>2014-10-27T07:18:00.000-07:00</published><updated>2014-10-27T07:18:06.867-07:00</updated><title type='text'>Future of a Software Engineer ? </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The Big Question on My Mind nowadays is &#39;What is the future of a &amp;nbsp;Software Engineer ?&#39;&lt;br /&gt;
&lt;br /&gt;
His career starts at 22, if he is placed immediately after college or he gets a job in off campus campaigns. By the time he reaches 35, he has to plan for his future. But is there future for a software engineer after 35 in his own sector. Every one cannot become a CEO or reach a manager level and continue to work for 20 to 25 years and then retire as it happens in many government or other management related jobs.&lt;br /&gt;
&lt;br /&gt;
Software Engineer was a most wanted person in all the matrimony websites few years back. Now people are slowly moving towards grooms in other sectors like government sector.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So is this downfall of software jobs or people are no more interested to give their daughters to software engineers because of the insecurity in there jobs.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Well that is one of the reason which is considered by most of the people but the fact is that IT people are still highly paid employees and have good chances of settling abroad.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/2254973574127901877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/2254973574127901877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2254973574127901877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2254973574127901877'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2014/10/future-of-software-engineer.html' title='Future of a Software Engineer ? '/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-5356003510924907186</id><published>2011-08-10T09:55:00.000-07:00</published><updated>2011-08-10T09:58:25.110-07:00</updated><title type='text'>Agile Software Development Methodology</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
Agile is software development methodology. It is very effective where Client frequently changes his&lt;br /&gt;requirement.Since it has more iteration so you can assure a solution that meets clients requirement.&lt;br /&gt;More than one build deployment for a project.It involves more client interaction and testing effort.&lt;br /&gt;&lt;br /&gt;There are two methods by which this methodology can be implemented:-&lt;br /&gt;&lt;br /&gt;1) Scrum: Each iteration would called a scrum which can be a 1-2 Months.In Scrum Client prioritize &lt;br /&gt;his requirements what he want first. If developer did not meets all the requirement which was being fixed for a particular scrum than rest of the development part would be transferred to the next scrum (would be delivered in the next build),&amp;nbsp; means developer can&#39;t increase time decided for a scrum. &lt;br /&gt;&lt;br /&gt;2) Extreme Programming (XP): here iteration period would be less then in scrum , which is being 2-4 &lt;br /&gt;weeks.Here developer prioritize what to do first on the basis of client requirement. This duration which&lt;br /&gt;was being fixed for a iteration, can be increase if the some development part is still pending. The build would deployed with having all the client needs.Thus iteration period is not fixed here it can be increase.but iteration should meets all the client&#39;s requirement in this build.More attention is required for testing in XP.&lt;br /&gt;&lt;br /&gt;It is a methodology to satisfy the customer through early and continuous delivery of valuable software. This is useful when we don&#39;t have a clear idea of the client&#39;s requirements.The development activities can be carried out using the iterative actions.&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;br /&gt;The following table enumerates the reasons for choosing Agile methodology over the Waterfall method.&lt;br /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
1) Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.&amp;nbsp; The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical program, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.&amp;nbsp; With Agile, changes can be made if necessary without getting the entire program rewritten.&amp;nbsp; This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;&lt;br /&gt;2) Another Agile method advantage is one has a launch-able product at the end of each tested stage.&amp;nbsp; This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.&amp;nbsp; This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
3) Agile’s modular nature means employing better suited object-oriented designs and programs, which means one always has a working model for timely release even when it does not always entirely match customer specifications.&amp;nbsp; Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
4) Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.&amp;nbsp; As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
5) However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.&amp;nbsp; As for Agile, each coding module can be delegated to separate groups.&amp;nbsp; This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/5356003510924907186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/5356003510924907186' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/5356003510924907186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/5356003510924907186'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/08/agile-software-development-methodology.html' title='Agile Software Development Methodology'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-8011205675690663119</id><published>2011-08-10T09:40:00.000-07:00</published><updated>2011-08-10T09:40:10.724-07:00</updated><title type='text'>NUnit - A Unit Testing Framework for .Net Applications</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;u&gt;&lt;b&gt;What is NUnit&amp;nbsp;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
NUnit is an open-source unit-testing tool built for .NET, which follows 
in a long line of similar xUnit testing tools built for other platforms.
 It provides an easy-to-use framework for writing and running unit tests
 for your .NET applications. NUnit is an automated unit testing framework for .NET. NUnit is free to use with your .NET projects. NUnit is ported from another product called JUnit, which is a unit testing framework for Java applications. NUnit provides a class library which includes some classes and methods to help you write test scripts. NUnit
 provides graphical user interface application to execute all the test 
scripts and show the result as a success/failure report (instead of 
message boxes from the test script). NUnit is the most popular unit testing framework for .net applications. NUnit
 does not create any test scripts by itself. You have to write test 
scripts by yourself, but NUnit allows you to use it&#39;s tools and classes 
to make the unit testing easier.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 class=&quot;dtH1&quot;&gt;
Test Driven Development&lt;/h2&gt;
&lt;h3 class=&quot;dtH1&quot;&gt;
Improved Productivity&lt;/h3&gt;
A key principle of TDD is that developers are most productive when 
they are in the process of fixing a bug in an application (note: not 
looking for the bug). This is one of the few times during development 
that measurable progress is being made on the project. While developers 
spend time on other things, like finding bugs, they aren&#39;t able to spend
 as much time writing code to correct defects (for example, fixing 
bugs). A key benefit of test driven development (TDD) is to maximize the
 time developers spend in bug-fix mode, thus maximizing their 
productivity.&lt;br /&gt;


&lt;h3 class=&quot;dtH1&quot;&gt;
Improved Quality&lt;/h3&gt;
In TDD, all non-trivial features of an application are tested. These 
tests are written before the actual code is written, and they are run 
all the time. Whenever a test fails, the developer immediately corrects 
the failure. So, when the time comes to add new functionality, the 
developer assumes the functionality exists and writes a test. He then 
runs the tests (which often won&#39;t even compile if they rely on 
as-yet-undefined classes and methods), and when they fail, he enters 
bug-fix mode and begins adding code to the application until he can get 
all tests to pass once more. Often, the process of writing the test for 
the functionality will provide the developer with a better understanding
 of how the production code should be designed, resulting in improved 
final code quality.&lt;br /&gt;


TDD also makes code easier to maintain, upgrade, and redesign, and 
has other benefits which the reader is encouraged to research.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 class=&quot;dtH1&quot;&gt;
NUnit: A Test Framework for .NET &lt;/h2&gt;
NUnit provides a simple way for developers to write unit tests of the
 .NET classes, and comes with a small, sample application that 
demonstrates its use. The current version is written in C# and relies on
 attributes rather than inheritance and/or naming conventions to define 
tests and test suites. The main attributes involved are &lt;strong&gt;TestFixture&lt;/strong&gt;, which applies to a class containing tests, &lt;strong&gt;SetUp&lt;/strong&gt; and &lt;strong&gt;TearDown&lt;/strong&gt;, which are run before and after each test, and &lt;strong&gt;Test&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;


NUnit also provides a simple graphical user interface that lets you 
select which assembly you want to test and which set of tests within 
that assembly you want to run. It then runs all of the tests in the 
assembly (or namespace or class) selected, displaying a green bar if 
everything passes and a red bar if any tests failed. Details of each 
failed test are also displayed, making it very easy to locate the cause 
of the failure.&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;fig&quot;&gt;
&lt;img alt=&quot;Aa479010.aspnet-testwithnunit-01(en-us,MSDN.10).gif&quot; id=&quot;aspnet-testwithnunit-01&quot; src=&quot;http://i.msdn.microsoft.com/dynimg/IC122057.gif&quot; title=&quot;Aa479010.aspnet-testwithnunit-01(en-us,MSDN.10).gif&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;label&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;label&quot;&gt;
&lt;strong&gt;Figure 1. NUnit&#39;s GUI tool provides instant 
feedback that everything is running as it should be, according to the 
tests defined so far.&lt;/strong&gt;&lt;/div&gt;
&lt;div class=&quot;label&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;fig&quot;&gt;
&lt;img alt=&quot;Aa479010.aspnet-testwithnunit-02(en-us,MSDN.10).gif&quot; id=&quot;aspnet-testwithnunit-02&quot; src=&quot;http://i.msdn.microsoft.com/dynimg/IC76846.gif&quot; title=&quot;Aa479010.aspnet-testwithnunit-02(en-us,MSDN.10).gif&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;label&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;label&quot;&gt;
&lt;strong&gt;Figure 2. NUnit shows the details of a failure caused by an invalid connection string.&lt;/strong&gt;&lt;/div&gt;
&lt;div class=&quot;label&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
There are other testing tools coming to market for .NET, but today 
NUnit has the largest support base, and is both free and open source, 
making it something you may want to try first.&lt;br /&gt;


&lt;h2 class=&quot;dtH1&quot;&gt;
Related Tools&lt;/h2&gt;
&lt;h3 class=&quot;dtH1&quot;&gt;
NUnit Visual Studio .NET Addin&lt;/h3&gt;
This addin, which requires NUnit, allows you to run your tests 
without leaving the Visual Studio .NET IDE. Simply right-click on a 
project or solution in the Solution Explorer to run all tests within 
that project or solution. The results are displayed in the Output 
window. Unfortunately, there are no pretty green or red bars, but if 
having one less program open is important to you, this can be a useful 
tool.&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;fig&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;fig&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;fig&quot;&gt;
&lt;img alt=&quot;Aa479010.aspnet-testwithnunit-03(en-us,MSDN.10).gif&quot; id=&quot;aspnet-testwithnunit-03&quot; src=&quot;http://i.msdn.microsoft.com/dynimg/IC63564.gif&quot; title=&quot;Aa479010.aspnet-testwithnunit-03(en-us,MSDN.10).gif&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;Figure 3. Run tests in Visual Studio .NET with a simple right-click.&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;fig&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;fig&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;fig&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;fig&quot;&gt;
&lt;img alt=&quot;Aa479010.aspnet-testwithnunit-04(en-us,MSDN.10).gif&quot; id=&quot;aspnet-testwithnunit-04&quot; src=&quot;http://i.msdn.microsoft.com/dynimg/IC152758.gif&quot; title=&quot;Aa479010.aspnet-testwithnunit-04(en-us,MSDN.10).gif&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;Figure 4. Output from NUnit tests run within Visual Studio .NET&lt;/strong&gt;&lt;br /&gt;


&lt;h3 class=&quot;dtH1&quot;&gt;
NUnitASP&lt;/h3&gt;
NUnitASP allows TDD to be extended to the user interface in ASP.NET, 
by providing a means of testing Web controls. Its usage is beyond the 
scope of this article, but you may learn more about it from the &lt;a href=&quot;http://nunitasp.sourceforge.net/&quot;&gt;NUnitASP&lt;/a&gt; Web site.&lt;br /&gt;


&lt;h2 class=&quot;dtH1&quot;&gt;
A Simple Application&lt;/h2&gt;
To demonstrate TDD, I&#39;ve used it to help me redevelop a multi-tier 
sample application for ASP.NET. The application demonstrates how to 
register a user for an application, how to grant them access to secure 
web pages, and how to allow them to sign in and sign out. The data 
access layer for this application is concerned with adding users to the 
database, retrieving user information, and verifying that user logins 
are correct. I’ve used this sample for a couple of years now and built 
it with TDD several times, learning new things with each iteration. &lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/8011205675690663119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/8011205675690663119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8011205675690663119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8011205675690663119'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/08/nunit-unit-testing-framework-for-net.html' title='NUnit - A Unit Testing Framework for .Net Applications'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-2555391244415593786</id><published>2011-08-10T09:21:00.000-07:00</published><updated>2011-08-10T09:21:41.808-07:00</updated><title type='text'>Windows Workflow Foundation?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;


What is &lt;span class=&quot;search-highlight&quot;&gt;Windows&lt;/span&gt; &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; &lt;span class=&quot;search-highlight&quot;&gt;Foundation&lt;/span&gt;?&lt;/h3&gt;
WWF is a programming model for building &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt;-enabled applications on &lt;span class=&quot;search-highlight&quot;&gt;windows&lt;/span&gt;. System. &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; namespace has all the necessary modules to develop any type of &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt;.&lt;br /&gt;
&lt;h3&gt;


What is a &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt;?&lt;/h3&gt;
A &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; is a set of 
activities, which is stored as model and they depict a process. Below 
figure depicts clearly the difference between &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; and Activity. Every task is an activity and group of activity depicts a complete &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt;. &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; is run by the &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; runtime engine.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjX7PlP8jbxNnmrfKpmBx1cqWLrcslrE4WEj5e7RxG_1JWYQKswXBj-MXD841WZ22NANWDXyRgKQ6BPlv2GTxyfBP8TUwa2ZfcshL4kL3kz7eN_dyyZUT8HrFW1ASl84dBpqGZR9f4Nqu/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjX7PlP8jbxNnmrfKpmBx1cqWLrcslrE4WEj5e7RxG_1JWYQKswXBj-MXD841WZ22NANWDXyRgKQ6BPlv2GTxyfBP8TUwa2ZfcshL4kL3kz7eN_dyyZUT8HrFW1ASl84dBpqGZR9f4Nqu/s320/1.JPG&quot; width=&quot;311&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3&gt;
What are different types of &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; in &lt;span class=&quot;search-highlight&quot;&gt;Windows&lt;/span&gt; &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; &lt;span class=&quot;search-highlight&quot;&gt;foundation&lt;/span&gt;?&lt;/h3&gt;
There are two basics type of &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt; Sequential &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; and State machines &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt;.&lt;br /&gt;A sequential &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt; has clear start and finish boundaries. &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt; controls execution in Sequential &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt;. In sequential execution, one task is executed after other. Sequential &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt; is more rigid in format and execution path has a deterministic nature.&lt;br /&gt;
&lt;br /&gt;A State machine &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt; is more dynamic in nature. &lt;span class=&quot;search-highlight&quot;&gt;Workflow&lt;/span&gt;
 has states and the state waits for events to help it move to next 
state. In State machine execution path is undeterministic nature.&lt;br /&gt;Below figure shows visual conceptualization of fundamentals. You can see in Sequential &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt;
 the execution path is very determent. Shiv performs the entire task 
sequentially and these tasks are very determent. Now have a look at the 
second &lt;span class=&quot;search-highlight&quot;&gt;workflow&lt;/span&gt;. Every state goes 
to other state when it receives some external events. For instance when 
Shiv is seeing star trek there is an event of flashing news which 
triggers him to see the flashing new.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6RK50w2zNS2zbm-chCm7P4Ekz4yltzsaGaJVSGcn4dbk8N8r1XZZIrCd1wy1S5UeADUwy5POlKP7B4ShNWG4IswiExhO1AIB8DKjCXNp_PcvXcenfgCEGW9Mp_bi_JYzJZ9KZJfpLsL_B/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6RK50w2zNS2zbm-chCm7P4Ekz4yltzsaGaJVSGcn4dbk8N8r1XZZIrCd1wy1S5UeADUwy5POlKP7B4ShNWG4IswiExhO1AIB8DKjCXNp_PcvXcenfgCEGW9Mp_bi_JYzJZ9KZJfpLsL_B/s1600/2.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/2555391244415593786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/2555391244415593786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2555391244415593786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2555391244415593786'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/08/windows-workflow-foundation.html' title='Windows Workflow Foundation?'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTjX7PlP8jbxNnmrfKpmBx1cqWLrcslrE4WEj5e7RxG_1JWYQKswXBj-MXD841WZ22NANWDXyRgKQ6BPlv2GTxyfBP8TUwa2ZfcshL4kL3kz7eN_dyyZUT8HrFW1ASl84dBpqGZR9f4Nqu/s72-c/1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-7739998009926391973</id><published>2011-08-01T03:11:00.000-07:00</published><updated>2011-08-01T03:11:31.270-07:00</updated><title type='text'>Ajax Minifier reduces the size of javascript and css files</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;Ajax
 Minifier is a Microsoft program which mifys js and css files. 
Minification is the process of reducing the size of a CSS or JS file by 
removing whitespaces, comments and other optimization. This is a free 
tool and it can be used in command line or MSBuild tasks.&lt;br /&gt; &lt;br /&gt;The 
idea behind this tool is to improve the load time whenever the site is 
requested. Most of the times, about 70-90% of time spent waiting for a 
page on the average web site is actually due to the number of HTTP 
requests for images, JS and CSS files. To improve this, we can use this 
tool and it minify&#39;s the css, js files so that the download time will be
 considerably lesser than the actual file.&lt;br /&gt;&lt;br /&gt;So whenever you 
trigger a new build from visual studio its going to execute a build and 
before moving that build to deployment server its going to execute this 
build task to minify and combine the css and javascript files in your 
site as mentioned by you in the target folder. After combining, its 
going to creat a single javascript and a single css file for entire site
 and name it with this version of build.&lt;br /&gt;&lt;br /&gt;When the user requests 
for your site on the next time the name of previous js file and this js 
file is going to be different because of this version number change and 
the browser is going to download it to local cahe, so for subsequent 
requests it will use it from the cache. This is how it makes the site 
very faster.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/7739998009926391973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/7739998009926391973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/7739998009926391973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/7739998009926391973'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/08/ajax-minifier-reduces-size-of.html' title='Ajax Minifier reduces the size of javascript and css files'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-2674627922138483305</id><published>2011-08-01T03:03:00.000-07:00</published><updated>2011-08-01T03:03:55.666-07:00</updated><title type='text'>Ranking Functions in Sql Server 2008</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;There are four ranking functions in sql server. They are Row_Number(), Rank(), Dense_Rank(), Ntile().&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
Row_Number()&lt;/h3&gt;
Row_Number
 function gives the sequential order of numbers starting from 1 for the 
specified row. This function is used to split the table based on this 
row number.&lt;br /&gt;
&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;select *, ROW_NUMBER() over(partition by part order by value) AS Partition
from Ranker&lt;/pre&gt;
&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
Rank()&lt;/h3&gt;
Rank() function consider the 
repeating values in the column. If two values are same in the column 
means both values are given the same rank and the next value gets the 
respected rank.&lt;br /&gt;&lt;h3&gt;
Dense_Rank()&lt;/h3&gt;
Dense_Rank() is as same 
as rank function the only difference is the next value to the repeating 
value should take the rank in sequence order.&lt;br /&gt;&lt;h3&gt;
Ntile()&lt;/h3&gt;
Ntile() function is different from others. It splits the table based on the given range and rank the number for the partitions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;create table Ranker(value int)

Insert into Ranker values(8),(1),(6),(2),(3),(6),(4),(5),(8),(9),(3),(7)

select *,
	ROW_NUMBER() over(order by value) AS Row_No,
	RANK() over(order by value) AS Rank ,
	DENSE_RANK() over(order by value) AS Dense_Rank,
	NTILE(4) over(order by value) AS Ntile
from Ranker&amp;nbsp;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;&lt;b&gt;Value	Row_No	Rank	D_Rank	Ntile&lt;/b&gt;&lt;/pre&gt;
&lt;pre&gt;
1	1	1	1	1
2	2	2	2	1
3	3	3	3	1
3	4	3	3	2
4	5	5	4	2
5	6	6	5	2
6	7	7	6	3
6	8	7	6	3
7	9	9	7	3
8	10	10	8	4
8	11	10	8	4
9	12	12	9	4&lt;/pre&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/pre&gt;
&lt;span id=&quot;ContentPlaceHolder1_lblDescription&quot;&gt;&lt;span itemprop=&quot;articleBody&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/2674627922138483305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/2674627922138483305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2674627922138483305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2674627922138483305'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/08/ranking-functions-in-sql-server-2008.html' title='Ranking Functions in Sql Server 2008'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-6306685116442242328</id><published>2011-03-20T23:38:00.000-07:00</published><updated>2011-03-20T23:39:26.353-07:00</updated><title type='text'>Configure Secure Socket Layer (SSL) in IIS 7 or IIS 7.5 in Windows 7</title><content type='html'>&lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;HTTPS is a secure  communications channel that is used to exchange sensitive information  like User Credentials, Credit Card details etc. between a client  computer and a server. It uses SSL which encrypts communication over a  network like the internet. &lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;In this article, we  will see how to configure Secure Socket Layer (SSL) in IIS 7.x in a  Windows 7 machine. To enable SSL in IIS, you must first obtain a  certificate that is used to encrypt and decrypt the information  transferred over a network. &lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;I assume you have  configured IIS 7 on your Windows 7 box and have ASP.NET registered on  your IIS server. If you have not yet configured IIS on your Windows 7  box, I strongly suggest you to read these two posts before continuing  further &lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;a href=&quot;http://www.devcurry.com/2010/10/install-iis-7-on-windows-7.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Install IIS 7 on Windows 7&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;a href=&quot;http://www.devcurry.com/2010/11/resolving-aspnet-40-has-not-been.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Resolving ASP.NET 4.0 has not been Registered on the Web Server Error&lt;/span&gt;&lt;/a&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Assuming you are all set, go to Start &gt; All Programs &gt; Accessories &gt; Run. Type &lt;strong&gt;Inetmgr&lt;/strong&gt;  and hit enter. This opens up the IIS Manager. In the IIS Manager &gt;  Select the root node &gt; Double click ‘Server Certificates’ &lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;img alt=&quot;IIS Server Certificates&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/IISServerCertificates.jpg&quot; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;If you have a list of  Server Certificates installed on your server, you will be able to view  them now. But it happens that I do not have any on my server. In that I  can either ‘Create Certificate Request’ or use a ‘Self-Signed  Certificate’ for testing purpose.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;img alt=&quot;Self Signed Certificate&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/SelfSignedCertificate.jpg&quot; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt;  If you choose the ‘Create Certificate Request’ option, IIS creates a  Base64 encoded request. You can then submit this request to a  Certificate Authority (like Verisign) and receive a SSL certificate  which can be registered on your web server using the ‘Complete  Certificate Request’ that you see in the screenshot above. &lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;However if you choose  the ‘Create Self-Signed certificate option, then IIS creates a  self-signed certificate for your own server. It is an easy option if you  plan to use HTTPS for local testing purpose. Remember that you can  access this certificate only from your machine. &lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;We will go ahead with  creating a Self-Signed certificate for testing purpose. Click the  ‘Create Self-Signed certificate’ link &gt; Enter a friendly name for the  certificate request and hit OK.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;img alt=&quot;Self Signed Certificate Name&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/SelfSignedCertificateName.jpg&quot; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;As you can see in the screenshot below, we have a self-signed certificate that we can use for testing purpose.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;img alt=&quot;Sample Cert&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/SampleCert.jpg&quot; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;The last step is to set  the protocol for SSL for your website. To do so, select your website in  the IIS Manager &gt; In the Action pane, select Bindings &gt; Add Site  Binding&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;img alt=&quot;Https Site Binding&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/HttpsSiteBinding.jpg&quot; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Select the Type https and ‘SampleCert’ as SSL certificate and click OK&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;&lt;img alt=&quot;AddIis Site Binding&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/AddIisSiteBinding.jpg&quot; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Your Website is now SSL enabled. To test, type &lt;/span&gt;&lt;a href=&quot;https://localhost/YourSiteName&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;https://localhost/YourSiteName&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt; and you should be able to see the default page. &lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;I hope you liked the article and I thank you for viewing it. &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/6306685116442242328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/6306685116442242328' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6306685116442242328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6306685116442242328'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/03/configure-secure-socket-layer-ssl-in.html' title='Configure Secure Socket Layer (SSL) in IIS 7 or IIS 7.5 in Windows 7'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-6111257497900281221</id><published>2011-03-04T06:32:00.000-08:00</published><updated>2011-03-04T06:35:25.575-08:00</updated><title type='text'>Difference between WPF and WCF in .Net</title><content type='html'>Window presentation foundation (WPF)is to help developers create attractive and effective user interfaces. The WPF is included in version 3.0 of the Microsoft .NET Framework, allows building interfaces that incorporate documents, media, two- and three-dimensional graphics, animations, Web-like characteristics, and much more.&lt;br /&gt;&lt;br /&gt;Wherein,Windows Communication Foundation (WCF) is a framework for distributed programming. The WCF is designed to offer a manageable approach to distributed computing, broad interoperability, and direct support for service orientation. It includes serialization facilities that enable loose coupling and versioning, and it provides integration and interoperability with existing .NET Framework distributed systems technologies such as Message Queuing (MSMQ), COM+, ASP.NET Web services, Web Services Enhancements (WSE), and a number of other functions.</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/6111257497900281221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/6111257497900281221' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6111257497900281221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6111257497900281221'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/03/difference-between-wpf-and-wcf-in-net.html' title='Difference between WPF and WCF in .Net'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-3206263995614448321</id><published>2011-03-04T03:25:00.000-08:00</published><updated>2011-03-04T03:26:54.612-08:00</updated><title type='text'>Convert Time in Different TimeZones in ASP.NET</title><content type='html'>&lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;In this article, we will see how to convert time from one time zone to another, in an ASP.NET application. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;b&gt;Step 1:&lt;/b&gt;  Fire up Visual Studio &gt; File &gt; New Website. Drag and drop a  DropDownList and two Label controls to the page and add a  ‘SelectedIndexChanged’ event to the DropDownList (we will code this  event later). The DropDownList will display the different Timezones and  the Label controls will display the Local time as well as the Converted  time. Here’s how the markup would look like.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;&lt;&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:maroon;&quot;  &gt;form&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt; &lt;span style=&quot;color:red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;form1&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;server&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;&lt;&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:maroon;&quot;  &gt;div&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;    &lt;span style=&quot;color:blue;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;asp&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;DropDownList&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;ddlTimeZone&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;AutoPostBack&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;        &lt;span style=&quot;color:red;&quot;&gt;onselectedindexchanged&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;ddlTimeZone_SelectedIndexChanged&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;        &lt;span style=&quot;color:red;&quot;&gt;AppendDataBoundItems&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;            &lt;span style=&quot;color:blue;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;asp&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;ListItem&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Select a TimeZone&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;Default value&quot;&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;    &lt;span style=&quot;color:blue;&quot;&gt;&lt;!--&lt;/span--&gt;&lt;span style=&quot;color:maroon;&quot;&gt;asp&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;DropDownList&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;    &lt;span style=&quot;color:blue;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;/&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;/&gt;&lt;/span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;    Local Time: &lt;span style=&quot;color:blue;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;asp&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;Label&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;lblLocalTime&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;&quot;&gt;&lt;!--&lt;/span--&gt;&lt;span style=&quot;color:maroon;&quot;&gt;asp&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;Label&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;    &lt;span style=&quot;color:blue;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;/&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;    Converted Time: &lt;span style=&quot;color:blue;&quot;&gt;&lt;&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;asp&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;Label&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;lblTimeZone&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color:red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;&quot;&gt;&lt;!--&lt;/span--&gt;&lt;span style=&quot;color:maroon;&quot;&gt;asp&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:maroon;&quot;&gt;Label&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;/span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;&lt;!--&lt;/span--&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:maroon;&quot;  &gt;div&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;&lt;!--&lt;/span--&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:maroon;&quot;  &gt;form&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;b&gt;Step 2:&lt;/b&gt; We will now populate the DropDownList with the different TimeZones available. A simple way to do that is to use the &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;&quot;  &gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.timezoneinfo.getsystemtimezones.aspx&quot; target=&quot;_blank&quot;&gt;TimeZoneInfo.GetSystemTimeZones&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt; method. This method returns a generic ReadOnlyCollection(Of T) collection of TimeZoneInfo objects.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;Write the following code in the Page_Load method&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;C#&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;color:blue;&quot;   &gt;protected&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt; &lt;span style=&quot;color:blue;&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span style=&quot;color:blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;{&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;    &lt;span style=&quot;color:blue;&quot;&gt;if&lt;/span&gt; (!Page.IsPostBack)&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;    {&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        lblLocalTime.Text = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DateTime&lt;/span&gt;.Now.ToString();&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ReadOnlyCollection&lt;/span&gt;&lt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;TimeZoneInfo&lt;/span&gt;&gt; tzi;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        tzi = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;TimeZoneInfo&lt;/span&gt;.GetSystemTimeZones();         &lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        &lt;span style=&quot;color:blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;TimeZoneInfo&lt;/span&gt; timeZone &lt;span style=&quot;color:blue;&quot;&gt;in&lt;/span&gt; tzi)&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        {&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;            ddlTimeZone.Items.Add(&lt;span style=&quot;color:blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ListItem&lt;/span&gt;(timeZone.DisplayName, timeZone.Id));                &lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        }&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;    }&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;}&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;VB.NET (Converted Code)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;Protected&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt; &lt;span style=&quot;color:blue;&quot;&gt;Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color:blue;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color:blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt; EventArgs)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;      &lt;span style=&quot;color:blue;&quot;&gt;If&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;Not&lt;/span&gt; Page.IsPostBack &lt;span style=&quot;color:blue;&quot;&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;            lblLocalTime.Text = &lt;span style=&quot;color:blue;&quot;&gt;Date&lt;/span&gt;.Now.ToString()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;            &lt;span style=&quot;color:blue;&quot;&gt;Dim&lt;/span&gt; tzi &lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt; ReadOnlyCollection(&lt;span style=&quot;color:blue;&quot;&gt;Of&lt;/span&gt; TimeZoneInfo)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;            tzi = TimeZoneInfo.GetSystemTimeZones()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;            &lt;span style=&quot;color:blue;&quot;&gt;For&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;Each&lt;/span&gt; timeZone &lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt; TimeZoneInfo &lt;span style=&quot;color:blue;&quot;&gt;In&lt;/span&gt; tzi&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;                  ddlTimeZone.Items.Add(&lt;span style=&quot;color:blue;&quot;&gt;New&lt;/span&gt; ListItem(timeZone.DisplayName, timeZone.Id))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;            &lt;span style=&quot;color:blue;&quot;&gt;Next&lt;/span&gt; timeZone&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;      &lt;span style=&quot;color:blue;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;If&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;line-height: 115%;font-family:&amp;quot;;color:blue;&quot;  &gt;End&lt;/span&gt;&lt;span style=&quot;line-height: 115%;font-family:&amp;quot;;&quot; &gt; &lt;span style=&quot;color:blue;&quot;&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;As you can see, we first extract the different TimeZones available on the machine using &lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.timezoneinfo.getsystemtimezones.aspx&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;&quot;  &gt;TimeZoneInfo.GetSystemTimeZones&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt; and then loop through the collection and add the name and value to the DropDownList. The &lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.timezoneinfo.displayname.aspx&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;&quot;  &gt;TimeZoneInfo.DisplayName&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt; is the Name and the &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;&quot;  &gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.timezoneinfo.id.aspx&quot; target=&quot;_blank&quot;&gt;TimeZoneInfo.Id&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt; is the value added to the DropDownList.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;img alt=&quot;image_2&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/20102010image_2.jpg&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;b&gt;Step 3:&lt;/b&gt;  The last step is to convert the local time into the TimeZone selected  by the user in the DropDownList. We will do the conversion using the &lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb382058.aspx&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;&quot;  &gt;TimeZoneInfo.ConvertTimeBySystemTimeZoneId&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;.  This method converts a time from one time zone to another based on the  ‘time zone identifier’ without the need to know whether the converted  time is standard or daylight saving time. Remember we used the &lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.timezoneinfo.id.aspx&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;&quot;  &gt;TimeZoneInfo.Id&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt; that formed the ‘value’ of the DropDownList in Step 2. We will use that value here as shown below:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;C#&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;color:blue;&quot;   &gt;protected&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt; &lt;span style=&quot;color:blue;&quot;&gt;void&lt;/span&gt; ddlTimeZone_SelectedIndexChanged(&lt;span style=&quot;color:blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;{&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;    &lt;span style=&quot;color:blue;&quot;&gt;if&lt;/span&gt; (ddlTimeZone.SelectedIndex &gt; 0)&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;    {&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DateTime&lt;/span&gt; dt = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DateTime&lt;/span&gt;.Now;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;        lblTimeZone.Text = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;TimeZoneInfo&lt;/span&gt;.ConvertTimeBySystemTimeZoneId(dt,&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;            &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;TimeZoneInfo&lt;/span&gt;.Local.Id, ddlTimeZone.SelectedValue).ToString();&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;    }&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:9.5pt;&quot;  &gt;}&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt; &lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;VB.NET (Converted Code)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;color:blue;&quot;  &gt;Protected&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt; &lt;span style=&quot;color:blue;&quot;&gt;Sub&lt;/span&gt; ddlTimeZone_SelectedIndexChanged(&lt;span style=&quot;color:blue;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color:blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt; EventArgs)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;      &lt;span style=&quot;color:blue;&quot;&gt;If&lt;/span&gt; ddlTimeZone.SelectedIndex &gt; 0 &lt;span style=&quot;color:blue;&quot;&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;            &lt;span style=&quot;color:blue;&quot;&gt;Dim&lt;/span&gt; dt &lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;Date&lt;/span&gt; = &lt;span style=&quot;color:blue;&quot;&gt;Date&lt;/span&gt;.Now&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;             lblTimeZone.Text = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt,  TimeZoneInfo.Local.Id, ddlTimeZone.SelectedValue).ToString()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: normal; margin: 0in 0in 0pt;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;&quot; &gt;&lt;span style=&quot;font-size:85%;&quot;&gt;      &lt;span style=&quot;color:blue;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;If&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;line-height: 115%;font-family:&amp;quot;;color:blue;&quot;  &gt;End&lt;/span&gt;&lt;span style=&quot;line-height: 115%;font-family:&amp;quot;;&quot; &gt; &lt;span style=&quot;color:blue;&quot;&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;That’s it. Run the application and convert the local time into the desired TimeZone as shown below&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin: 0in 0in 10pt;&quot; align=&quot;justify&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:85%;&quot;  &gt;&lt;img alt=&quot;image_1&quot; src=&quot;http://www.dotnetcurry.com/images/aspnet/20102010image_1.jpg&quot; /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/3206263995614448321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/3206263995614448321' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/3206263995614448321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/3206263995614448321'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/03/convert-time-in-different-timezones-in.html' title='Convert Time in Different TimeZones in ASP.NET'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-6220270468761499694</id><published>2011-02-08T01:47:00.000-08:00</published><updated>2011-02-08T01:48:02.341-08:00</updated><title type='text'>SQL DISTINCT on Multiple Columns</title><content type='html'>&lt;p&gt;The DISTINCT clause works in combination with SELECT and gives you  unique date from a database table or tables. The syntax for DISTINCT is  show below&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;column_name&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;table_name&quot;&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;If you want a DISTINCT combination of more than one column then the syntax is&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; column1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; column2&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;table_name&quot;&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;Let&#39;s look at some examples to understand the usage of the DISTINCT  keyword. First, let&#39;s create a table for our illustration and insert  some data.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;CREATE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;TABLE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; Firstname &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;nvarchar&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NOT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; Lastname &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;nvarchar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NOT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; PostalCode &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;nvarchar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NOT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; City &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;nvarchar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NOT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd3&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;into&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Firstname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;PostalCode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;City&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Param&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Singh&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;B283SP&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Birmingham&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Steve&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;White&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;EC224HQ&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;London&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Mark&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Smith&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;L324JK&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Liverpool&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Claire&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;whitehood&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;M236DM&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Manchester&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Param&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Singh&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;B283SP&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Birmingham&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DistinctTutorial&lt;/span&gt;&lt;/pre&gt; &lt;table summary=&quot;DistinctTutorial table&quot; border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot; width=&quot;433&quot;&gt;  &lt;caption&gt;DuplicateTest&lt;/caption&gt;  &lt;colgroup&gt;   &lt;col width=&quot;92&quot;&gt;   &lt;col width=&quot;99&quot;&gt;   &lt;col width=&quot;114&quot;&gt;   &lt;col width=&quot;104&quot;&gt;  &lt;/colgroup&gt;  &lt;thead&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;th id=&quot;th0EC400480000&quot;&gt;Firstname&lt;/th&gt;    &lt;th id=&quot;th0EC400480001&quot;&gt;Lastname&lt;/th&gt;    &lt;th id=&quot;th0EC400480002&quot;&gt;PostalCode&lt;/th&gt;    &lt;th id=&quot;th0EC400480003&quot;&gt;City&lt;/th&gt;   &lt;/tr&gt;  &lt;/thead&gt;  &lt;tbody&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0EC400480000&quot;&gt;Sarvesh&lt;/td&gt;    &lt;td headers=&quot;th0EC400480001&quot;&gt;Singh&lt;/td&gt;    &lt;td headers=&quot;th0EC400480002&quot;&gt;B263SP&lt;/td&gt;    &lt;td headers=&quot;th0EC400480003&quot;&gt;Birmingham&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0EC400480000&quot;&gt;Steve&lt;/td&gt;    &lt;td headers=&quot;th0EC400480001&quot;&gt;White&lt;/td&gt;    &lt;td headers=&quot;th0EC400480002&quot;&gt;EC224HQ&lt;/td&gt;    &lt;td headers=&quot;th0EC400480003&quot;&gt;London&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0EC400480000&quot;&gt;Mark&lt;/td&gt;    &lt;td headers=&quot;th0EC400480001&quot;&gt;Smith&lt;/td&gt;    &lt;td headers=&quot;th0EC400480002&quot;&gt;L324JK&lt;/td&gt;    &lt;td headers=&quot;th0EC400480003&quot;&gt;Liverpool&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0EC400480000&quot;&gt;Claire&lt;/td&gt;    &lt;td headers=&quot;th0EC400480001&quot;&gt;whitehood&lt;/td&gt;    &lt;td headers=&quot;th0EC400480002&quot;&gt;M236DM&lt;/td&gt;    &lt;td headers=&quot;th0EC400480003&quot;&gt;Manchester&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0EC400480000&quot;&gt;Param&lt;/td&gt;    &lt;td headers=&quot;th0EC400480001&quot;&gt;Singh&lt;/td&gt;    &lt;td headers=&quot;th0EC400480002&quot;&gt;B283SP&lt;/td&gt;    &lt;td headers=&quot;th0EC400480003&quot;&gt;Birmingham&lt;/td&gt;   &lt;/tr&gt;  &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;In the result set above there are repetitions in the City Column.  Let&#39;s get a list of all cities without repeating them using DISTINCT.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; City &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;/span&gt;&lt;/pre&gt; &lt;table summary=&quot;Distinct City&quot; border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot; width=&quot;114&quot;&gt;  &lt;caption&gt;City&lt;/caption&gt;  &lt;thead&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;th id=&quot;th0ED27E380000&quot;&gt;Birmingham&lt;/th&gt;   &lt;/tr&gt;  &lt;/thead&gt;  &lt;tbody&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0ED27E380000&quot;&gt;Liverpool&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0ED27E380000&quot;&gt;London&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0ED27E380000&quot;&gt;&lt;br /&gt;Manchester&lt;/td&gt;   &lt;/tr&gt;  &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;&lt;br /&gt;You can see &#39;Birmingham&#39; is just returned once in this result,  even though it appears more than once in the table. You can get the same  result using GROUP BY as shown below.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; city &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;by&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; city&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;Let&#39;s now use DISTINCT with more than one column. We will add the Lastname column in as well.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; City&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;/span&gt;&lt;/pre&gt; &lt;table summary=&quot;City and Lastname&quot; border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot; width=&quot;289&quot;&gt;  &lt;caption&gt;Distinct City and lastname&lt;/caption&gt;  &lt;colgroup&gt;   &lt;col width=&quot;107&quot;&gt;   &lt;col width=&quot;170&quot;&gt;  &lt;/colgroup&gt;  &lt;thead&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;th id=&quot;th0ED2D5900000&quot;&gt;City&lt;/th&gt;    &lt;th id=&quot;th0ED2D5900001&quot;&gt;Lastname&lt;/th&gt;   &lt;/tr&gt;  &lt;/thead&gt;  &lt;tbody&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0ED2D5900000&quot;&gt;Birmingham&lt;/td&gt;    &lt;td headers=&quot;th0ED2D5900001&quot;&gt;Singh&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0ED2D5900000&quot;&gt;Liverpool&lt;/td&gt;    &lt;td headers=&quot;th0ED2D5900001&quot;&gt;Smith&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0ED2D5900000&quot;&gt;London&lt;/td&gt;    &lt;td headers=&quot;th0ED2D5900001&quot;&gt;White&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0ED2D5900000&quot;&gt;Manchester&lt;/td&gt;    &lt;td headers=&quot;th0ED2D5900001&quot;&gt;whitehood&lt;/td&gt;   &lt;/tr&gt;  &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;We get a list of results that have multiple rows, none of which are duplicated. &lt;/p&gt; &lt;p&gt;Again, you can get the same result by using GROUP BY as shown below:&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; city&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastname &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;by&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; city&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lastname&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;If you look at the original data, there are two users with same  Lastname (Singh) who live in the same city (Birmingham). With the  DISTICT keyword you get one unique row. Let&#39;s now add another column to  our SELECT query.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; City&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Postalcode &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;This returns:&lt;/p&gt; &lt;table summary=&quot;Distinct City Lastname and Postalcode&quot; border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot; width=&quot;293&quot;&gt;  &lt;caption&gt; &lt;/caption&gt;  &lt;colgroup&gt;   &lt;col width=&quot;85&quot;&gt;   &lt;col width=&quot;92&quot;&gt;   &lt;col width=&quot;98&quot;&gt;  &lt;/colgroup&gt;  &lt;thead&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;th id=&quot;th0F95E4C80000&quot;&gt;City&lt;/th&gt;    &lt;th id=&quot;th0F95E4C80001&quot;&gt;Lastname&lt;/th&gt;    &lt;th id=&quot;th0F95E4C80002&quot;&gt;PostalCode&lt;/th&gt;   &lt;/tr&gt;  &lt;/thead&gt;  &lt;tbody&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0F95E4C80000&quot;&gt;Birmingham&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80001&quot;&gt;Singh&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80002&quot;&gt;B263SP&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0F95E4C80000&quot;&gt;Birmingham&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80001&quot;&gt;Singh&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80002&quot;&gt;B283SP&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0F95E4C80000&quot;&gt;Liverpool&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80001&quot;&gt;Smith&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80002&quot;&gt;L324JK&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0F95E4C80000&quot;&gt;London&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80001&quot;&gt;White&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80002&quot;&gt;EC224HQ&lt;/td&gt;   &lt;/tr&gt;   &lt;tr align=&quot;left&quot; valign=&quot;top&quot;&gt;    &lt;td headers=&quot;th0F95E4C80000&quot;&gt;Manchester&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80001&quot;&gt;whitehood&lt;/td&gt;    &lt;td headers=&quot;th0F95E4C80002&quot;&gt;M236DM&lt;/td&gt;   &lt;/tr&gt;  &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;You will notice now that you are seeing two rows with the same  lastname of Singh. This is because their &#39;Postalcode&#39; is different, and  the addition of that column makes the rows unique. &lt;/p&gt; &lt;p&gt;Again you will get the same result using GROUP BY as shown below:&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; city&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lastname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; postalcode&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DuplicateTest&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;by&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; city&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lastname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; postalcode&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;Let&#39;s look at another example where you can use DISTINCT on multiple  columns to find duplicate addreses. I&#39;ve taken this example from the  post. Please refer to &lt;a href=&quot;http://www.sqlservercentral.com/Forums/Topic438842-338-1.aspx&quot;&gt;this post&lt;/a&gt; for more detail.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; PostCode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd2&quot;&gt;COUNT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Postcode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Address1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Address2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; City&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Postcode&lt;br /&gt;     &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; AddressTable&lt;br /&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sub&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;GROUP&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;BY&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Postcode&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;HAVING&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd2&quot;&gt;COUNT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Postcode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;Or you can use GROUP BY as follows:&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Address1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Address2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;City&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;PostCode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;kwd2&quot;&gt;Count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;PostCode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; AddressTable&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;GROUP&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;BY&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Address1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Address2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;City&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;PostCode&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;HAVING&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd2&quot;&gt;Count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;PostCode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;In both of these cases, we are using DISTINCT to find those rows that  are duplicates, based on the columns we include in the queries.&lt;/p&gt; &lt;p&gt;DISTINCT can also be used to get unique column values with an  aggregate function. In the example below, the query gets the unique  values of reorderpoint and then does a SUM.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;USE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; AdventureWorks&lt;br /&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd2&quot;&gt;SUM&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ReorderPoint&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DistinctSum&lt;br /&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Production&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Product&lt;br /&gt;GO&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;Result: 1848 rows&lt;/p&gt; &lt;p&gt;In the example below query is doing a SUM of ReorderPoint including the duplicates.&lt;/p&gt; &lt;pre class=&quot;prettyprint lang-sql&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd2&quot;&gt;SUM&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ReorderPoint&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; WithoutDistinct&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Production&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Product&lt;br /&gt;GO&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;Result: 202287 rows&lt;/p&gt; &lt;p&gt;As you can see from the above two examples the importance of DISTINCT  with an aggregate function. The user could end up un-knowingly using  completely incorrect SUM had he used the result from the second query if  the requirement was to get the SUM of unique values of ReorderPoint.&lt;/p&gt; &lt;p&gt;The purpose of the article was to show a user simple usage of DISTINCT. I hope you would find this article useful.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/6220270468761499694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/6220270468761499694' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6220270468761499694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6220270468761499694'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2011/02/sql-distinct-on-multiple-columns.html' title='SQL DISTINCT on Multiple Columns'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-1327786854931999718</id><published>2010-09-19T09:32:00.000-07:00</published><updated>2010-09-19T09:33:45.102-07:00</updated><title type='text'>Good Backlinks for your website</title><content type='html'>What are Backlinks?&lt;br /&gt;Backlinks are links on other websites pointing at your website. Without adequate links pointing at your website it will likely never achieve higher keyword ranking.&lt;br /&gt;How to Find Good Backlinks&lt;br /&gt;Website ranking involves more than just putting your website online. The old addage, &quot;Build it and they will come&quot; is no longer true. You need to not only have quality content on your website but also focus on getting good backlinks but also relevant backlinks. The kind of links you gather and where the link is placed on the other site will also determine the amount of traffic you get and your ranking in the search engines.&lt;br /&gt;&lt;br /&gt;Google and Yahoo rank websites according to how many quality backlinks they find pointing at your website. Quality is determined by how relevant the other site is to your site and where the link is placed on their page (within the content is best) and how many other links are on the page (less is better). A large number of links pointing at your site does not guarantee success. You need quality backlinks in order to rise to the first page of results and the more you can find the better.&lt;br /&gt;&lt;br /&gt;Google started devaluing traded links in Fall of 2007 and started penalizing directories that used dishonest means to raise their own PR so they could sell links. Google penalized those directories by dropping their PR (Page Rank) to Zero and Keyword Rank so far that they didn&#39;t even rank for their own business name. This also affected the rank of sites that bought links from those directories because their link count dropped.&lt;br /&gt;&lt;br /&gt;If you have been buying links from directories and your PR or keyword rank is dropping it may be because of Google penalizing those directories. This causes those sites to put rel=&quot;nofollow&quot; on the links to protect themselves, thus you are no longer credited for those links you bought which reduces your PR and thus your Keyword Rank.&lt;br /&gt;&lt;br /&gt;Google also penalizes sites for getting involved in Triangular Linking Schemes, i.e., &quot;I&#39;ll link to your site from my site if you link to my other site&quot; (they do this so it doesn&#39;t look like a link trade but Google knows how to spot these also).&lt;br /&gt;&lt;br /&gt;Therefore the best way to encourage people to link to your content is to provide information that is useful to your visitors.&lt;br /&gt;&lt;br /&gt;What are Quality Backlinks?&lt;br /&gt;&lt;br /&gt;    * Few links on a page&lt;br /&gt;    * A link within the body content&lt;br /&gt;    * Link from a relevant site &lt;br /&gt;&lt;br /&gt;Google recently changed it&#39;s algorighym so that if there is an excess of traded links, purchased links, or if you get involved in triangular linking schemes, or buy hundreds or thousands of links all at once, then it will draw a red flag for Google and then Google may apply a filter to your site to prevent it from ranking well.&lt;br /&gt;&lt;br /&gt;An occasional, relevant link trade is ok and having to buy a link in Yahoo directory or another directory that is human reviewed where you have to pay for the review (and not the submission) is OK, but anything in exess can cause you problems with your ranking in Google because they can tell when link gathering is not normal.&lt;br /&gt;&lt;br /&gt;Google is having to do this due to too many finding some new trick that helps their keyword rank (like hidden text) and then everyone else follows suit and then Google has to clamp down on that practice — until next time someone comes up with a &quot;bright idea&quot;.&lt;br /&gt;&lt;br /&gt;So anything you do to try and manipulate your rank in Google can draw a red flag and your site could be banned, penalized or have your keyword rank filtered out, i.e., you won&#39;t be able to rank for anything no matter what you do.&lt;br /&gt;&lt;br /&gt;Best Linking Practice&lt;br /&gt;The best, and easiest, method to gather links is to provide something on your website that people will want to link to, i.e., if you build bridges offer free bridge building plans, if you sell dessert products offer free recipies of products you don&#39;t offer, if you provide a service write up a FAQ about your service, etc. You can also provide a service or product for free if they will provide a backlink to your site . On LWD, I provide a lot of HTML tips, Css Tips, graphics tutorials and articles on keyword ranking and other topics which bring in a lot of my traffic and backlinks without my even asking.&lt;br /&gt;&lt;br /&gt;Finding Backlinks For Your Website&lt;br /&gt;Find friends, businesses, individuals, or organizations who are willing to link to your website as soon as it&#39;s online, then you won&#39;t need to submit to search engines because the search engines can find your link on a site they have indexed already. Some of them may require a link trade but try to get mostly one-way links.&lt;br /&gt;&lt;br /&gt;Find Good Backlinks&lt;br /&gt;Google uses age of the site, backlinks as well as PR to rank sites (along with many other factors) so, unless you want to PayPerClick for the life of the site, you need to get gather a lot of links and write a lot of content to get rank as high as possible.&lt;br /&gt;&lt;br /&gt;Look for websites relevant to what your site offers but have a different focus, i.e., submit to a gardening site if you sell garden tools.&lt;br /&gt;&lt;br /&gt;Another way to find good backlinks is to search for your major keyword in your favorite search engine and take note of which of your competitors is ranking highest. Then search for their domain name and look for sites that have accepted their link then try and submit your website there also.&lt;br /&gt;Other Methods of Getting Good Backlinks&lt;br /&gt;&lt;br /&gt;    * Find Directories in Your Own Niche Submit to directories in your own niche, i.e., if you sell or offer information about vitamins then look for directories focused on health products.&lt;br /&gt;&lt;br /&gt;    * Free Submission Directories If you aim for free submissions from directories you may need to request about 10 times as many backlinks as you actually need as very few free links are accepted by directories claiming to accept free submissions. They do this so they won&#39;t be penalized for only offering paid links. When submitting, change your anchor text (title of your site) frequently so there is a wide variety of keywords to rank for, however you will probably have to pay for anything other than your official site name.&lt;br /&gt;&lt;br /&gt;      Also see:&lt;br /&gt;      Directories that Pass PR&lt;br /&gt;      and&lt;br /&gt;      Directories to Avoid&lt;br /&gt;    * Write Articles Write quality articles related to the focus of your website and submit to other sites. Provide a link within the article to your site related to the focus in the article -- not necessarily your home page. Do NOT post the same article on your own website or you may be penalized for duplicate content.&lt;br /&gt;&lt;br /&gt;    * Submit Press Releases Only submit press releases when you have a valid reason for one--any new development on your site or an original focus with your products that the customers on the press release will be interested in.&lt;br /&gt;&lt;br /&gt;    * Blogging Set up a blog on a separate site related to the topic of your site and provide information of value to your visitors (that you don&#39;t provide on your own site) with a link to your website within the post where appropriate. Don&#39;t link from your website to your blog or it will be discounted.&lt;br /&gt;&lt;br /&gt;    * Participate in Forums Find forums related to your website&#39;s focus and post often so you will get noticed and build up trust so people will click on the link in your profile or signature and possibly link to your site from their own site or in other forums showing where they found valuable information. Most forums now put a rel=&quot;nofollow&quot; on all outgoing links so this may not benefit you other than getting some traffic.&lt;br /&gt;&lt;br /&gt;How Many Backlinks is Enough?&lt;br /&gt;That depends on your major keywords. Are they popular? If so, you will have a struggle to beat your competition and may have to resort to PayPerClick along with backlinks.&lt;br /&gt;&lt;br /&gt;If very few websites advertise what you offer then you may not need very many backlinks to rank high in the search engines but your traffic may still be minimal because of your site being so specialized. In that case diversify and add more information.&lt;br /&gt;&lt;br /&gt;Getting Backlinks is an On-going Process&lt;br /&gt;Your backlinks need to be replenished each year because some sites along with their backlinks go offline. Your competitors are probably eagerly seeking more backlinks to outrank you so unless you actively seek more backlinks each year your rank may drop.&lt;br /&gt;&lt;br /&gt;Also see&lt;br /&gt;Backlinks to Avoid&lt;br /&gt;and&lt;br /&gt;Keyword Ranking Strategy&lt;br /&gt;Pay Per Click is only temporary&lt;br /&gt;Getting good quality backlinks is a lengthy process and can take several months--unless you want to utilize PayPerClick (Google&#39;s AdWords) and then it can achieve almost immediate results but those results will end as soon as you quit paying so it&#39;s a good idea to gather links at the same time.&lt;br /&gt;&lt;br /&gt;If you would like your web site analyzed for keyword ranking please check out the Website Evaluations page. If you are looking for a web designer see the How to Find a Web Designer page first.</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/1327786854931999718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/1327786854931999718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/1327786854931999718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/1327786854931999718'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/09/good-backlinks-for-your-website.html' title='Good Backlinks for your website'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-350836180550994280</id><published>2010-07-12T03:46:00.000-07:00</published><updated>2010-07-12T03:47:04.757-07:00</updated><title type='text'>GZip compression with ASP.NET Content</title><content type='html'>After I posted the GZip Script Compression module code a while back, I’ve gotten a number of questions regarding GZip and compression in ASP.NET applications so I thought I show a couple of other ways you can use the new GZipStream class in ASP.NET.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The beauty of this new GZip support is how easy it is to use in your own ASP.NET code. I use the GZip functionality a bit in my WebLog code. For example the the cached RSS feed is GZip encoded which uses GZipStream on the Response.OutputStream fed to an XmlWriter():&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Response.ContentType = &quot;text/xml&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Stream Output = Response.OutputStream;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (Westwind.Tools.wwWebUtils.IsGZipSupported())&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    GZipStream gzip = new GZipStream(Response.OutputStream, CompressionMode.Compress);&lt;br /&gt;&lt;br /&gt;    Response.AppendHeader(&quot;Content-Encoding&quot;, &quot;gzip&quot;);&lt;br /&gt;&lt;br /&gt;    Output = gzip;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Encoding Utf8 = new UTF8Encoding(false);  // No BOM!&lt;br /&gt;&lt;br /&gt;XmlTextWriter Writer = new XmlTextWriter(Output,Utf8);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Writer.Formatting = Formatting.Indented;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Writer.WriteStartElement(&quot;rss&quot;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;…&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Writer.WriteEndElement(); // rss&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Writer.Close();&lt;br /&gt;&lt;br /&gt;Response.End();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;GZipStream is a stream acts like a stream filter so you can assign it to an existing stream like ResponseStream can intercept all inbound data then write the updated data into the actual Response stream. It’s super easy to do.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You should always check however if GZip is enabled which is done by this helper method IsGZipSupported() which looks like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;&lt;br /&gt;/// Determines if GZip is supported&lt;br /&gt;&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;/// &lt;returns&gt;&lt;/returns&gt;&lt;br /&gt;&lt;br /&gt;public static bool IsGZipSupported()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    string AcceptEncoding = HttpContext.Current.Request.Headers[&quot;Accept-Encoding&quot;];&lt;br /&gt;&lt;br /&gt;    if (!string.IsNullOrEmpty(AcceptEncoding) &amp;amp;&amp;amp;&lt;br /&gt;&lt;br /&gt;         AcceptEncoding.Contains(&quot;gzip&quot;) || AcceptEncoding.Contains(&quot;deflate&quot;) )&lt;br /&gt;&lt;br /&gt;        return true;&lt;br /&gt;&lt;br /&gt;    return false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This ensures that you don’t encode content when the client doesn’t understand GZip and would be unable to read the encoded GZip content. Note that the code checks for either gzip or deflate so this assumes before encoding you’ll pick the right encoding algorithm.&lt;br /&gt;&lt;br /&gt;GZip in Page Content&lt;br /&gt;&lt;br /&gt;Speaking of encoding -  above was XML and raw ResponseStream encoding, but you can also apply GZip content very, very easily to your page level or any ASP.NET level code (such as in an HTTP handler). In fact, you can use a very generic mechanism to encode any output by using a Response.Filter which the following helper method (also in wwWebUtils) demonstrates:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Sets up the current page or handler to use GZip through a Response.Filter&lt;br /&gt;/// IMPORTANT: &lt;br /&gt;/// You have to call this method before any output is generated!&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public static void GZipEncodePage()&lt;br /&gt;{&lt;br /&gt;    HttpResponse Response = HttpContext.Current.Response;&lt;br /&gt;&lt;br /&gt;    if (IsGZipSupported())&lt;br /&gt;    {&lt;br /&gt;        string AcceptEncoding = HttpContext.Current.Request.Headers[&quot;Accept-Encoding&quot;];&lt;br /&gt;        if (AcceptEncoding.Contains(&quot;deflate&quot;))&lt;br /&gt;        {&lt;br /&gt;            Response.Filter = new System.IO.Compression.DeflateStream(Response.Filter,&lt;br /&gt;                                       System.IO.Compression.CompressionMode.Compress);&lt;br /&gt;            Response.AppendHeader(&quot;Content-Encoding&quot;, &quot;deflate&quot;);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            Response.Filter = new System.IO.Compression.GZipStream(Response.Filter,&lt;br /&gt;                                      System.IO.Compression.CompressionMode.Compress);&lt;br /&gt;            Response.AppendHeader(&quot;Content-Encoding&quot;, &quot;gzip&quot;);                   &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Allow proxy servers to cache encoded and unencoded versions separately&lt;br /&gt;    Response.AppendHeader(&quot;Vary&quot;, &quot;Content-Encoding&quot;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can now take this helper function and use this in page level code. For example, the main page in my blog which is HUGE (frequently around 500k) uses it like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    wwWebUtils.GZipEncodePage();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    Entry = WebLogFactory.GetEntry();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    if (Entry.GetLastEntries(App.Configuration.ShowEntryCount, &quot;pk,Title,Body,Entered,Feedback,Location&quot;) &lt; 0)&lt;br /&gt;&lt;br /&gt;        throw new ApplicationException(&quot;Couldn&#39;t load WebLog Entries: &quot; + Entry.ErrorMessage);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    this.repEntries.DataSource = this.Entry.EntryList;&lt;br /&gt;&lt;br /&gt;    this.repEntries.DataBind();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That’s it. One line and the page will now conditionally GZip encode if the client supports it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you really wanted to you can take this even one step further and create a module that automatically sets the Response.Filter early in the pipeline and based on that automatically compresses all content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However, remember GZip encoding applies compression on the fly so there’s some overhead in the GZip encoding – you are basically adding more CPU processing to your content to reduce the output size. If your content is not that large to start with there’s probably not that much sense in compressing in the first place so I don’t think that whole-sale compression of dynamic content is a good idea.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Caching&lt;br /&gt;&lt;br /&gt;But one thing that can mitigate the overhead of GZip compression is caching.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ah yes, both the RSS feed and the home page are usually heavily cached – the content doesn’t change all that frequently so there’s no reason to keep re-generating it right? If you use GZip on your content you have to be careful to cache both the GZipped content and the non-encoded content or else you’ll feed garbage to clients that don’t understand GZip.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So for example the default page has:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;%@ OutputCache Duration=&quot;60&quot; VaryByParam=&quot;none&quot; VaryByCustom=&quot;GZIP&quot; %&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And then a custom Global.asax handler that looks like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public override string GetVaryByCustomString(HttpContext context, string custom)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    if (custom == &quot;GZIP&quot;)&lt;br /&gt;&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        if (Westwind.Tools.wwWebUtils.IsGZipSupported())&lt;br /&gt;&lt;br /&gt;            return &quot;GZip&quot;;&lt;br /&gt;&lt;br /&gt;        return &quot;&quot;;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    return base.GetVaryByCustomString(context, custom);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Which results in possibly two different versions of the GZipped page being cached.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And there you have it - GZipped content is easy to create now in ASP.NET 2.0/.NET 2.0 and if judiciously applied it can save some significant bandwidth. On my homepage which is close to 500k of blog text content (gotta review that) the GZipped size is 55k or so – nearly a 90% reduction in size. I’d say that’s plenty of worth it, especially when caching is added.</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/350836180550994280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/350836180550994280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/350836180550994280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/350836180550994280'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/07/gzip-compression-with-aspnet-content_12.html' title='GZip compression with ASP.NET Content'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-7112182663282572211</id><published>2010-04-11T00:49:00.001-07:00</published><updated>2010-04-11T00:49:10.947-07:00</updated><title type='text'>Image resize code in c#</title><content type='html'>public byte[] imagereduce(System.Drawing.Image imgInput, int maxImageSize)&lt;br&gt;    {&lt;br&gt;        int tWidth;&lt;br&gt;        int tHeight;&lt;br&gt;        double widthHeightRatio = (double)imgInput.Width / (double)imgInput.Height;&lt;br&gt;        // If width greater than height, then width should be max image size, otherwise height should be.&lt;br&gt;         // Image should keep the same proportions.&lt;br&gt;        //tWidth = maxImageSize;&lt;br&gt;        //tHeight = (int)(maxImageSize / widthHeightRatio);&lt;br&gt;        if (widthHeightRatio &amp;gt; 1.0)&lt;br&gt;        {&lt;br&gt;            tWidth = maxImageSize;&lt;br&gt;             tHeight = (int)(maxImageSize / widthHeightRatio);&lt;br&gt;        }&lt;br&gt;        else&lt;br&gt;        {&lt;br&gt;            tWidth = (int)(maxImageSize * widthHeightRatio);&lt;br&gt;            tHeight = maxImageSize;&lt;br&gt;        }&lt;br&gt;         //Session[&amp;quot;imgheight&amp;quot;] = tHeight;&lt;br&gt;        //Session[&amp;quot;imgwidth&amp;quot;] = tWidth;&lt;br&gt;        System.Drawing.Image.GetThumbnailImageAbort myCallBack = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);&lt;br&gt;         System.Drawing.Image myThumbnail = imgInput.GetThumbnailImage(tWidth, tHeight, myCallBack, IntPtr.Zero);&lt;br&gt;        //System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(myThumbnail);&lt;br&gt;&lt;br&gt;        //gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;&lt;br&gt;         //gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;&lt;br&gt;        //gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;&lt;br&gt;&lt;br&gt;        //System.Drawing.Rectangle rectDestination = new System.Drawing.Rectangle(0, 0, tWidth, (int)tHeight);&lt;br&gt; &lt;br&gt;        //System.Drawing.Imaging.ImageCodecInfo codec = System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders()[1];&lt;br&gt;&lt;br&gt;        ////Set the parameters for defining the quality of the thumbnail... here it is set to 100%&lt;br&gt;         //System.Drawing.Imaging.EncoderParameters eParams = new System.Drawing.Imaging.EncoderParameters(1);&lt;br&gt;        //eParams.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L);&lt;br&gt; &lt;br&gt;        //gr.DrawImage(myThumbnail, rectDestination, 0, 0, tWidth, tHeight, System.Drawing.GraphicsUnit.Pixel);&lt;br&gt;        ////myThumbnail.Save(Server.MapPath(sSavePath + sThumbFile));&lt;br&gt;        System.IO.MemoryStream ms = new System.IO.MemoryStream();&lt;br&gt;         //myThumbnail.Save(ms, codec,eParams);&lt;br&gt;        myThumbnail.Save(ms, ImageFormat.Jpeg);&lt;br&gt;        byte[] bitmapData = ms.ToArray();&lt;br&gt;        return bitmapData;&lt;br&gt;    }&lt;br&gt;    public bool ThumbnailCallback()&lt;br&gt;     {&lt;br&gt;        return false;&lt;br&gt;    }&lt;br&gt;    public bool checkext(string ext)&lt;br&gt;    {&lt;br&gt;        ext = ext.ToLower();&lt;br&gt;        if (ext == &amp;quot;.jpg&amp;quot;){return true;}&lt;br&gt;        else if (ext == &amp;quot;.bmp&amp;quot;){ return true;}&lt;br&gt;         else if (ext == &amp;quot;.gif&amp;quot;){ return true;}&lt;br&gt;        else if (ext == &amp;quot;jpg&amp;quot;) { return true;}&lt;br&gt;        else if (ext == &amp;quot;.png&amp;quot;)&lt;br&gt;        {&lt;br&gt;            return true;&lt;br&gt;        }&lt;br&gt;        else if (ext == &amp;quot;.jpeg&amp;quot;)&lt;br&gt;         {&lt;br&gt;            return true;&lt;br&gt;        }&lt;br&gt;        else if (ext == &amp;quot;png&amp;quot;)&lt;br&gt;        {&lt;br&gt;            return true;&lt;br&gt;        }&lt;br&gt;        else if (ext == &amp;quot;bmp&amp;quot;)&lt;br&gt;        {&lt;br&gt;            return true;&lt;br&gt;         }&lt;br&gt;        else if (ext == &amp;quot;gif&amp;quot;)&lt;br&gt;        {&lt;br&gt;            return true;&lt;br&gt;        }&lt;br&gt;        else if (ext == &amp;quot;jpeg&amp;quot;)&lt;br&gt;        {&lt;br&gt;            return true;&lt;br&gt;        }&lt;br&gt;        else&lt;br&gt;         {&lt;br&gt;            return false;&lt;br&gt;        }&lt;br&gt;&lt;br&gt;    }&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;&lt;a href=&quot;http://www.cinehour.com&quot;&gt;www.cinehour.com&lt;/a&gt;&lt;br&gt; </content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/7112182663282572211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/7112182663282572211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/7112182663282572211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/7112182663282572211'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/04/image-resize-code-in-c.html' title='Image resize code in c#'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-2554552305996226387</id><published>2010-04-07T02:12:00.001-07:00</published><updated>2010-04-07T02:12:23.089-07:00</updated><title type='text'>DATE MANIPULATIONS IN T-SQL QUERIES</title><content type='html'>&lt;p&gt;Many times when working with date types in SQL we need to remove the  time portion and leave just the date. There are a number of ways to  accomplish this, but this article will focus on my favorite, the  DATEADD/DATEDIFF (hereafter referred to as DADD) method.&lt;/p&gt; &lt;p&gt;For a long time, I knew about this method but I could never remember  exactly where all the commas and zeroes and parens and everything went  (I always had to look it up) and so I didn&amp;#39;t always use it. Until I  really sat down and looked at it and figured out how it worked, it was  very hard to remember. With this article, I intend to explain the  concept behind the method,give quite a few useful examples of how to  apply it and a couple of the things to watch out for with it.&lt;/p&gt; &lt;p&gt;My most common usage involves stripping the time portion off of a day  or GETDATE(). The DADD method of doing that is:&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0). &lt;br&gt;&lt;/pre&gt; &lt;p&gt;I&amp;#39;m writing this article on February 27, 2010 and as of right now,&lt;/p&gt; &lt;p&gt;&lt;span class=&quot;inlineCode&quot;&gt;GETDATE() = 2010-02-27 17:31:42.670&lt;br&gt;DADD:  = 2010-02-27 00:00:00.000&lt;/span&gt;&lt;/p&gt; &lt;p&gt;While that may appear a bit bewildering at first, it&amp;#39;s really quite  basic. Let&amp;#39;s break it down. First, take the inner DATEDIFF portion.&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEDIFF(dd,0,GETDATE()) = 40234&lt;br&gt;&lt;/pre&gt; &lt;p&gt;What this portion is doing is figuring out the number of days that  have passed between 0 (If you cast 0 as a date in SQL you get  01/01/1900) and today. That number is 40234.&lt;/p&gt; &lt;p&gt;The second portion of the equation is adding that number of days to  0. Because it is only adding the days and not the time portion, you get  the very start of the day. With that in mind, it&amp;#39;s a bit easier to  remember the entire thing because you can just start from the datediff  and add the dateadd. You&amp;#39;re figuring out the number of days between 0  and today and then adding that back to 0.&lt;/p&gt; &lt;p&gt;&lt;span class=&quot;inlineCode&quot;&gt;            DATEDIFF(dd,0,GETDATE()) -- Days  between 0 and Today&lt;br&gt;DATEADD(dd,                         , 0) -- Add  that number of days back to 0&lt;/span&gt;&lt;/p&gt; &lt;p&gt;The same concept works for many different time calculations. For  instance, you can sub out Days for Week, month or Year:&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 0)&lt;br&gt;--: 2010-02-22 00:00:00.000 First day of the week.&lt;br&gt;&lt;br&gt;SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0) &lt;br&gt;--: 2010-02-01 00:00:00.000 First day of the month.&lt;br&gt; &lt;br&gt;SELECT DATEADD(yy, DATEDIFF(yy,0,GETDATE()), 0) &lt;br&gt;--: 2010-01-01 00:00:00.000 First day of the Year.&lt;br&gt;&lt;/pre&gt; &lt;p&gt;You can use a value other than zero in the dateadd portion to add or  remove time. The below adds or removes 2 days. Because you&amp;#39;re literally  adding days, you don&amp;#39;t need to worry about whether or not you cross over  into a different month.&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 2) &lt;br&gt;--: 2010-03-01 00:00:00.000 Start of the day 2 days from now&lt;br&gt;&lt;br&gt;SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), -2)&lt;br&gt;--: 2010-02-25 00:00:00.000 Start of the day 2 days ago.&lt;br&gt; &lt;/pre&gt; &lt;p&gt;Note that if you change the values that are 0&amp;#39;s in all of these, you  are only offshifting by &lt;strong&gt;days&lt;/strong&gt;. What if you want to  add/subtract a week or month? You can do that by adding it right after  the datediff portion.&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()) +2, 0) &lt;br&gt;--: 2010-04-01 00:00:00.000 Start of the Month 2 Months from now.&lt;br&gt;&lt;/pre&gt; &lt;p&gt;In case you were wondering, this DOES work even if the days would  have overflowed. For instance, adding a month to January 31 would still  give you February.&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(mm, DATEDIFF(mm,0,&amp;#39;20100131&amp;#39;) +1, 0) &lt;br&gt;--: 2010-02-01 00:00:00.000 Start of next Month&lt;br&gt;&lt;/pre&gt; &lt;p&gt;You can use the &amp;#39;first&amp;#39; theory to find the &amp;#39;last&amp;#39; of something else.  For example, if you wanted the last day of the prior month, you can  start with the first day of the month and then subtract a day.&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0) &lt;br&gt;--: 2010-02-01 00:00:00.000 First day of the month.&lt;br&gt;&lt;br&gt;SELECT DATEADD(dd,-1, DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0)) &lt;br&gt;--: 2010-01-31 00:00:00.000 Add -1 days (Subtract a day).&lt;br&gt; &lt;/pre&gt; &lt;p&gt;You could also have just added the number of months to -1 days,  effectively subtracting a day here.&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()), -1) &lt;br&gt;--: 2010-01-31 00:00:00.000 Add -1 days (Subtract a day).&lt;br&gt;&lt;/pre&gt; &lt;p&gt;When you go smaller than a day you can find the &amp;quot;end&amp;quot; of a day by  using milliseconds* (SQL 2000/2005) or (if you use datetime2)  microseconds/nanoseconds (SQL 2008). It is very important to note when  doing this that the datetime data type is only accurate to 3 ms, not to  1. Subtracting 1 or 2ms here would do nothing as it would round back up  to the start of the next day. With Datetime you will only ever have  .990,.993 and .997 for ms. If you use datetime2 (available in SQL 2008),  you can be accurate to 100 ns. By default though, GETDATE() resolves to  a datetime data type and you have to cast/convert the value before you  can use mcs or ns with dateadd.&lt;/p&gt; &lt;pre class=&quot;brush: sql;&quot;&gt;SELECT DATEADD(ms,-3, DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0)) &lt;br&gt;--: 2010-02-26 23:59:59.997 End of the Previous Day(Datetime)&lt;br&gt;&lt;br&gt;SELECT DATEADD(ns,-100,CAST(DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0) as datetime2)) &lt;br&gt; --: 2010-02-26 23:59:59.9999999 End of the Previous Day (Datetime2)&lt;br&gt;&lt;/pre&gt; &lt;p&gt;While the above queries get you as close to the end of the day as  possible for the appropriate types, it is usually advised that you avoid  this all together whenever possible. For example, if you wanted all the  values for today&amp;#39;s date, instead of using &amp;gt;= the start of the day  and &amp;lt;= the end of the day, it is recommended that you use &amp;gt;= the  start of the day and &amp;lt; the start of tomorrow. This protects you in  situations where the types can become more accurate than you were taking  into account before. For instance, if datetime became accurate to 1ms  (or the field was changed to a datetime2 field) and you were using this  method, your queries would suddenly have the potential to miss data for  just under 2ms each day. &lt;/p&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;&lt;a href=&quot;http://www.cinehour.com&quot;&gt;www.cinehour.com&lt;/a&gt;&lt;br&gt; </content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/2554552305996226387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/2554552305996226387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2554552305996226387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2554552305996226387'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/04/date-manipulations-in-t-sql-queries.html' title='DATE MANIPULATIONS IN T-SQL QUERIES'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-936655300614353264</id><published>2010-04-02T17:45:00.001-07:00</published><updated>2010-04-02T17:45:22.468-07:00</updated><title type='text'>SEO LINK Building</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;The SEO Tutorial: Link Building 					 				 				&lt;br&gt;&lt;/div&gt; 				 				 				 				&lt;label class=&quot;tiny&quot;&gt; 					&lt;i&gt; 						Written by 						Samuel 						 in  						&lt;a href=&quot;http://www.wakeuplater.com/topic/seo.aspx&quot;&gt;SEO&lt;/a&gt; 						 					&lt;/i&gt; 				&lt;/label&gt; 				 				 				&lt;br&gt;&lt;br&gt; 				 				 				Search engines have always been the primary way of finding  information on the internet. And once upon a time, these search engines  were many and had names like Lycos, Altavista, and Hotbot. Furthermore,  these engines all worked very similarly, listing their results based  mostly on website content and keyword use. Of course, this made the  results fairly easy to manipulate -- you only had to stuff more keywords  in your meta tags and on your webpage. Then one day, a new search  engine arose, one with the curious name of Google. Google decided that  the current way of finding the best results was lacking. So they focused  on a new technique: they began looking at the links that came into your  website. Each link, they figured, was a &amp;quot;vote&amp;quot; for your site; the more  people that &amp;quot;voted&amp;quot; for your site, the more likely it was that your site  was useful and should be listed high in the results for the keywords  that linked to it. Thus began the rise of Google, as webmasters tried a  multiplicity of ways to get links to their site. A few years back, many  sites could manipulate this new link aspect simply by trading links with  hundreds of others. But as all smart companies do, Google adapted and  nowadays, all links to your site are analyzed to find out what quality  of &amp;quot;vote&amp;quot; each link is. In other words, the more quality links you get  to your site, the better your site does. So with that in mind, let&amp;#39;s  consider two points: first, what makes a quality link, and second, how  you get these links.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;What makes a quality link&lt;/b&gt;&lt;br&gt;Here  are a few key aspects of a good inbound link. Some of these aspects are  out of your control, but you can still improve how people choose to  link to you:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;How to get  quality links&lt;/b&gt;&lt;br&gt;So how do you get sites to link to you? Or rather,  how do you get &lt;b&gt;quality&lt;/b&gt; sites to link to you?&lt;br&gt;&lt;br&gt;&lt;b&gt;Directory  Links&lt;/b&gt; - This is the easiest way to get links, but perhaps the  worst. Do not submit your site to 200 directories -- those links are  usually worthless and associate your site with low-quality sites.  However, submitting your site to a few quality directories is advised  (you can sort of determine a site&amp;#39;s quality by their Alexa rating).  Directories like JoeAnt.com and BlogCatalog.com fall into this category  of &amp;quot;free high-quality directories.&amp;quot;&lt;br&gt;&lt;br&gt;&lt;b&gt;Social Links&lt;/b&gt; -  When you think you have a great piece of content, submit it to the  socialsphere -- sites like Digg, Reddit, &lt;a href=&quot;http://del.icio.us&quot;&gt;del.icio.us&lt;/a&gt;, StumpleUpon, and  any smaller social sites you know of. Don&amp;#39;t bank on hitting it big, but  you never know, and furthermore, you will still get a little traffic.  Also, on any forums or blogs you are active on, make sure your signature  file has a link. Just don&amp;#39;t become a forum/blog/comment spammer. It  doesn&amp;#39;t work, makes you and your site look bad, and takes away time from  building good links.&lt;br&gt;&lt;br&gt;&lt;b&gt;Ask for Links&lt;/b&gt; - If you have  friends online (and most people do), why not ask for a link? Most  people are kind enough to do so and it&amp;#39;s rather easy. It gets a bit  tougher when asking strangers for links, but if you have some sort of  &amp;quot;social link&amp;quot; (members of the same forum, similar website focus, etc.),  write a quick email asking for a link. If they like your content, they  might link to you -- just don&amp;#39;t ask them more than once and stay  transparent (anything else is usually insulting).&lt;br&gt;&lt;br&gt;&lt;b&gt;Pay  for Links&lt;/b&gt; - In recent years, this has become a popular mode of  link-building, although Google frowns upon it (and in a recent Page Rank  update, has punished various websites for participating). So proceed  with caution, but know that many people use this option. You just have  to search for &amp;quot;paid text links&amp;quot; to find a slew of services and  information. (There are exceptions to this rule: sites like Best of the  Web and Yahoo provide paid listing/reviews that actually do help you in  SEO.)&lt;br&gt;&lt;br&gt;&lt;b&gt;Link Bait&lt;/b&gt; - The current buzzword of  link-building, &amp;quot;link bait&amp;quot; is any content that gives people reason to  link to you. What makes good link bait? Contests, free stuff, great  articles (like &amp;quot;101 ways to _______&amp;quot;), or anything else people find  worth linking to. Of course, make sure your great idea gets in front of  people by utilizing the social websites and any contacts you might have  in the industry.&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;&lt;a href=&quot;http://www.cinehour.com&quot;&gt;www.cinehour.com&lt;/a&gt;&lt;br&gt; </content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/936655300614353264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/936655300614353264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/936655300614353264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/936655300614353264'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/04/seo-link-building.html' title='SEO LINK Building'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-2413682092693797768</id><published>2010-04-02T17:19:00.001-07:00</published><updated>2010-04-02T17:19:25.079-07:00</updated><title type='text'>High Quality Image Thumbnails in C#</title><content type='html'>&lt;font size=&quot;2&quot;&gt;&lt;span&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;strong&gt;Why it Happens?&lt;/strong&gt;&lt;/span&gt; &lt;br&gt;&lt;br&gt;Image  formats like jpeg may store the thumbnail inside the same file. If we  use &lt;strong&gt;System.Drawing.Bitmap&lt;/strong&gt; method &lt;strong&gt;GetThumbnailImage&lt;/strong&gt;,  method checks if there&#39;s a thumbnail image stored into the file and, if  the thumb is found, it returns that thumbnail version scaled to the  width and height you requested. If the thumbnail version of the image is  smaller then the size you requested to produce, thats when problem  occurs. The thumbnails produced become pixelated as we know stretching  an image to a larger once reduces the Image Quality. &lt;br&gt;&lt;br&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/span&gt; &lt;br&gt;&lt;br&gt;First  of all you will need to include the reference of following namespaces &lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt; &lt;div class=&quot;csharpcode&quot;&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Drawing;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Drawing.Design;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;/div&gt; &lt;p&gt;&lt;font size=&quot;2&quot;&gt;&lt;br&gt;&lt;span&gt;Use the following code to  create High Quality Thumbnail/Resize the image. &lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;div class=&quot;csharpcode&quot;&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; originalFilePath = &lt;span class=&quot;str&quot;&gt;&amp;quot;C:\\originalimage.jpg&amp;quot;&lt;/span&gt;; &lt;span class=&quot;rem&quot;&gt;//Replace with your image path&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;  &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; thumbnailFilePath = &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Empty;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;Size newSize = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Size(120,90); &lt;span class=&quot;rem&quot;&gt;// Thumbnail size (width = 120) (height = 90)&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (Bitmap bmp = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Bitmap(originalFilePath))&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;    thumbnailFilePath = &lt;span class=&quot;str&quot;&gt;&amp;quot;C:\\thumbnail.jpg&amp;quot;&lt;/span&gt;; &lt;span class=&quot;rem&quot;&gt;//Change the thumbnail path if you want&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (Bitmap thumb = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Bitmap((System.Drawing.Image)bmp, newSize))&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;        &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (Graphics g = Graphics.FromImage(thumb)) &lt;span class=&quot;rem&quot;&gt;// Create Graphics object from original Image&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;        {&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            &lt;span class=&quot;rem&quot;&gt;//Set Image codec of JPEG type, the index of JPEG codec is &amp;quot;1&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            System.Drawing.Imaging.ImageCodecInfo codec = System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders()[1];&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            &lt;span class=&quot;rem&quot;&gt;//Set the parameters for defining the quality of the thumbnail... here it is set to 100%&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            System.Drawing.Imaging.EncoderParameters eParams = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; System.Drawing.Imaging.EncoderParameters(1);&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            eParams.Param[0] = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L);&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            &lt;span class=&quot;rem&quot;&gt;//Now draw the image on the instance of thumbnail Bitmap object&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            g.DrawImage(bmp, &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Rectangle(0, 0, thumb.Width, thumb.Height));&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;            thumb.Save(thumbnailFilePath, codec, eParams);&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;pre class=&quot;alt&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt; &lt;/div&gt;&lt;font size=&quot;2&quot;&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;&lt;a href=&quot;http://www.cinehour.com&quot;&gt;www.cinehour.com&lt;/a&gt;&lt;br&gt;&lt;/font&gt; </content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/2413682092693797768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/2413682092693797768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2413682092693797768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/2413682092693797768'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/04/high-quality-image-thumbnails-in-c.html' title='High Quality Image Thumbnails in C#'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-8205097801711289802</id><published>2010-03-28T18:22:00.001-07:00</published><updated>2010-03-28T18:22:45.335-07:00</updated><title type='text'>Code to retrieve distinct fields from table</title><content type='html'>&lt;br&gt;with t1 as &lt;br&gt;(select top 1000 * from photogallery where category&amp;lt;&amp;gt;&amp;#39;movieposters&amp;#39; and category&amp;lt;&amp;gt;&amp;#39;others&amp;#39; &lt;br&gt;and category&amp;lt;&amp;gt;&amp;#39;spicy&amp;#39; order by cid desc)&lt;br&gt;&lt;br&gt;select distinct top 5 name from t1&lt;br clear=&quot;all&quot;&gt; &lt;br&gt;-- &lt;br&gt;R Chakrapani Raju &lt;br&gt;Web Programmer&lt;br&gt;Alip Infotech Pvt Ltd&lt;br&gt;&lt;a href=&quot;http://www.cinehour.com&quot;&gt;www.cinehour.com&lt;/a&gt;&lt;br&gt; </content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/8205097801711289802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/8205097801711289802' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8205097801711289802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8205097801711289802'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/03/code-to-retrieve-distinct-fields-from.html' title='Code to retrieve distinct fields from table'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-8275294661646921771</id><published>2010-03-20T17:48:00.001-07:00</published><updated>2010-03-20T17:48:38.341-07:00</updated><title type='text'>Paragraph Trim function</title><content type='html'>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CCHAKRA%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt; &lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;Trim your paragraph to limited number of words. A very useful function for designing text based websites like news or articles archives or list.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt; &lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot;&gt;protected&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; paraTrim(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Input, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; no_of_words)&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;// split input string into words (max 21...last words go in last element)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt;[] Words = Input.Split(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;char&lt;/span&gt;[] { &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt; }, no_of_words);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;// if we reach maximum words, replace last words with elipse&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (Words.Length == no_of_words)&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;Words[no_of_words - 1] = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;...&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;   &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; Input;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;// nothing to do&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;// build new output string&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt; Output = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt;.Join(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;, Words);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; Output;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;br&gt; </content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/8275294661646921771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/8275294661646921771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8275294661646921771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8275294661646921771'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/03/paragraph-trim-function.html' title='Paragraph Trim function'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-8046356764073448631</id><published>2010-03-15T22:42:00.000-07:00</published><updated>2010-03-15T22:43:15.868-07:00</updated><title type='text'>IIS URL Rewriting</title><content type='html'>IIS URL Rewriting&lt;br /&gt;&lt;br /&gt;When a client makes a request to the Web server for a particular URL, the URL-rewriting component analyzes the requested URL and changes it to a different other URL on the same server. The URL-rewriting component runs very early in the request processing pipeline, so is able to modify the requested URL before the Web server makes a decision about which handler to use for processing the request.&lt;br /&gt;&lt;br /&gt;IIS URL Rewriting&lt;br /&gt;ASP.NET Routing&lt;br /&gt;&lt;br /&gt;ASP.NET routing is implemented as a managed-code module that plugs into the IIS request processing pipeline at the Resolve Cache stage (PostResolveRequestCache event) and at the Map Handler stage (PostMapRequestHandler). ASP.NET routing is configured to run for all requests made to the Web application.&lt;br /&gt;&lt;br /&gt;IIS URL Routing&lt;br /&gt;&lt;br /&gt;Differences between URL rewriting and ASP.NET routing:&lt;br /&gt;&lt;br /&gt;   1. URL rewriting is used to manipulate URL paths before the request is handled by the Web server. The URL-rewriting module does not know anything about what handler will eventually process the rewritten URL. In addition, the actual request handler might not know that the URL has been rewritten.&lt;br /&gt;   2. ASP.NET routing is used to dispatch a request to a handler based on the requested URL path. As opposed to URL rewriting, the routing component knows about handlers and selects the handler that should generate a response for the requested URL. You can think of ASP.NET routing as an advanced handler-mapping mechanism.&lt;br /&gt;&lt;br /&gt;In addition to these conceptual differences, there are some functional differences between IIS URL rewriting and ASP.NET routing:&lt;br /&gt;&lt;br /&gt;   1. The IIS URL-rewrite module can be used with any type of Web application, which includes ASP.NET, PHP, ASP, and static files. ASP.NET routing can be used only with .NET Framework-based Web applications.&lt;br /&gt;   2. The IIS URL-rewrite module works the same way regardless of whether integrated or classic IIS pipeline mode is used for the application pool. For ASP.NET routing, it is preferable to use integrated pipeline mode. ASP.NET routing can work in classic mode, but in that case the application URLs must include file extensions or the application must be configured to use &quot;*&quot; handler mapping in IIS.&lt;br /&gt;   3. The URL-rewrite module can make rewriting decisions based on domain names, HTTP headers, and server variables. By default, ASP.NET routing works only with URL paths and with the HTTP-Method header.&lt;br /&gt;   4. In addition to rewriting, the URL-rewrite module can perform HTTP redirection, issue custom status codes, and abort requests. ASP.NET routing does not perform those tasks.&lt;br /&gt;   5. The URL-rewrite module is not extensible in its current version. ASP.NET routing is fully extensible and customizable.</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/8046356764073448631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/8046356764073448631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8046356764073448631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/8046356764073448631'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/03/iis-url-rewriting.html' title='IIS URL Rewriting'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-7405964209066867901</id><published>2010-03-02T20:07:00.000-08:00</published><updated>2010-03-02T20:08:34.619-08:00</updated><title type='text'>Create thumbnails for images  in c#,Image size reduction, Decrease the size of images in c#</title><content type='html'>public byte[] imagereduce(System.Drawing.Image imgInput, int maxImageSize)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;int tWidth;&lt;br /&gt;int tHeight;&lt;br /&gt;double widthHeightRatio = (double)imgInput.Width / (double)imgInput.Height;&lt;br /&gt;// If width greater than height, then width should be max image size, otherwise height should be.&lt;br /&gt;// Image should keep the same proportions.&lt;br /&gt;//tWidth = maxImageSize;&lt;br /&gt;//tHeight = (int)(maxImageSize / widthHeightRatio);&lt;br /&gt;if (widthHeightRatio &gt; 1.0)&lt;br /&gt;{&lt;br /&gt;tWidth = maxImageSize;&lt;br /&gt;tHeight = (int)(maxImageSize / widthHeightRatio);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;tWidth = (int)(maxImageSize * widthHeightRatio);&lt;br /&gt;tHeight = maxImageSize;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Session[&quot;imgheight&quot;] = tHeight;&lt;br /&gt;//Session[&quot;imgwidth&quot;] = tWidth;&lt;br /&gt;&lt;br /&gt;System.Drawing.Image.GetThumbnailImageAbort myCallBack = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);&lt;br /&gt;&lt;br /&gt;System.Drawing.Image myThumbnail = imgInput.GetThumbnailImage(tWidth, tHeight, myCallBack, IntPtr.Zero);&lt;br /&gt;//myThumbnail.Save(Server.MapPath(sSavePath + sThumbFile));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System.IO.MemoryStream ms = new System.IO.MemoryStream();&lt;br /&gt;myThumbnail.Save(ms, ImageFormat.Jpeg);&lt;br /&gt;byte[] bitmapData = ms.ToArray();&lt;br /&gt;return bitmapData;&lt;br /&gt;}&lt;br /&gt;public bool ThumbnailCallback()&lt;br /&gt;{&lt;br /&gt;return false;&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/7405964209066867901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/7405964209066867901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/7405964209066867901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/7405964209066867901'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/03/create-thumbnails-for-images-in-cimage.html' title='Create thumbnails for images  in c#,Image size reduction, Decrease the size of images in c#'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-6853689275317895163</id><published>2010-03-02T20:05:00.000-08:00</published><updated>2010-03-02T20:06:56.393-08:00</updated><title type='text'>Customized Message pop up Box in c# for websites</title><content type='html'>It gives you a pop up msgbox to show error messages or any alerts.&lt;br /&gt;&lt;br /&gt;public Label msgbox(string text)&lt;br /&gt;{&lt;br /&gt;Label lbl = new Label();&lt;br /&gt;lbl.Text = &quot;&lt;script language=&#39;javascript&#39;&gt;&quot; + Environment.NewLine&lt;br /&gt;+ &quot;window.alert(&#39;&quot; + text + &quot;&#39;)&lt;/script&gt;&quot;;&lt;br /&gt;return (lbl);&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/6853689275317895163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/6853689275317895163' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6853689275317895163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6853689275317895163'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2010/03/customized-message-pop-up-box-in-c-for.html' title='Customized Message pop up Box in c# for websites'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-4005465661948311326</id><published>2009-12-04T02:52:00.001-08:00</published><updated>2009-12-04T02:53:05.696-08:00</updated><title type='text'>Tips on Web Hosting for High traffic websites</title><content type='html'>A high traffic web hosting plan is a plan that offers a very large amount of bandwidth and disk space and is suited for very busy sites where a lot of data is being added and retrieved.&lt;br /&gt; &lt;br /&gt;A site with a lot of videos or high resolution photographs or a very active forum where messages are being posted all day long are prefect examples of web sites that could benefit from a high traffic hosting plan.&lt;br /&gt; &lt;br /&gt;A hosting plan with high allowance for space and bandwidth will also prevent that shock of logging on to your web site and realizing that your site has been suspended for going for a bandwidth limit.&lt;br /&gt; &lt;br /&gt;If that happens you either have to upgrade your account or pay extra to get the site online again or wait until a new month begins. Either way, visitors to your site will be turned off and may never return if they see your site is down.&lt;br /&gt;&lt;br /&gt;What sites are appropriate for a high traffic plan?&lt;br /&gt;A site offering videos or high resolution photos.&lt;br /&gt;A very active message forum&lt;br /&gt;Any site that with a large number of daily visitors and pageviews&lt;br /&gt;Any combination of the above!</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/4005465661948311326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/4005465661948311326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/4005465661948311326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/4005465661948311326'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2009/12/tips-on-web-hosting-for-high-traffic.html' title='Tips on Web Hosting for High traffic websites'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-6738420649071383250</id><published>2009-12-04T02:52:00.000-08:00</published><updated>2009-12-04T02:54:55.888-08:00</updated><title type='text'>Tips on Web Hosting for High traffic websites</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/6738420649071383250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/6738420649071383250' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6738420649071383250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/6738420649071383250'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2009/12/tips-on-web-hosting-for-high-traffic_04.html' title='Tips on Web Hosting for High traffic websites'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7636731657540574947.post-1241311440494534573</id><published>2009-12-04T02:47:00.000-08:00</published><updated>2009-12-04T02:48:19.399-08:00</updated><title type='text'>Simple Changes Doubled My Adsense Revenue</title><content type='html'>Several simple changes in my Adsense approach and layout have almost doubled my blog’s revenue. The results were so drastic and eye opening that I convinced a friend (www.oneprojectcloser.com) to make the same changes to his blog with even better results. The changes involve two simple ideas that can be easily incorporated into any Adsense monetized website or blog.&lt;br /&gt;&lt;br /&gt;I’ve been blogging for over two years now and growing traffic, authority and readership slow and steady. Along with the steady increase in traffic the site has continued to increase it’s Adsense revenue at a similar pace with no sudden increases regardless of all the changes and adjustments I’ve made. That was true until I took the time to study many different published Adsense approaches. As I read all of these different approaches three distinct ideas came to the forefront.&lt;br /&gt;&lt;br /&gt;Three Important Adsense Approaches&lt;br /&gt;&lt;br /&gt;Less is More – This concept is really simple yet I hadn’t really given it much thought before. First off the top ad is the highest paying ad and you want that in the best possible position.&lt;br /&gt;Secondly, if you’re using all three of the allotted Adsense units on a given page then there are quite a few ads all competing for attention or a click through. However, if you only use one Adsense unit then you’re limiting the number of ads served and improving the likelihood that one of those ads will get clicked. Therefore, the theory is that an advertiser will be willing to pay a higher rate for less competition.&lt;br /&gt;&lt;br /&gt;Size Matters – If you read enough Adsense guides you’ll find that the 336 x 280 Large Rectangle is the most effective Adsense unit. It typically offers four ads and they are likely to be very related to the topic based on the position between the post title and body.&lt;br /&gt;Position, Position, Position – Placing your Adsense unit above the fold is imperative for success. This makes sense to me for one reason. Every day my site (and I assume most sites) gets a majority of it’s traffic from search engines. This traffic is generated from people searching for something. So when they land on my page and they decide that it’s not the content they were looking for then I want them to see the Adsense unit right where they land so that becomes an “outclick” option.&lt;br /&gt;How I Doubled My Adsense Revenue&lt;br /&gt;&lt;br /&gt;In order to understand the approach I used to double my Adsense revenue I’ll use two graphics that show the same post before the changes and after the changes. First – the before shot:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My Old Adsense Layout Included:&lt;br /&gt;&lt;br /&gt;468 x 60 Text Only Unit located in the header area of my page.&lt;br /&gt;468 x 60 Text Only Unit located between the post title and the body of the post.&lt;br /&gt;468 x 60 Text Only Unit located at the end of the post before the comment section.&lt;br /&gt;Revised Adsense Layout Includes:&lt;br /&gt;&lt;br /&gt;Remove the old 468 x 60 Text Only Unit completely and replaced with an affiliate banner. The idea here is to remove some of the units in order to address concept #1 of Less is More.&lt;br /&gt;Replace the old 468 x 60 Text Only Unit with the 336 x 280 large rectangle unit. This unit is above the fold between the post title and body which makes it a very prominent position. This change addresses both of concept #2 and #3 for Size Matters and Position.&lt;br /&gt;Remove the old 468 x 60 Text Only Unit completely. I actually replaced this with the new Chitika Jumbo unit which is also performing quite well. Again the removal helps address the Less is More concept.</content><link rel='replies' type='application/atom+xml' href='http://geeksofweb.blogspot.com/feeds/1241311440494534573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7636731657540574947/1241311440494534573' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/1241311440494534573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7636731657540574947/posts/default/1241311440494534573'/><link rel='alternate' type='text/html' href='http://geeksofweb.blogspot.com/2009/12/simple-changes-doubled-my-adsense.html' title='Simple Changes Doubled My Adsense Revenue'/><author><name>CinemaFan</name><uri>http://www.blogger.com/profile/01240788935038621545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>