<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5019357135976515718</id><updated>2011-12-27T17:59:28.789+05:30</updated><category term='EBooks on .NET'/><category term='Sharepoint Video Tutorials'/><category term='Adobe Flex'/><category term='EBooks on Javascript'/><category term='SQL Server 2008'/><category term='Javascript'/><category term='Images'/><category term='SQL Server'/><category term='Others'/><category term='ASP.NET Tips and Tracks'/><category term='Visual Studio 2010'/><category term='ASP.NET'/><category term='C#'/><category term='Visual Studio 2008'/><category term='Sharepoint Template'/><category term='Cost Estimation'/><category term='WCF'/><category term='Sharepoint'/><category term='XSLT Tutorials'/><category term='WWF'/><category term='Miscellaneous'/><category term='EBooks on SQL Server'/><category term='Application Architecture'/><category term='Icons'/><category term='A Sitemap'/><title type='text'>Portal And Content Management</title><subtitle type='html'>This site contains information of .NET,Sharepoint,C#,SQL Server,MOSS,WSS,WWF,WCF,WPF,AJAX,Javascript and Adobe Flex.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default?start-index=101&amp;max-results=100'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>223</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-401940266721572832</id><published>2011-02-24T08:14:00.007+05:30</published><updated>2011-04-24T14:27:38.818+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Create a List event receiver feature</title><content type='html'>Step 1-Create a class library project "EventReceiverFeature" and add reference the dll as follows-&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-79XWxXLKXfw/TWXHVr4hKCI/AAAAAAAABW4/V-CFi4RFdJU/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 249px; height: 263px;" src="http://3.bp.blogspot.com/-79XWxXLKXfw/TWXHVr4hKCI/AAAAAAAABW4/V-CFi4RFdJU/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5577082888939186210" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 2-Create a custom list "EventReceiverList" and a Column "Company" (Single line of text)&lt;br /&gt;&lt;br /&gt;Step 3-Feature.xml will be as follows-&lt;br /&gt;&amp;lt;Feature xmlns="http://schemas.microsoft.com/sharepoint/"&lt;br /&gt;         Id="82540374-276A-458b-BB6C-B605D35E8DD6"&lt;br /&gt;         Title="List Event Receiver Feature"&lt;br /&gt;         Description="This is my Event Receiver feature"&lt;br /&gt;         Hidden="false"&lt;br /&gt;         Scope="Web"&lt;br /&gt;         ImageUrl="menuprofile.gif"&lt;br /&gt;         ReceiverClass="EventReceiverFeature.FeatureReceiver"&lt;br /&gt;         ReceiverAssembly="EventReceiverFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d"&lt;br /&gt;         &amp;gt;&lt;br /&gt; &amp;lt;/Feature&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 4-"FeatureReceiver.cs" will be as follows-&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;&lt;br /&gt;namespace EventReceiverFeature&lt;br /&gt;{&lt;br /&gt;    class FeatureReceiver : SPFeatureReceiver &lt;br /&gt;    {&lt;br /&gt;        public override void FeatureActivated(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;            // access SPSite object for current site collection&lt;br /&gt;           // SPSite siteCollection = (SPSite)properties.Feature.Parent;&lt;br /&gt;            SPWeb web = (SPWeb)properties.Feature.Parent;&lt;br /&gt;            SPList lstVendors = web.Lists["EventReceiverList"];&lt;br /&gt;            // add event handlers to vendors list&lt;br /&gt;            string asmName = "EventReceiverFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d";&lt;br /&gt;            string itemReceiverName = "EventReceiverFeature.ListItemEventReceiver";&lt;br /&gt;&lt;br /&gt;            // add event receiver to fire before existing item is deleted&lt;br /&gt;            lstVendors.EventReceivers.Add(SPEventReceiverType.ItemAdded,&lt;br /&gt;                                          asmName,&lt;br /&gt;                                          itemReceiverName);&lt;br /&gt;&lt;br /&gt;            // add event receiver to fire before existing item is deleted&lt;br /&gt;            lstVendors.EventReceivers.Add(SPEventReceiverType.ItemUpdated,&lt;br /&gt;                                          asmName,&lt;br /&gt;                                          itemReceiverName);&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            string asmName = "EventReceiverFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d";&lt;br /&gt;&lt;br /&gt;            using (SPWeb web = (SPWeb)properties.Feature.Parent)&lt;br /&gt;            {&lt;br /&gt;                SPDocumentLibrary proposals = (SPDocumentLibrary)web.Lists["EventReceiverList"];&lt;br /&gt;                SPEventReceiverDefinitionCollection erdc = proposals.EventReceivers;&lt;br /&gt;                SPEventReceiverDefinition erd = null;&lt;br /&gt;                bool found = false;&lt;br /&gt;&lt;br /&gt;                for (int i = 0; i &amp;lt; erdc.Count; ++i)&lt;br /&gt;                {&lt;br /&gt;                    erd = erdc[i]; &lt;br /&gt;                    if (erd.Assembly == asmName &amp;&amp; ((erd.Type == SPEventReceiverType.ItemAdded)||(erd.Type==SPEventReceiverType.ItemUpdated)))&lt;br /&gt;                    {&lt;br /&gt;                        found = true;&lt;br /&gt;                        break;&lt;br /&gt;                    }&lt;br /&gt;                } if (found)&lt;br /&gt;                    erd.Delete();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureInstalled(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            //throw new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;           // throw new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 5-"ListItemEventReceiver.cs" will be as foll0ws-&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;&lt;br /&gt;namespace EventReceiverFeature&lt;br /&gt;{&lt;br /&gt;    public class ListItemEventReceiver:SPItemEventReceiver&lt;br /&gt;    {&lt;br /&gt;        private string FormatCompanyName(string value)&lt;br /&gt;        {&lt;br /&gt;            return value.ToUpper();&lt;br /&gt;        }&lt;br /&gt;        public override void ItemAdded(SPItemEventProperties properties)&lt;br /&gt;        {&lt;br /&gt;            UpperFormat(properties);&lt;br /&gt;        }&lt;br /&gt;        public override void ItemUpdated(SPItemEventProperties properties)&lt;br /&gt;        {&lt;br /&gt;            UpperFormat(properties);&lt;br /&gt;        }&lt;br /&gt;        public void UpperFormat(SPItemEventProperties properties)&lt;br /&gt;        {&lt;br /&gt;            DisableEventFiring();&lt;br /&gt;            //SPListItemCollection col=SPContext.Current.Web.Lists[properties.ListTitle].Items.Count&lt;br /&gt;            //(SPSite(properties.SiteId).OpenWeb(properties.lists.RelativeWebUrl))&lt;br /&gt;            &lt;br /&gt;            //for (int i = 0; i &amp;lt; SPContext.Current.Web.Lists[properties.ListTitle].Items.Count; i++)&lt;br /&gt;            //{&lt;br /&gt;            //    properties.ListItem[i] = FormatCompanyName(properties.ListItem[i+1].ToString());&lt;br /&gt;            //    properties.ListItem.Update();&lt;br /&gt;            //}&lt;br /&gt;            string CompanyName = properties.ListItem["Company"].ToString();&lt;br /&gt;            properties.ListItem["Company"] = FormatCompanyName(CompanyName);&lt;br /&gt;            properties.ListItem.Update();&lt;br /&gt;            EnableEventFiring();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 6-Copy the dll to the GAC&lt;br /&gt;&lt;br /&gt;Step 7-Copy the EventReceiverFeature to the feature folder and activate the feature-&lt;br /&gt;&lt;br /&gt;Step 8-Now add New Item to your list in Any case(Upper/Lower) and click OK&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-9dqrOTWLTvo/TWXMKBA-b6I/AAAAAAAABXA/FPsrKnlvVyQ/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 146px;" src="http://2.bp.blogspot.com/-9dqrOTWLTvo/TWXMKBA-b6I/AAAAAAAABXA/FPsrKnlvVyQ/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5577088186011512738" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 9-The output will be as follows-&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-PtDc_04eFVI/TWXNoFvUwsI/AAAAAAAABXI/Fl-HtlYnA_4/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 86px;" src="http://4.bp.blogspot.com/-PtDc_04eFVI/TWXNoFvUwsI/AAAAAAAABXI/Fl-HtlYnA_4/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5577089802187358914" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-401940266721572832?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/401940266721572832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=401940266721572832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/401940266721572832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/401940266721572832'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2011/02/create-list-event-receiver-feature.html' title='Create a List event receiver feature'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-79XWxXLKXfw/TWXHVr4hKCI/AAAAAAAABW4/V-CFi4RFdJU/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-3097617240083663620</id><published>2011-02-24T07:26:00.007+05:30</published><updated>2011-04-24T14:27:38.821+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Create a custom Field in Sharepoint 2007</title><content type='html'>Step 1-Create a class libary Project "CustomField_TelephoneNumber"&lt;br /&gt;&lt;br /&gt;Step 2--Create the folder structure and add reference as follows-&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-JT-uGNhh8vQ/TWW91a7naAI/AAAAAAAABWg/-qlyHBRVQjo/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 242px; height: 301px;" src="http://4.bp.blogspot.com/-JT-uGNhh8vQ/TWW91a7naAI/AAAAAAAABWg/-qlyHBRVQjo/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5577072439028312066" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 3-"TelephoneFieldControl.ascx" will be as follows-&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Control Language="C#" Debug="true" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"&lt;br /&gt;    Namespace="Microsoft.SharePoint.WebControls" %&amp;gt;&lt;br /&gt;&amp;lt;SharePoint:RenderingTemplate ID="TelephoneFieldControl" runat="server"&amp;gt;&lt;br /&gt;    &amp;lt;Template&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;script language="javascript"&amp;gt;&lt;br /&gt;&amp;lt;!-- This script is based on the javascript code of Roman Feldblum (web.developer@programmer.net) --&amp;gt;&lt;br /&gt;&amp;lt;!-- Original script : http://javascript.internet.com/forms/format-phone-number.html --&amp;gt;&lt;br /&gt;&amp;lt;!-- Original script is revised by Eralper Yilmaz (http://www.eralper.com) --&amp;gt;&lt;br /&gt;&amp;lt;!-- Revised script : http://www.kodyaz.com --&amp;gt;&lt;br /&gt;&lt;br /&gt;var zChar = new Array(' ', '(', ')', '-', '.');&lt;br /&gt;var maxphonelength = 13;&lt;br /&gt;var phonevalue1;&lt;br /&gt;var phonevalue2;&lt;br /&gt;var cursorposition;&lt;br /&gt;&lt;br /&gt;function ParseForNumber1(object){&lt;br /&gt;phonevalue1 = ParseChar(object.value, zChar);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function ParseForNumber2(object){&lt;br /&gt;phonevalue2 = ParseChar(object.value, zChar);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function backspacerUP(object,e) { &lt;br /&gt;if(e){ &lt;br /&gt;e = e &lt;br /&gt;} else {&lt;br /&gt;e = window.event &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;if(e.which){ &lt;br /&gt;var keycode = e.which &lt;br /&gt;} else {&lt;br /&gt;var keycode = e.keyCode &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ParseForNumber1(object)&lt;br /&gt;if(keycode &amp;gt; 48){&lt;br /&gt;ValidatePhone(object)&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function backspacerDOWN(object,e) { &lt;br /&gt;if(e){ &lt;br /&gt;e = e &lt;br /&gt;} else {&lt;br /&gt;e = window.event &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;if(e.which){ &lt;br /&gt;var keycode = e.which &lt;br /&gt;} else {&lt;br /&gt;var keycode = e.keyCode &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ParseForNumber2(object)&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;function GetCursorPosition(){&lt;br /&gt;var t1 = phonevalue1;&lt;br /&gt;var t2 = phonevalue2;&lt;br /&gt;var bool = false&lt;br /&gt;for (i=0; i&amp;lt;t1.length; i++)&lt;br /&gt;{&lt;br /&gt;if (t1.substring(i,1) != t2.substring(i,1)) {&lt;br /&gt;if(!bool) {&lt;br /&gt;cursorposition=i&lt;br /&gt;bool=true&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;function ValidatePhone(object){&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;var p = phonevalue1&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;p = p.replace(/[^\d]*/gi,"")&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;if (p.length &amp;lt; 3) {&lt;br /&gt;&lt;br /&gt;object.value=p&lt;br /&gt;&lt;br /&gt;} else if(p.length==3){&lt;br /&gt;&lt;br /&gt;pp=p;&lt;br /&gt;&lt;br /&gt;d4=p.indexOf('(')&lt;br /&gt;&lt;br /&gt;d5=p.indexOf(')')&lt;br /&gt;&lt;br /&gt;if(d4==-1){&lt;br /&gt;&lt;br /&gt;pp="("+pp;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(d5==-1){&lt;br /&gt;&lt;br /&gt;pp=pp+")";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;object.value = pp;&lt;br /&gt;&lt;br /&gt;} else if(p.length&amp;gt;3 &amp;&amp; p.length &amp;lt; 7){&lt;br /&gt;&lt;br /&gt;p ="(" + p; &lt;br /&gt;&lt;br /&gt;l30=p.length;&lt;br /&gt;&lt;br /&gt;p30=p.substring(0,4);&lt;br /&gt;&lt;br /&gt;p30=p30+")"&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;p31=p.substring(4,l30);&lt;br /&gt;&lt;br /&gt;pp=p30+p31;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;object.value = pp; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;} else if(p.length &amp;gt;= 7){&lt;br /&gt;&lt;br /&gt;p ="(" + p; &lt;br /&gt;&lt;br /&gt;l30=p.length;&lt;br /&gt;&lt;br /&gt;p30=p.substring(0,4);&lt;br /&gt;&lt;br /&gt;p30=p30+")"&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;p31=p.substring(4,l30);&lt;br /&gt;&lt;br /&gt;pp=p30+p31;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;l40 = pp.length;&lt;br /&gt;&lt;br /&gt;p40 = pp.substring(0,8);&lt;br /&gt;&lt;br /&gt;p40 = p40 + "-"&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;p41 = pp.substring(8,l40);&lt;br /&gt;&lt;br /&gt;ppp = p40 + p41;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;object.value = ppp.substring(0, maxphonelength);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;GetCursorPosition()&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;if(cursorposition &amp;gt;= 0){&lt;br /&gt;&lt;br /&gt;if (cursorposition == 0) {&lt;br /&gt;&lt;br /&gt;cursorposition = 2&lt;br /&gt;&lt;br /&gt;} else if (cursorposition &amp;lt;= 2) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition + 1&lt;br /&gt;&lt;br /&gt;} else if (cursorposition &amp;lt;= 5) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition + 2&lt;br /&gt;&lt;br /&gt;} else if (cursorposition == 6) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition + 2&lt;br /&gt;&lt;br /&gt;} else if (cursorposition == 7) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition + 4&lt;br /&gt;&lt;br /&gt;e1=object.value.indexOf(')')&lt;br /&gt;&lt;br /&gt;e2=object.value.indexOf('-')&lt;br /&gt;&lt;br /&gt;if (e1&amp;gt;-1 &amp;&amp; e2&amp;gt;-1){&lt;br /&gt;&lt;br /&gt;if (e2-e1 == 4) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition - 1&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;} else if (cursorposition &amp;lt; 11) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition + 3&lt;br /&gt;&lt;br /&gt;} else if (cursorposition == 11) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition + 1&lt;br /&gt;&lt;br /&gt;} else if (cursorposition &amp;gt;= 12) {&lt;br /&gt;&lt;br /&gt;cursorposition = cursorposition&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;var txtRange = object.createTextRange();&lt;br /&gt;&lt;br /&gt;txtRange.moveStart( "character", cursorposition);&lt;br /&gt;&lt;br /&gt;txtRange.moveEnd( "character", cursorposition - object.value.length);&lt;br /&gt;&lt;br /&gt;txtRange.select();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;function ParseChar(sStr, sChar)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (sChar.length == null) &lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;zChar = new Array(sChar);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else zChar = sChar;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;for (i=0; i&amp;lt;zChar.length; i++)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;sNewStr = "";&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;var iStart = 0;&lt;br /&gt;&lt;br /&gt;var iEnd = sStr.indexOf(sChar[i]);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;while (iEnd != -1)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;sNewStr += sStr.substring(iStart, iEnd);&lt;br /&gt;&lt;br /&gt;iStart = iEnd + 1;&lt;br /&gt;&lt;br /&gt;iEnd = sStr.indexOf(sChar[i], iStart);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sNewStr += sStr.substring(sStr.lastIndexOf(sChar[i]) + 1, sStr.length);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;sStr = sNewStr;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;return sNewStr;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;        &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:TextBox ID="txtNumber" runat="server" MaxLength="15" Size="20" onkeydown="javascript:backspacerDOWN(this,event);"&lt;br /&gt;            onkeyup="javascript:backspacerUP(this,event);" /&amp;gt;&lt;br /&gt;    &amp;lt;/Template&amp;gt;&lt;br /&gt;&amp;lt;/SharePoint:RenderingTemplate&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 4-"FLDTYPES_Telephone.xml" will be as follows-&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;FieldTypes&amp;gt;&lt;br /&gt;  &amp;lt;FieldType&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="TypeName"&amp;gt;PhoneNumber&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="ParentType"&amp;gt;Text&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="TypeDisplayName"&amp;gt;Phone Number&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="TypeShortDescription"&amp;gt;Phone Number&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="UserCreatable"&amp;gt;TRUE&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="ShowInListCreate"&amp;gt;TRUE&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="ShowInSurveyCreate"&amp;gt;TRUE&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="ShowInDocumentLibraryCreate"&amp;gt;TRUE&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="ShowInColumnTemplateCreate"&amp;gt;TRUE&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;Field Name="FieldTypeClass"&amp;gt;CustomField_TelephoneNumber.TelephoneField,CustomField_TelephoneNumber, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d&amp;lt;/Field&amp;gt;&lt;br /&gt;    &amp;lt;!-- We will implement this later to add display formating for the fields value. ie (xxx)xxx-xxxx&lt;br /&gt;    &amp;lt;RenderPattern Name="DisplayPattern"&amp;gt;&lt;br /&gt;      &amp;lt;Switch&amp;gt;&lt;br /&gt;        &amp;lt;Expr&amp;gt;&lt;br /&gt;          &amp;lt;Column /&amp;gt;&lt;br /&gt;        &amp;lt;/Expr&amp;gt;&lt;br /&gt;        &amp;lt;Case Value="" /&amp;gt;&lt;br /&gt;        &amp;lt;Default&amp;gt;&lt;br /&gt;          &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[^]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;          &amp;lt;Column HTMLEncode="TRUE" /&amp;gt;&lt;br /&gt;        &amp;lt;/Default&amp;gt;&lt;br /&gt;      &amp;lt;/Switch&amp;gt;&lt;br /&gt;    &amp;lt;/RenderPattern&amp;gt;&lt;br /&gt;    --&amp;gt;&lt;br /&gt;  &amp;lt;/FieldType&amp;gt;&lt;br /&gt;&amp;lt;/FieldTypes&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 5-"TelephoneField.cs" will be as follows-&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using System.Text.RegularExpressions;&lt;br /&gt;&lt;br /&gt;namespace CustomField_TelephoneNumber&lt;br /&gt;{&lt;br /&gt;    //Should inherit from an existing SPField class&lt;br /&gt;    public class TelephoneField : SPFieldText&lt;br /&gt;    {&lt;br /&gt;        #region Contstructors&lt;br /&gt;        public TelephoneField(SPFieldCollection fields, string fieldName)&lt;br /&gt;            : base(fields, fieldName)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        public TelephoneField(Microsoft.SharePoint.SPFieldCollection fields, string typeName, string displayName)&lt;br /&gt;            : base(fields, typeName, displayName)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;        &lt;br /&gt;        public override Microsoft.SharePoint.WebControls.BaseFieldControl FieldRenderingControl&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                Microsoft.SharePoint.WebControls.BaseFieldControl phoneNumberFieldControl = new TelephoneFieldControl();&lt;br /&gt;                phoneNumberFieldControl.FieldName = InternalName;&lt;br /&gt;                return phoneNumberFieldControl;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        /// &amp;lt;summary&amp;gt;&lt;br /&gt;        /// This method validates the data as it is entered into the column. If it doesnt match the criteria a sharepoint exception is thrown.&lt;br /&gt;        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;        /// &amp;lt;param name="value"&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;        public override string GetValidatedString(object value)&lt;br /&gt;        {&lt;br /&gt;            string myVal = value as string;&lt;br /&gt;            if (myVal == null)&lt;br /&gt;                return String.Empty;&lt;br /&gt;&lt;br /&gt;            //Strip formating characters from the value..&lt;br /&gt;            myVal = myVal.Replace("(", "");&lt;br /&gt;            myVal = myVal.Replace(")", "");&lt;br /&gt;            myVal = myVal.Replace("-", "");&lt;br /&gt;            myVal = myVal.Replace("+", "");&lt;br /&gt;            myVal = myVal.Replace(" ", "");&lt;br /&gt;            myVal = myVal.Trim();&lt;br /&gt;&lt;br /&gt;            //Use regex to makes the string only contains numbers and is within the correct range.&lt;br /&gt;            Regex foo = new Regex("^\\d{10,11}$");&lt;br /&gt;            if (foo.IsMatch(myVal))&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                throw new Microsoft.SharePoint.SPFieldValidationException("The Telephone number field must contain only numbers, (, ), -, or + characters. It must also be between 10 and 11 digits. val:" + myVal);&lt;br /&gt;            }&lt;br /&gt;            return myVal;&lt;br /&gt;        }&lt;br /&gt;        /// &amp;lt;summary&amp;gt;&lt;br /&gt;        /// Here we can apply formating to our number that will show up on the edit page.&lt;br /&gt;        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;        /// &amp;lt;param name="value"&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;        public override object GetFieldValue(string value)&lt;br /&gt;        {&lt;br /&gt;            if (String.IsNullOrEmpty(value))&lt;br /&gt;                return null;&lt;br /&gt;            //TODO - Format the phone number here (XXX)XXX-XXXX&lt;br /&gt;            return value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 6-"TelephoneFieldControl.cs" will be as follows-&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;//http://www.sharethispoint.com/archive/2006/08/07/23.aspx#codethree&lt;br /&gt;&lt;br /&gt;namespace CustomField_TelephoneNumber&lt;br /&gt;{&lt;br /&gt;    class TelephoneFieldControl : BaseFieldControl&lt;br /&gt;    {&lt;br /&gt;        protected TextBox txtNumber;&lt;br /&gt;        //The DefaultTemplateName property lets sharepoint know which rendering template to use this class for.&lt;br /&gt;        protected override string DefaultTemplateName&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return "TelephoneFieldControl";&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //The value property controls how the data that SharePoint provides gets parsed into our control&lt;br /&gt;        public override object Value&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                EnsureChildControls();&lt;br /&gt;                return txtNumber.Text.Trim();&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                EnsureChildControls();&lt;br /&gt;                txtNumber.Text = (string)this.ItemFieldValue;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void Focus()&lt;br /&gt;        {&lt;br /&gt;            EnsureChildControls();&lt;br /&gt;            txtNumber.Focus();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected override void CreateChildControls()&lt;br /&gt;        {&lt;br /&gt;            if (Field == null) return;&lt;br /&gt;            base.CreateChildControls();&lt;br /&gt;            if (ControlMode == Microsoft.SharePoint.WebControls.SPControlMode.Display)&lt;br /&gt;                return;&lt;br /&gt;&lt;br /&gt;            txtNumber = (TextBox)TemplateContainer.FindControl("txtNumber");&lt;br /&gt;            if (txtNumber == null)&lt;br /&gt;                throw new ArgumentException("txtNumber is null. Corrupted TelephoneFieldControl.ascx file.");&lt;br /&gt;&lt;br /&gt;            txtNumber.TabIndex = TabIndex;&lt;br /&gt;            txtNumber.CssClass = CssClass;&lt;br /&gt;            txtNumber.ToolTip = Field.Title + " Phone Number";&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 7-Attach the strong name &amp; Copy the dll to GAC.&lt;br /&gt;&lt;br /&gt;Step 8-Copy the files to their respective folder as folder structure in the project.&lt;br /&gt;&lt;br /&gt;Step 9-Reset IIS&lt;br /&gt;&lt;br /&gt;Step 10-Create a Custom list in sharepoint 2007 and add your custome field column to the list.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-ZS0TQhcjR6g/TWXCQuBuZaI/AAAAAAAABWo/SX-F46qnaSE/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 180px;" src="http://4.bp.blogspot.com/-ZS0TQhcjR6g/TWXCQuBuZaI/AAAAAAAABWo/SX-F46qnaSE/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5577077306057188770" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 11-Add item to your Custom List&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-xWLPRhZ8QYk/TWXC0VC1FaI/AAAAAAAABWw/VJoKwwW72jc/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 180px;" src="http://2.bp.blogspot.com/-xWLPRhZ8QYk/TWXC0VC1FaI/AAAAAAAABWw/VJoKwwW72jc/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5577077917826225570" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-3097617240083663620?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/3097617240083663620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=3097617240083663620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3097617240083663620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3097617240083663620'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2011/02/create-custom-field-in-sharepoint-2007.html' title='Create a custom Field in Sharepoint 2007'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-JT-uGNhh8vQ/TWW91a7naAI/AAAAAAAABWg/-qlyHBRVQjo/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-1303389171433240562</id><published>2011-02-12T11:56:00.011+05:30</published><updated>2011-04-24T14:27:38.823+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Create Custom Sitepages in Sharepoint 2007</title><content type='html'>Step 1-Create a Web Application project "CustSitePages" and a class library project "CustSitePagesClass"&lt;br /&gt;Step 2-Make the folder structure as follows&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-SwXs-1Hasmw/TVYrVfWJxFI/AAAAAAAABWA/xc-KMuRQbEw/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 212px; height: 400px;" src="http://3.bp.blogspot.com/-SwXs-1Hasmw/TVYrVfWJxFI/AAAAAAAABWA/xc-KMuRQbEw/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5572689237109228626" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-kT6Tc5fQZ90/TVYrctLBejI/AAAAAAAABWI/67D8sIxew9A/s1600/2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 251px; height: 226px;" src="http://4.bp.blogspot.com/-kT6Tc5fQZ90/TVYrctLBejI/AAAAAAAABWI/67D8sIxew9A/s400/2.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5572689361079728690" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 3-"SiteFileViewer.ascx" will be as follows-&lt;br /&gt;&amp;lt;%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Control Language="C#" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"&lt;br /&gt;    Namespace="Microsoft.SharePoint.WebControls" TagPrefix="SharePoint" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="Microsoft.SharePoint" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script runat="server"&amp;gt;&lt;br /&gt;&lt;br /&gt;  protected override void OnLoad(EventArgs e) {&lt;br /&gt;    SPWeb site = SPContext.Current.Web;&lt;br /&gt;    SPFolder rootFolder = site.RootFolder;&lt;br /&gt;    TreeNode rootNode = new TreeNode(site.Title, "", @"\_layouts\images\FPWEB16.GIF");&lt;br /&gt;    rootNode.NavigateUrl = site.ServerRelativeUrl;&lt;br /&gt;    LoadFolderNodes(rootFolder, rootNode);&lt;br /&gt;    treeSitesFiles.Nodes.Add(rootNode);&lt;br /&gt;    treeSitesFiles.ExpandDepth = 1;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  protected void LoadFolderNodes(SPFolder folder, TreeNode folderNode)  {&lt;br /&gt;    &lt;br /&gt;    foreach (SPFolder childFolder in folder.SubFolders) {&lt;br /&gt;        TreeNode childFolderNode = new TreeNode(childFolder.Name, "", @"\_layouts\images\FOLDER16.GIF");&lt;br /&gt;      childFolderNode.NavigateUrl = childFolder.ServerRelativeUrl;&lt;br /&gt;      LoadFolderNodes(childFolder, childFolderNode);&lt;br /&gt;      folderNode.ChildNodes.Add(childFolderNode);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    foreach (SPFile file in folder.Files){&lt;br /&gt;      TreeNode fileNode;&lt;br /&gt;      if (file.CustomizedPageStatus == SPCustomizedPageStatus.Uncustomized) {&lt;br /&gt;          fileNode = new TreeNode(file.Name, "", @"\_layouts\images\NEWDOC.GIF");&lt;br /&gt;        fileNode.NavigateUrl = file.ServerRelativeUrl;&lt;br /&gt;      }        &lt;br /&gt;      else {&lt;br /&gt;          fileNode = new TreeNode(file.Name, "", @"\_layouts\images\RAT16.GIF");&lt;br /&gt;        fileNode.NavigateUrl = file.ServerRelativeUrl;&lt;br /&gt;      }&lt;br /&gt;      folderNode.ChildNodes.Add(fileNode);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:TreeView  NodeStyle-HorizontalPadding="6" ID="treeSitesFiles" runat="server" EnableViewState="false" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 4-"UserControl1.ascx" will be as follows-&lt;br /&gt;&amp;lt;%@ Control Language="C#" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script runat="server"&amp;gt;&lt;br /&gt;&lt;br /&gt;  protected void cmdAddCustomer_Click(object sender, EventArgs e) {&lt;br /&gt;    string msg  = "Customer " + txtName.Text + " has been added.";&lt;br /&gt;    lblStatus.Text = msg;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h4&amp;gt;Add New Customer&amp;lt;/h4&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;Name:&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID="txtName" runat="server" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;Address:&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID="txtAddress" runat="server" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;City:&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID="txtCity" runat="server" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;&lt;br /&gt;      State:&lt;br /&gt;    &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;&lt;br /&gt;      &amp;lt;asp:TextBox ID="txtState" runat="server" /&amp;gt;&lt;br /&gt;    &amp;lt;/td&amp;gt;&lt;br /&gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;&lt;br /&gt;      Zip:&lt;br /&gt;    &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;&lt;br /&gt;      &amp;lt;asp:TextBox ID="txtZip" runat="server" /&amp;gt;&lt;br /&gt;    &amp;lt;/td&amp;gt;&lt;br /&gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;  &amp;lt;asp:Button ID="cmdAddCustomer" runat="server" Text="Add Customer" OnClick="cmdAddCustomer_Click" /&amp;gt;&lt;br /&gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;  &amp;lt;asp:Label ID="lblStatus" runat="server" Text="" /&amp;gt;&lt;br /&gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 5-"UserControl2.ascx" will be as follows-&lt;br /&gt;&amp;lt;%@ Control Language="C#" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="Microsoft.SharePoint" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script runat="server"&amp;gt;&lt;br /&gt;  protected override void OnLoad(EventArgs e)  {&lt;br /&gt;    SPWeb site = SPContext.Current.Web;&lt;br /&gt;    lblDisplay.Text = "Current Site: " + site.Url;&lt;br /&gt;  }&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Label ID="lblDisplay" runat="server" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 6-"CustSitePages_All.aspx" will be as follows-&lt;br /&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"&lt;br /&gt;    meta:progid="SharePoint.WebPartPage.Document" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="CustSitePagesClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d"&lt;br /&gt;    Namespace="CustSitePagesClass" TagPrefix="CustomSitePages" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="luc" TagName="UserControl1" Src="~/_controltemplates/MRB/UserControl1.ascx" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="luc" TagName="UserControl2" Src="~/_controltemplates/MRB/UserControl2.ascx" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"&lt;br /&gt;    Namespace="Microsoft.SharePoint.WebControls" TagPrefix="SharePoint" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"&lt;br /&gt;    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID="main" runat="server" ContentPlaceHolderID="PlaceHolderMain"&amp;gt;&lt;br /&gt;    &amp;lt;table width="100%"&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;                &amp;lt;h3&amp;gt;&lt;br /&gt;                    Page 1 - Hello World&amp;lt;/h3&amp;gt;&lt;br /&gt;                A simple page template used to create site pages&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;                &amp;lt;h3&amp;gt;&lt;br /&gt;                    Page 2 - Server-side scripts and safe mode&amp;lt;/h3&amp;gt;&lt;br /&gt;                &amp;lt;% Response.Write("Hello world from server-side script"); %&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;                &amp;lt;h3&amp;gt;&lt;br /&gt;                    Page 3 - Custom Control Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;                &amp;lt;CustomSitePages:CustSitePagesCls ID="cc1" runat="server" /&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;                &amp;lt;h3&amp;gt;&lt;br /&gt;                   Page 4- User Control Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;                &amp;lt;luc:UserControl1 ID="id1" runat="server" /&amp;gt;&lt;br /&gt;                &amp;lt;hr /&amp;gt;&lt;br /&gt;                &amp;lt;luc:UserControl2 ID="id2" runat="server" /&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;                &amp;lt;h3&amp;gt;&lt;br /&gt;                  Page 5-  Built-in WSS Controls&amp;lt;/h3&amp;gt;&lt;br /&gt;                &amp;lt;h4&amp;gt;&lt;br /&gt;                    AspMenu control&amp;lt;/h4&amp;gt;&lt;br /&gt;                &amp;lt;SharePoint:AspMenu ID="MyMenu" DataSourceID="SiteMapDataSource1" runat="server"&lt;br /&gt;                    Orientation="Vertical" StaticDisplayLevels="2" MaximumDynamicDisplayLevels="1"&lt;br /&gt;                    BorderWidth="1" StaticMenuItemStyle-BorderWidth="2" /&amp;gt;&lt;br /&gt;                &amp;lt;asp:SiteMapDataSource ShowStartingNode="False" SiteMapProvider="SPNavigationProvider"&lt;br /&gt;                    ID="SiteMapDataSource1" runat="server" StartingNodeUrl="sid:1002" /&amp;gt;&lt;br /&gt;                &amp;lt;br /&amp;gt;&lt;br /&gt;                &amp;lt;hr /&amp;gt;&lt;br /&gt;                &amp;lt;h4&amp;gt;&lt;br /&gt;                    SPTreeView control&amp;lt;/h4&amp;gt;&lt;br /&gt;                &amp;lt;SharePoint:SPTreeView ID="WebTreeView" runat="server" ShowLines="true" DataSourceID="TreeViewDataSource1"&lt;br /&gt;                    ExpandDepth="2" ShowExpandCollapse="true" ShowCheckBoxes="All" SelectedNodeStyle-CssClass="ms-tvselected"&lt;br /&gt;                    NodeStyle-CssClass="ms-navitem" NodeStyle-HorizontalPadding="2" SkipLinkText=""&lt;br /&gt;                    NodeIndent="12" ExpandImageUrl="/_layouts/images/tvplus.gif" CollapseImageUrl="/_layouts/images/tvminus.gif"&lt;br /&gt;                    NoExpandImageUrl="/_layouts/images/tvblank.gif"&amp;gt;&lt;br /&gt;                &amp;lt;/SharePoint:SPTreeView&amp;gt;&lt;br /&gt;                &amp;lt;SharePoint:SPHierarchyDataSourceControl runat="server" ID="TreeViewDataSource1"&lt;br /&gt;                    RootContextObject="Web" IncludeDiscussionFolders="true" ShowFolderChildren="true" /&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;                &amp;lt;h3&amp;gt;&lt;br /&gt;                  Page 6-  Custom Web Part Page&amp;lt;/h3&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td valign="top" style="width: 50%"&amp;gt;&lt;br /&gt;                &amp;lt;WebPartPages:WebPartZone ID="Left" runat="server" FrameType="TitleBarOnly" Title="Left Web Part Zone" /&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;            &amp;lt;td valign="top" style="width: 50%"&amp;gt;&lt;br /&gt;                &amp;lt;WebPartPages:WebPartZone ID="Right" runat="server" FrameType="TitleBarOnly" Title="Right Web Part Zone" /&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 7-"Feature.xml" will be as follows-&lt;br /&gt;&amp;lt;Feature&lt;br /&gt;  Id="EE3300F0-D4E3-4c0d-8F07-6D965F6D6D6D"&lt;br /&gt;  Title="My Custom Site Pages"&lt;br /&gt;  Description="THIS IS A EXAMPLE OF CUSTOM SITE PAGE"&lt;br /&gt;  Scope="Web"&lt;br /&gt;  Hidden="false"&lt;br /&gt;  ImageUrl="menuprofile.gif"&lt;br /&gt;  ReceiverAssembly="CustSitePagesClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d"&lt;br /&gt;  ReceiverClass="CustSitePagesClass.FeatureReceiver"&lt;br /&gt;  xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;ElementManifests&amp;gt;&lt;br /&gt;    &amp;lt;ElementManifest Location="Elements.xml"/&amp;gt;&lt;br /&gt;  &amp;lt;/ElementManifests&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Feature&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 8-"Elements.xml" will be as follows-&lt;br /&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;Module Path="PageTemplates" Url="SitePages" &amp;gt;&lt;br /&gt;    &amp;lt;!-- provision standard pages --&amp;gt;&lt;br /&gt;&lt;br /&gt;    /*&lt;br /&gt;    &amp;lt;File Url="Page01.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;File Url="Page02.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;File Url="Page03.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;File Url="Page04.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;File Url="Page05.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;File Url="Page06.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;!-- provision Web Part pages --&amp;gt;&lt;br /&gt;    &amp;lt;File Url="WebPartPage.aspx" Name="WebPartPage01.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;File Url="WebPartPage.aspx" Name="WebPartPage02.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;    &amp;lt;!-- provision Web Part page with Web Parts inside --&amp;gt;&lt;br /&gt;    &amp;lt;File Url="WebPartPage.aspx" Name="WebPartPage03.aspx" Type="Ghostable" /&amp;gt;  */&lt;br /&gt;&lt;br /&gt;    &amp;lt;File Url="CustSitePages_All.aspx" Name="CustSitePages_All.aspx" Type="Ghostable" /&amp;gt;&lt;br /&gt;      &lt;br /&gt;  &amp;lt;/Module&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Elements&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 9-"CustSitePagesCls.cs" will be as follows-&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;&lt;br /&gt;namespace CustSitePagesClass&lt;br /&gt;{&lt;br /&gt;    public class CustSitePagesCls : WebControl&lt;br /&gt;    {&lt;br /&gt;        protected override void RenderContents(HtmlTextWriter output)&lt;br /&gt;        {&lt;br /&gt;            SPWeb site = SPContext.Current.Web;&lt;br /&gt;            output.Write("Current Site: " + site.Title);&lt;br /&gt;            output.Write("&amp;lt;br/&amp;gt;");&lt;br /&gt;            output.Write("Current Site ID: " + site.ID.ToString());&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 10-FeatureReceiver.cs will be as follows-&lt;br /&gt;using System;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;using Microsoft.SharePoint.WebPartPages;&lt;br /&gt;using Microsoft.SharePoint.Navigation;&lt;br /&gt;&lt;br /&gt;namespace CustSitePagesClass&lt;br /&gt;{&lt;br /&gt;    class FeatureReceiver : SPFeatureReceiver &lt;br /&gt;    {&lt;br /&gt;        public override void FeatureActivated(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            // get a hold off current site in context of feature activation&lt;br /&gt;            SPWeb site = (SPWeb)properties.Feature.Parent;&lt;br /&gt;            SPNavigationNodeCollection topNav = site.Navigation.TopNavigationBar;&lt;br /&gt;&lt;br /&gt;            // create dropdown menu for custom site pages&lt;br /&gt;            SPNavigationNode DropDownMenu1 =&lt;br /&gt;                             new SPNavigationNode("Custom Site Pages", "", false);&lt;br /&gt;            topNav[0].Children.AddAsLast(DropDownMenu1);&lt;br /&gt;            DropDownMenu1.Children.AddAsLast(&lt;br /&gt;              new SPNavigationNode("Site Page 1", "SitePages/Page01.aspx"));&lt;br /&gt;&lt;br /&gt;            DropDownMenu1.Children.AddAsLast(new SPNavigationNode("Site Page 2", "SitePages/Page02.aspx"));&lt;br /&gt;            DropDownMenu1.Children.AddAsLast(new SPNavigationNode("Site Page 3", "SitePages/Page03.aspx"));&lt;br /&gt;            DropDownMenu1.Children.AddAsLast(new SPNavigationNode("Site Page 4", "SitePages/Page04.aspx"));&lt;br /&gt;            DropDownMenu1.Children.AddAsLast(new SPNavigationNode("Site Page 5", "SitePages/Page05.aspx"));&lt;br /&gt;            DropDownMenu1.Children.AddAsLast(new SPNavigationNode("Site Page 6", "SitePages/Page06.aspx"));&lt;br /&gt;&lt;br /&gt;            // create dropdown menu for custom Web Part Pages&lt;br /&gt;            SPNavigationNode DropDownMenu2 = new SPNavigationNode("Custom Web Part Pages", "", false);&lt;br /&gt;            topNav[0].Children.AddAsLast(DropDownMenu2);&lt;br /&gt;            DropDownMenu2.Children.AddAsLast(new SPNavigationNode("Web Part Page 1", "SitePages/WebPartPage01.aspx"));&lt;br /&gt;            DropDownMenu2.Children.AddAsLast(new SPNavigationNode("Web Part Page 2", "SitePages/WebPartPage02.aspx"));&lt;br /&gt;            DropDownMenu2.Children.AddAsLast(new SPNavigationNode("Web Part Page 3", "SitePages/WebPartPage03.aspx"));&lt;br /&gt;&lt;br /&gt;            SPFile page = site.GetFile("SitePages/WebPartPage02.aspx");&lt;br /&gt;            SPLimitedWebPartManager mgr;&lt;br /&gt;            mgr = page.GetLimitedWebPartManager(PersonalizationScope.Shared);&lt;br /&gt;            // add Web Part to Left Zone&lt;br /&gt;            ContentEditorWebPart wp1 = new ContentEditorWebPart();&lt;br /&gt;            wp1.Title = "My Most Excellent Title";&lt;br /&gt;            wp1.ChromeType = PartChromeType.TitleOnly;&lt;br /&gt;            wp1.AllowClose = false;&lt;br /&gt;            XmlDocument doc = new XmlDocument();&lt;br /&gt;            string ns1 = "http://schemas.microsoft.com/WebPart/v2/ContentEditor";&lt;br /&gt;            XmlElement elm = doc.CreateElement("Content", ns1);&lt;br /&gt;            elm.InnerText = "This Web Part was added through code";&lt;br /&gt;            wp1.Content = elm;&lt;br /&gt;            mgr.AddWebPart(wp1, "Left", 0);&lt;br /&gt;            // add Web Part to Right Zone&lt;br /&gt;            ImageWebPart wp2 = new ImageWebPart();&lt;br /&gt;            wp2.ChromeType = PartChromeType.None;&lt;br /&gt;            wp2.ImageLink = @"/_layouts/images/IPVW.GIF";&lt;br /&gt;            mgr.AddWebPart(wp2, "Right", 0);&lt;br /&gt;&lt;br /&gt;            //code for CustomSitePages_ALL&lt;br /&gt;            //SPFile pageAll = site.GetFile("SitePages/WebPartPage02.aspx");&lt;br /&gt;            SPFile pageAll = site.GetFile("SitePages/CustomSitePages_ALL");&lt;br /&gt;            SPLimitedWebPartManager mgrAll;&lt;br /&gt;            mgrAll = pageAll.GetLimitedWebPartManager(PersonalizationScope.Shared);&lt;br /&gt;            // add Web Part to Left Zone&lt;br /&gt;            ContentEditorWebPart wpAll = new ContentEditorWebPart();&lt;br /&gt;            wpAll.Title = "My Most Excellent Title";&lt;br /&gt;            wpAll.ChromeType = PartChromeType.TitleOnly;&lt;br /&gt;            wpAll.AllowClose = false;&lt;br /&gt;            XmlDocument docAll = new XmlDocument();&lt;br /&gt;            string nsAll = "http://schemas.microsoft.com/WebPart/v2/ContentEditor";&lt;br /&gt;            XmlElement elmAll = docAll.CreateElement("Content", nsAll);&lt;br /&gt;            elmAll.InnerText = "This Web Part was added through code";&lt;br /&gt;            wpAll.Content = elmAll;&lt;br /&gt;            mgrAll.AddWebPart(wpAll, "Left", 0);&lt;br /&gt;            // add Web Part to Right Zone&lt;br /&gt;            ImageWebPart wp2All = new ImageWebPart();&lt;br /&gt;            wp2All.ChromeType = PartChromeType.None;&lt;br /&gt;            wp2All.ImageLink = @"/_layouts/images/IPVW.GIF";&lt;br /&gt;            mgrAll.AddWebPart(wp2All, "Right", 0);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            SPWeb site = (SPWeb)properties.Feature.Parent;&lt;br /&gt;            // delete folder of site pages provisioned during activation&lt;br /&gt;            SPFolder sitePagesFolder = site.GetFolder("SitePages");&lt;br /&gt;            sitePagesFolder.Delete();&lt;br /&gt;&lt;br /&gt;            SPNavigationNodeCollection topNav = site.Navigation.TopNavigationBar;&lt;br /&gt;&lt;br /&gt;            for (int i = topNav[0].Children.Count - 1; i &amp;gt;= 0; i--)&lt;br /&gt;            {&lt;br /&gt;                if (topNav[0].Children[i].Title == "Custom Site Pages" ||&lt;br /&gt;                   topNav[0].Children[i].Title == "Custom Web Part Pages")&lt;br /&gt;                {&lt;br /&gt;                    // delete node&lt;br /&gt;                    topNav[0].Children[i].Delete();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureInstalled(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            // new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            //throw new NotImplementedException();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 11-Copy the dll of CustSitePagesClass project to the GAC and copy the CustSitePages project files in the 12 hives as per the folder structure.&lt;br /&gt;&lt;br /&gt;Step 12-Install &amp; activate the feature "CustSitePages"&lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN&gt;stsa&lt;br /&gt;dm -o installfeature -name CustSitePages -force&lt;br /&gt;&lt;br /&gt;Step 13-Browse the URL as follows-&lt;br /&gt;http://vpc1:2010/sites/SharepointPoC/Sitepages/CustSitePages_All.aspx&lt;br /&gt;&lt;br /&gt;Step 14-You can see the output as follows-&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-wjHMlnlrStM/TV3fdfISMgI/AAAAAAAABWY/dOLvihp6yz8/s1600/2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 242px;" src="http://3.bp.blogspot.com/-wjHMlnlrStM/TV3fdfISMgI/AAAAAAAABWY/dOLvihp6yz8/s400/2.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5574857611419988482" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-0elxdlLyGN4/TV3fXWdrFNI/AAAAAAAABWQ/8Q1tL7r_2QE/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 242px;" src="http://4.bp.blogspot.com/-0elxdlLyGN4/TV3fXWdrFNI/AAAAAAAABWQ/8Q1tL7r_2QE/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5574857506014565586" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-1303389171433240562?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/1303389171433240562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=1303389171433240562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1303389171433240562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1303389171433240562'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2011/02/create-custom-sitepages-in-sharepoint.html' title='Create Custom Sitepages in Sharepoint 2007'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-SwXs-1Hasmw/TVYrVfWJxFI/AAAAAAAABWA/xc-KMuRQbEw/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-5008758991439189425</id><published>2011-02-08T22:57:00.008+05:30</published><updated>2011-04-24T14:27:38.826+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Create a custom application page in sharepoint 2007</title><content type='html'>Step 1-Create a Asp.NET Web Application project "CustAppPage" and a class library project "CustAppPageClassLib" and make the folder structure as follows&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/TVGDQ8HyXNI/AAAAAAAABVQ/88zZ4DI00A4/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5571378541073947858" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 300px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/TVGDQ8HyXNI/AAAAAAAABVQ/88zZ4DI00A4/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/TVGDYSePjPI/AAAAAAAABVY/ooUg-qZEZgM/s1600/2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5571378667332799730" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 272px; CURSOR: hand; HEIGHT: 235px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/TVGDYSePjPI/AAAAAAAABVY/ooUg-qZEZgM/s400/2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 2-Feature.xml will be as follows-&lt;br /&gt;&amp;lt;Feature xmlns="http://schemas.microsoft.com/sharepoint/"&lt;br /&gt;Id="{E0A4DFA4-717D-44b0-8292-B46593E64B80}"&lt;br /&gt;Title="My Feature-Cust App Page"&lt;br /&gt;Description="Shows a navigation link in under site action menu and ECB menu"&lt;br /&gt;Hidden="false"&lt;br /&gt;Scope="Web"&lt;br /&gt;ImageUrl="menuprofile.gif"&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;lt;ElementManifests &amp;gt;&lt;br /&gt;&amp;lt;ElementManifest Location="Elements.xml"/&amp;gt;&lt;br /&gt;&amp;lt;/ElementManifests&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Feature&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 3-Elements.xml will be as follows-&lt;br /&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt;&amp;lt;!-- Add Command to Site Actions Dropdown --&amp;gt;&lt;br /&gt;&amp;lt;CustomAction Id="CustomApplicationPage_StandardMenu"&lt;br /&gt;GroupId="SiteActions"&lt;br /&gt;ImageUrl="~/_layouts/images/menuprofile.gif"&lt;br /&gt;Location="Microsoft.SharePoint.StandardMenu"&lt;br /&gt;Sequence="2001"&lt;br /&gt;Title="Cust Application Page 1"&lt;br /&gt;Description="CustomApplicationPage under StandardMenu"&amp;gt;&lt;br /&gt;&amp;lt;UrlAction Url="~site/_layouts/MyCustAppPages/ApplicationPage1.aspx"/&amp;gt;&lt;br /&gt;&amp;lt;/CustomAction&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Per Item Dropdown (ECB) Link --&amp;gt;&lt;br /&gt;&amp;lt;CustomAction Id="CustomApplicationPage_ECB"&lt;br /&gt;RegistrationType="List"&lt;br /&gt;RegistrationId="101"&lt;br /&gt;ImageUrl="~/_layouts/images/menuprofile.gif"&lt;br /&gt;Location="EditControlBlock"&lt;br /&gt;Sequence="240"&lt;br /&gt;Title="CustomApplicationPage under ECB" &amp;gt;&lt;br /&gt;&amp;lt;UrlAction Url="~site/_layouts/MyCustAppPages/ApplicationPage1.aspx?ItemId={ItemId}&amp;amp;ListId={ListId}"/&amp;gt;&lt;br /&gt;&amp;lt;/CustomAction&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Elements&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 4-"ApplicationPage1.aspx"(Code behind approach) will be as follows-&lt;br /&gt;&amp;lt;%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Assembly Name="CustAppPageClassLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~/_layouts/application.master"&lt;br /&gt;Inherits="CustAppPageClassLib.ApplicationPage1"&lt;br /&gt;EnableViewState="false" EnableViewStateMac="false" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="Main" contentplaceholderid="PlaceHolderMain" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;table border="1" cellpadding="4" cellspacing="0" style="font-size:12"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;Site Title:&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;asp:Label ID="lblSiteTitle" runat="server" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;Site ID:&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;asp:Label ID="lblSiteID" runat="server" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="PageTitle" runat="server"&lt;br /&gt;contentplaceholderid="PlaceHolderPageTitle" &amp;gt;&lt;br /&gt;Hello World&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="PageTitleInTitleArea" runat="server"&lt;br /&gt;contentplaceholderid="PlaceHolderPageTitleInTitleArea" &amp;gt;&lt;br /&gt;Application Page 1: 'Hello World' with code behind&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 5-"HelloWorld.aspx"(Inline c# code) will be as follows-&lt;br /&gt;&amp;lt;%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%&amp;gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="Microsoft.SharePoint" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script runat="server"&amp;gt;&lt;br /&gt;protected override void OnLoad(EventArgs e) {&lt;br /&gt;//SPWeb site = SPContext.Current.Web;&lt;br /&gt;SPWeb site = this.Web;&lt;br /&gt;lblSiteTitle.Text = site.Title;&lt;br /&gt;lblSiteID.Text = site.ID.ToString().ToUpper();&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="Main" contentplaceholderid="PlaceHolderMain" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;table border="1" cellpadding="4" cellspacing="0" style="font-size:12"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;Site Title:&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;asp:Label ID="lblSiteTitle" runat="server" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;Site ID:&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;asp:Label ID="lblSiteID" runat="server" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="PageTitle" contentplaceholderid="PlaceHolderPageTitle" runat="server"&amp;gt;&lt;br /&gt;Hello World&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="PageTitleInTitleArea" runat="server"&lt;br /&gt;contentplaceholderid="PlaceHolderPageTitleInTitleArea" &amp;gt;&lt;br /&gt;The Quintessential 'Hello World' of Application Page&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 6-"ApplicationPage1.cs" under "CustAppPageClassLib" will be as follows&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;&lt;br /&gt;namespace CustAppPageClassLib&lt;br /&gt;{&lt;br /&gt;public class ApplicationPage1 : LayoutsPageBase&lt;br /&gt;{&lt;br /&gt;// add control fields to match controls tags on .aspx page&lt;br /&gt;protected Label lblSiteTitle;&lt;br /&gt;protected Label lblSiteID;&lt;br /&gt;&lt;br /&gt;protected override void OnLoad(EventArgs e)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;// get current site and web&lt;br /&gt;SPSite siteCollection = this.Site;&lt;br /&gt;SPWeb site = this.Web;&lt;br /&gt;&lt;br /&gt;// program against controls on .aspx page&lt;br /&gt;lblSiteTitle.Text = site.Title;&lt;br /&gt;lblSiteID.Text = site.ID.ToString().ToUpper();&lt;br /&gt;&lt;br /&gt;if (Request.QueryString["ListId"] != null)&lt;br /&gt;{&lt;br /&gt;lblSiteID.Text = lblSiteID.Text + " ,List ID :" + Request.QueryString["ListId"].ToString();&lt;br /&gt;}&lt;br /&gt;if (Request.QueryString["ItemId"] != null)&lt;br /&gt;{&lt;br /&gt;lblSiteID.Text = lblSiteID.Text + " ,Item ID :" + Request.QueryString["ItemId"].ToString();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 7-Add the strong name to your project "CustAppPageClassLib" and install it in the GAC.&lt;br /&gt;&lt;br /&gt;Step 8-Copy your aspx pages in the following folder&lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\MyCustAppPages&lt;br /&gt;&lt;br /&gt;and copy the others pages as the folder structure in your project&lt;br /&gt;&lt;br /&gt;Step 9-Install the feature and activate it.&lt;br /&gt;&lt;br /&gt;Step 10-click the "Cust Application Page 1" menu as follows and you can see the output as follows-&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/TVGGOighzwI/AAAAAAAABVg/73VgXnOCM-0/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5571381798373543682" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 165px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/TVGGOighzwI/AAAAAAAABVg/73VgXnOCM-0/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 11- Or click on the ECB menu on any list item&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/TVGG2_7OO-I/AAAAAAAABVo/XiiOs1wO0R8/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 305px; height: 378px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/TVGG2_7OO-I/AAAAAAAABVo/XiiOs1wO0R8/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5571382493464902626" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can see the output as follows-&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/TVGHLbxNUqI/AAAAAAAABVw/FLCYweFeOec/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 83px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/TVGHLbxNUqI/AAAAAAAABVw/FLCYweFeOec/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5571382844536476322" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 12-You can type the URL and see your Helloworld.aspx page&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/TVGHnd1vZ8I/AAAAAAAABV4/5rIEO7JczdU/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 166px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/TVGHnd1vZ8I/AAAAAAAABV4/5rIEO7JczdU/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5571383326128695234" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-5008758991439189425?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/5008758991439189425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=5008758991439189425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5008758991439189425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5008758991439189425'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2011/02/create-custom-application-page-in.html' title='Create a custom application page in sharepoint 2007'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1EZkGmmHBwc/TVGDQ8HyXNI/AAAAAAAABVQ/88zZ4DI00A4/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-6690799604960682174</id><published>2011-02-07T22:36:00.006+05:30</published><updated>2011-04-24T14:27:38.828+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Create a connected web part and activate through feature</title><content type='html'>Step 1-Create a class library project and make the folder structure as follows&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/TVAoLMqz8NI/AAAAAAAABUw/IcxeWQ4Zmd0/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5570996911901765842" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 316px; CURSOR: hand; HEIGHT: 368px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/TVAoLMqz8NI/AAAAAAAABUw/IcxeWQ4Zmd0/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 2-Connectedwebpart.cs will be as follows&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;//using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;&lt;br /&gt;namespace ConnectedWebPart&lt;br /&gt;{&lt;br /&gt;public interface ICustomerProvider&lt;br /&gt;{&lt;br /&gt;string CustomerID { get; }&lt;br /&gt;string CustomerName { get; }&lt;br /&gt;}&lt;br /&gt;public class SimpleProviderExample : WebPart, ICustomerProvider&lt;br /&gt;{&lt;br /&gt;private string _customerID = "P1284";&lt;br /&gt;private string _customerName = "Manab";&lt;br /&gt;&lt;br /&gt;protected override void RenderContents(HtmlTextWriter writer)&lt;br /&gt;{&lt;br /&gt;writer.Write("Customer ID: " + this.CustomerID);&lt;br /&gt;writer.Write("Customer Name: " + this.CustomerName);&lt;br /&gt;}&lt;br /&gt;public string CustomerID&lt;br /&gt;{&lt;br /&gt;get { return this._customerID; }&lt;br /&gt;}&lt;br /&gt;public string CustomerName&lt;br /&gt;{&lt;br /&gt;get { return this._customerName; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[ConnectionProvider("Customer ID","Customer Name", AllowsMultipleConnections = true)]&lt;br /&gt;public ICustomerProvider GetCustomerProvider()&lt;br /&gt;{&lt;br /&gt;return this;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class SimpleConsumerExample : WebPart&lt;br /&gt;{&lt;br /&gt;private ICustomerProvider customerProvider;&lt;br /&gt;&lt;br /&gt;[ConnectionConsumer("Customer ID", "Customer Name")]&lt;br /&gt;public void RegisterCustomerProvider(ICustomerProvider provider)&lt;br /&gt;{&lt;br /&gt;this.customerProvider = provider;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected override void RenderContents(HtmlTextWriter writer)&lt;br /&gt;{&lt;br /&gt;if (this.customerProvider != null)&lt;br /&gt;{&lt;br /&gt;writer.Write(this.customerProvider.CustomerID);&lt;br /&gt;writer.Write(this.customerProvider.CustomerName);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;writer.Write("No connection");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class ConnectionWebPart&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 3-SimpleConsumerExample.webpart will be as follows-&lt;br /&gt;&amp;lt;webParts&amp;gt;&lt;br /&gt;&amp;lt;webPart xmlns="http://schemas.microsoft.com/WebPart/v3"&amp;gt;&lt;br /&gt;&amp;lt;metaData&amp;gt;&lt;br /&gt;&amp;lt;type name="ConnectedWebPart.SimpleConsumerExample" /&amp;gt;&lt;br /&gt;&amp;lt;importErrorMessage&amp;gt;Cannot import this Web Part.&amp;lt;/importErrorMessage&amp;gt;&lt;br /&gt;&amp;lt;/metaData&amp;gt;&lt;br /&gt;&amp;lt;data&amp;gt;&lt;br /&gt;&amp;lt;properties&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowClose" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="Width" type="unit" /&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowMinimize" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowConnect" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="ChromeType" type="chrometype"&amp;gt;Default&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="TitleIconImageUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Description" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Hidden" type="bool"&amp;gt;False&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="TitleUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowEdit" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="Height" type="unit" /&amp;gt;&lt;br /&gt;&amp;lt;property name="HelpUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Title" type="string"&amp;gt;SimpleConsumerExample&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="CatalogIconImageUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Direction" type="direction"&amp;gt;NotSet&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="ChromeState" type="chromestate"&amp;gt;Normal&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowZoneChange" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowHide" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="HelpMode" type="helpmode"&amp;gt;Navigate&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="ExportMode" type="exportmode"&amp;gt;All&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/properties&amp;gt;&lt;br /&gt;&amp;lt;/data&amp;gt;&lt;br /&gt;&amp;lt;/webPart&amp;gt;&lt;br /&gt;&amp;lt;/webParts&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 4-SimpleProviderExample.webpart will be as follows-&lt;br /&gt;&amp;lt;webParts&amp;gt;&lt;br /&gt;&amp;lt;webPart xmlns="http://schemas.microsoft.com/WebPart/v3"&amp;gt;&lt;br /&gt;&amp;lt;metaData&amp;gt;&lt;br /&gt;&amp;lt;type name="ConnectedWebPart.SimpleProviderExample" /&amp;gt;&lt;br /&gt;&amp;lt;importErrorMessage&amp;gt;Cannot import this Web Part.&amp;lt;/importErrorMessage&amp;gt;&lt;br /&gt;&amp;lt;/metaData&amp;gt;&lt;br /&gt;&amp;lt;data&amp;gt;&lt;br /&gt;&amp;lt;properties&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowClose" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="Width" type="unit" /&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowMinimize" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowConnect" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="ChromeType" type="chrometype"&amp;gt;Default&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="TitleIconImageUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Description" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Hidden" type="bool"&amp;gt;False&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="TitleUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowEdit" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="Height" type="unit" /&amp;gt;&lt;br /&gt;&amp;lt;property name="HelpUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Title" type="string"&amp;gt;SimpleProviderExample&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="CatalogIconImageUrl" type="string" /&amp;gt;&lt;br /&gt;&amp;lt;property name="Direction" type="direction"&amp;gt;NotSet&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="ChromeState" type="chromestate"&amp;gt;Normal&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowZoneChange" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="AllowHide" type="bool"&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="HelpMode" type="helpmode"&amp;gt;Navigate&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name="ExportMode" type="exportmode"&amp;gt;All&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/properties&amp;gt;&lt;br /&gt;&amp;lt;/data&amp;gt;&lt;br /&gt;&amp;lt;/webPart&amp;gt;&lt;br /&gt;&amp;lt;/webParts&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 5-feature.xml will be as follows-&lt;br /&gt;&amp;lt;Feature&lt;br /&gt;Id="FE016E00-8639-4839-925D-B40F659458A9"&lt;br /&gt;Title="Sample Connected Web Parts"&lt;br /&gt;Description="This demoware was created for Inside Windows SharePoint Services (Pattison/Larson)"&lt;br /&gt;Hidden="FALSE"&lt;br /&gt;Scope="Site"&lt;br /&gt;ImageUrl="TPG/canteen.gif"&lt;br /&gt;xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ElementManifests&amp;gt;&lt;br /&gt;&amp;lt;ElementManifest Location="elements.xml"/&amp;gt;&lt;br /&gt;&amp;lt;/ElementManifests&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Feature&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 6-elements.xml will be as follows-&lt;br /&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Module Name="LitwareWebParts"&lt;br /&gt;List="113"&lt;br /&gt;Url="_catalogs/wp"&lt;br /&gt;Path="dwp"&lt;br /&gt;RootWebOnly="true"&amp;gt;&lt;br /&gt;&amp;lt;File Url="SimpleConsumerExample.webpart" Type="GhostableInLibrary" &amp;gt;&lt;br /&gt;&amp;lt;Property Name="Group" Value="Litware Web Parts" /&amp;gt;&lt;br /&gt;&amp;lt;/File&amp;gt;&lt;br /&gt;&amp;lt;File Url="SimpleProviderExample.webpart" Type="GhostableInLibrary" &amp;gt;&lt;br /&gt;&amp;lt;Property Name="Group" Value="Litware Web Parts" /&amp;gt;&lt;br /&gt;&amp;lt;/File&amp;gt;&lt;br /&gt;&amp;lt;/Module&amp;gt;&lt;br /&gt;&amp;lt;/Elements&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 7-Copy the dll to GAC and others files to the respective folder of 12 hives&lt;br /&gt;&lt;br /&gt;Step 8-Make a safecontrol entry to the web config of your site&lt;br /&gt;&amp;lt;SafeControl Assembly="ConnectedWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d" Namespace="ConnectedWebPart" TypeName="*" Safe="True" /&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 9-Activate your feature from the site collection features&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/TVArFVevznI/AAAAAAAABU4/-DAospl9trw/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5571000109722750578" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 23px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/TVArFVevznI/AAAAAAAABU4/-DAospl9trw/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 10-Add it to your web part zone and make the connection between two web parts&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/TVAr6tleqEI/AAAAAAAABVA/cz43hhu7TV8/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 69px;" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/TVAr6tleqEI/AAAAAAAABVA/cz43hhu7TV8/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5571001026726504514" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-6690799604960682174?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/6690799604960682174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=6690799604960682174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6690799604960682174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6690799604960682174'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2011/02/create-connected-web-part-and-activate.html' title='Create a connected web part and activate through feature'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/TVAoLMqz8NI/AAAAAAAABUw/IcxeWQ4Zmd0/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2271168727728060186</id><published>2011-02-05T20:12:00.005+05:30</published><updated>2011-04-24T14:27:38.831+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Create a simple webpart</title><content type='html'>Step 1-Create a website "Website1"&lt;br /&gt;Step 2-Add reference "windows sharepoint service"&lt;br /&gt;Step 3-Add a Web user control "SampleUserControl.ascx" in your project&lt;br /&gt;Step 4-HTML code of the user control will be as follows&lt;br /&gt;&amp;lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="SampleUserControl.ascx.cs"&lt;br /&gt;    Inherits="SampleUserControl" %&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;        &amp;lt;td&amp;gt;&lt;br /&gt;            Put a URL of your Site :&lt;br /&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;td&amp;gt;&lt;br /&gt;            &amp;lt;asp:TextBox ID="txtSiteUrl" Text="http://vpc1:2010/sites/SharepointPoC" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;        &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;            &amp;lt;asp:Button ID="btnSPList" runat="server" Text="Find Splist" &lt;br /&gt;                onclick="btnSPList_Click" /&amp;gt;&lt;br /&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;        &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;            &amp;lt;asp:TextBox ID="txtOutput" runat="server" Text="output Window" &lt;br /&gt;                TextMode="MultiLine" Width="100%"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;        &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;        File Viewer Control&lt;br /&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;        &amp;lt;td colspan="2"&amp;gt;&lt;br /&gt;        &amp;lt;asp:TreeView  NodeStyle-HorizontalPadding="6" ID="treeSitesFiles" runat="server" EnableViewState="false" /&amp;gt;&lt;br /&gt;        &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The C# code will be as follows&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;&lt;br /&gt;    public partial class SampleUserControl : System.Web.UI.UserControl&lt;br /&gt;    {&lt;br /&gt;        protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            SPWeb site = SPContext.Current.Web;&lt;br /&gt;            SPFolder rootFolder = site.RootFolder;&lt;br /&gt;            TreeNode rootNode = new TreeNode(site.Title, "", @"\_layouts\images\FPWEB16.GIF");&lt;br /&gt;            rootNode.NavigateUrl = site.ServerRelativeUrl;&lt;br /&gt;            LoadFolderNodes(rootFolder, rootNode);&lt;br /&gt;            treeSitesFiles.Nodes.Add(rootNode);&lt;br /&gt;            treeSitesFiles.ExpandDepth = 1;&lt;br /&gt;        }&lt;br /&gt;        protected void LoadFolderNodes(SPFolder folder, TreeNode folderNode)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            foreach (SPFolder childFolder in folder.SubFolders)&lt;br /&gt;            {&lt;br /&gt;                TreeNode childFolderNode = new TreeNode(childFolder.Name, "", @"\_layouts\images\FOLDER16.GIF");&lt;br /&gt;                childFolderNode.NavigateUrl = childFolder.ServerRelativeUrl;&lt;br /&gt;                LoadFolderNodes(childFolder, childFolderNode);&lt;br /&gt;                folderNode.ChildNodes.Add(childFolderNode);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            foreach (SPFile file in folder.Files)&lt;br /&gt;            {&lt;br /&gt;                TreeNode fileNode;&lt;br /&gt;                if (file.CustomizedPageStatus == SPCustomizedPageStatus.Uncustomized)&lt;br /&gt;                {&lt;br /&gt;                    fileNode = new TreeNode(file.Name, "", @"\_layouts\images\NEWDOC.GIF");&lt;br /&gt;                    fileNode.NavigateUrl = file.ServerRelativeUrl;&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    fileNode = new TreeNode(file.Name, "", @"\_layouts\images\RAT16.GIF");&lt;br /&gt;                    fileNode.NavigateUrl = file.ServerRelativeUrl;&lt;br /&gt;                }&lt;br /&gt;                folderNode.ChildNodes.Add(fileNode);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        protected void btnSPList_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            txtOutput.Text = "";&lt;br /&gt;            string sitePath = txtSiteUrl.Text;&lt;br /&gt;            // enter object model through site collection.&lt;br /&gt;            SPSite siteCollection = new SPSite(sitePath);&lt;br /&gt;            // obtain reference to top-level site.&lt;br /&gt;            SPWeb site = siteCollection.RootWeb;&lt;br /&gt;            txtOutput.Text = "Site Url is " + site.Url + "\n";&lt;br /&gt;            // enumerate through lists of site&lt;br /&gt;            foreach (SPList list in site.Lists)&lt;br /&gt;            {&lt;br /&gt;                txtOutput.Text = txtOutput.Text + "\n" + list.Title;&lt;br /&gt;                //Console.WriteLine(list.Title);&lt;br /&gt;            }&lt;br /&gt;            // clean up by calling Dispose.&lt;br /&gt;            site.Dispose();&lt;br /&gt;            siteCollection.Dispose();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 5-Add a class library project "MyWebPartClass" to your solution&lt;br /&gt;Step 6-Add reference "Windows sharepoint service"&lt;br /&gt;Step 7-Add a class "MyWebprtClass.cs" to your project &lt;br /&gt;Step 8-The code will be as follows&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Web;&lt;br /&gt;using Microsoft.SharePoint.WebPartPages;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary description for MyWebprtClass&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;namespace MyWebPartClass&lt;br /&gt;{&lt;br /&gt;    public class MyWebprtClass : WebPart&lt;br /&gt;    {&lt;br /&gt;        System.Web.UI.Control _myControl;&lt;br /&gt;        String err;&lt;br /&gt;        public MyWebprtClass()&lt;br /&gt;        {&lt;br /&gt;            //&lt;br /&gt;            // TODO: Add constructor logic here&lt;br /&gt;            //&lt;br /&gt;        }&lt;br /&gt;        protected override void CreateChildControls()&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                this.Controls.Clear();&lt;br /&gt;                _myControl = this.Page.LoadControl("~\\_layouts\\SampleUserControl.ascx");&lt;br /&gt;                this.Controls.Add(_myControl);&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                &lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        protected override void Render(System.Web.UI.HtmlTextWriter writer)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;               // _myControl = this.Page.LoadControl("~\\_layouts\\SampleUserControl.ascx");&lt;br /&gt;                _myControl.RenderControl(writer);&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                writer.Write(ex.Message.ToString());&lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 9-Add a xml "MyWebPartClass.xml" to your project and add the following line of code-&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;br /&gt;&amp;lt;webParts&amp;gt;&lt;br /&gt;  &amp;lt;webPart xmlns="http://schemas.microsoft.com/WebPart/v3"&amp;gt;&lt;br /&gt;    &amp;lt;metaData&amp;gt;&lt;br /&gt;      &amp;lt;type name="MyWebPartClass.MyWebprtClass, MyWebPartClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d" /&amp;gt;&lt;br /&gt;      &amp;lt;importErrorMessage&amp;gt;Cannot import this Web Part.&amp;lt;/importErrorMessage&amp;gt;&lt;br /&gt;    &amp;lt;/metaData&amp;gt;&lt;br /&gt;    &amp;lt;data&amp;gt;&lt;br /&gt;      &amp;lt;properties&amp;gt;&lt;br /&gt;        &amp;lt;property name="Title" type="string"&amp;gt;SmartParticles Web Part&amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name="Description" type="string"&amp;gt;&lt;br /&gt;          A demonstration using WebParticles in&lt;br /&gt;          a SharePoint WebPart&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name="ChromeType"&amp;gt;TitleOnly&amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name="ChromeState"&amp;gt;Normal&amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name="ItemLimit" type="int"&amp;gt;15&amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name="ItemStyle" type="string"&amp;gt;Default&amp;lt;/property&amp;gt;&lt;br /&gt;      &amp;lt;/properties&amp;gt;&lt;br /&gt;    &amp;lt;/data&amp;gt;&lt;br /&gt;  &amp;lt;/webPart&amp;gt;&lt;br /&gt;&amp;lt;/webParts&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 10-Add a strong name to your calss library project,build it and install it to GAC&lt;br /&gt;Step 11-Copy your aspx and cs page to the following folder&lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS&lt;br /&gt;Step 11-Open the web config of your sharepoint site and paste the following line to your SafeControls node&lt;br /&gt;&lt;br /&gt;&amp;lt;SafeControl Assembly="MyWebPartClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d" Namespace="MyWebPartClass" TypeName="*" Safe="True" /&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 12-Go to Site Settings-&gt;Galleries -&gt;Web Parts &lt;br /&gt;Click upload and browse the "MyWebPartClass.xml" ,click OK&lt;br /&gt;&lt;br /&gt;Then go to any web part zone and add your webpart "MyWebPartClass.xml" from the custom section.&lt;br /&gt;&lt;br /&gt;Output will be as follows-&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/TVF8m7H2KUI/AAAAAAAABVI/d9X7fWa4v0s/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 319px; height: 400px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/TVF8m7H2KUI/AAAAAAAABVI/d9X7fWa4v0s/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5571371222181488962" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2271168727728060186?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2271168727728060186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2271168727728060186' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2271168727728060186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2271168727728060186'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2011/02/create-simple-webpart.html' title='Create a simple webpart'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1EZkGmmHBwc/TVF8m7H2KUI/AAAAAAAABVI/d9X7fWa4v0s/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-6491577788944612614</id><published>2011-02-05T10:13:00.008+05:30</published><updated>2011-04-24T14:27:38.833+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Create A Simple Feature</title><content type='html'>Step 1-Create A class library project "MyFeature" in C# &lt;br /&gt;Step 2-Add reference "Windows Sharepoint Services"&lt;br /&gt;Step 3-Create a folder "Features" under the class library and a a folder "MyFeature" under the "Features" folder&lt;br /&gt;Step 4-Add a XML file "Feature.xml" under "MyFeature" folder&lt;br /&gt;Step 5-Add a schema file to your XML from the following path-&lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd&lt;br /&gt;Step 6-The content of the feature.xml will be as follows&lt;br /&gt;&amp;lt;Feature xmlns="http://schemas.microsoft.com/sharepoint/" &lt;br /&gt;         Id="0222472A-0CF1-46bc-8B65-3F319C7B3DBE" &lt;br /&gt;         Title="My Feature" &lt;br /&gt;         Description="This is my first feature" &lt;br /&gt;         Hidden="false" &lt;br /&gt;         Scope="Web"&lt;br /&gt;         ImageUrl="menuprofile.gif"&lt;br /&gt;         ReceiverClass="MyFeature.MyFeatureReceiver"&lt;br /&gt;         ReceiverAssembly="MyFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30534ee939de1c1d"&lt;br /&gt;         &amp;gt;&lt;br /&gt;  &amp;lt;ElementManifests &amp;gt;&lt;br /&gt;    &amp;lt;ElementManifest Location="Elements.xml"/&amp;gt;&lt;br /&gt;  &amp;lt;/ElementManifests&amp;gt;  &lt;br /&gt;&amp;lt;/Feature&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Id Value must be unique and will be generated from Tools-&gt;Guid Generator".Title ,description and image will be displayed in the feature list of your web site.Scope can be Farm,WebApplication,Site,Web depending on the scenario.&lt;br /&gt;ReceiverClass and ReceiverAssembly will be explain in the next section.&lt;br /&gt;ElementManifests element will call another xml.&lt;br /&gt;&lt;br /&gt;Step 6-Add "Elements.xml" under "MyFeature" folder.&lt;br /&gt;The content of the Elements.xml will be as follows-&lt;br /&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt;  &amp;lt;Module Name="MyModule" Path="" Url=""&amp;gt;&lt;br /&gt;    &amp;lt;File Url="MyModule.aspx" &lt;br /&gt;          Type="Ghostable" &lt;br /&gt;          IgnoreIfAlreadyExists="FALSE"&amp;gt;&lt;br /&gt;    &amp;lt;/File&amp;gt;&lt;br /&gt;  &amp;lt;/Module&amp;gt;&lt;br /&gt;  &amp;lt;CustomAction Id="SiteActionsToolbar" &lt;br /&gt;                GroupId="SiteActions" &lt;br /&gt;                Location="Microsoft.SharePoint.StandardMenu" &lt;br /&gt;                Sequence="1000" &lt;br /&gt;                Title="Go To MyModule"&lt;br /&gt;                ImageUrl="~/_layouts/images/menuprofile.gif"&amp;gt;&lt;br /&gt;    &amp;lt;UrlAction Url="~site/MyModule.aspx"/&amp;gt;&lt;br /&gt;  &amp;lt;/CustomAction&amp;gt;  &lt;br /&gt;&amp;lt;/Elements&amp;gt;&lt;br /&gt;&lt;br /&gt;CustomAction element defines where the feature will be displayed after activation.&lt;br /&gt;UrlAction element defines the url of the aspx page.But to access the url we first need to define File url.&lt;br /&gt;&lt;br /&gt;Step 7-Add a text file "MyModule.aspx" under the "MyFeature" folder.The content will be as follows&lt;br /&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~masterurl\default.master" %&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt;Hello , This is my test page&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 8-Add a class file under the class library&lt;br /&gt;"MyFeatureReceiver.cs"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The content will be as follows&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;&lt;br /&gt;namespace MyFeature&lt;br /&gt;{&lt;br /&gt;    public class MyFeatureReceiver:SPFeatureReceiver&lt;br /&gt;    {&lt;br /&gt;        public override void FeatureActivated(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            SPWeb site = (SPWeb)properties.Feature.Parent;&lt;br /&gt;            // SPWeb site = SPContext.Current.Web;//when the scope of the feature is site&lt;br /&gt;            // track original site Title using SPWeb property bag&lt;br /&gt;            site.Properties["OriginalTitle"] = site.Title;&lt;br /&gt;            site.Properties.Update();&lt;br /&gt;            // update site title&lt;br /&gt;            site.Title = "My Feature has been activated";&lt;br /&gt;            site.Update();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            // reset site Title back to its original value&lt;br /&gt;            SPWeb site = (SPWeb)properties.Feature.Parent;&lt;br /&gt;            //SPWeb site = SPContext.Current.Web;//when the scope of the feature is site&lt;br /&gt;            site.Title = site.Properties["OriginalTitle"];&lt;br /&gt;            site.Update();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureInstalled(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 9-Add a strong name to your class library ,build it and copy the dll to GAC&lt;br /&gt;Step 10-Open the Feature.xml and write the ReceiverClass,ReceiverAssembly according to your "MyFeatureReceiver.cs"&lt;br /&gt;&lt;br /&gt;Your solution structure will be as follows-&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/TUzrkn7hbNI/AAAAAAAABUQ/sdQmD4gRJ0M/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 248px; height: 284px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/TUzrkn7hbNI/AAAAAAAABUQ/sdQmD4gRJ0M/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5570085853576916178" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 11-Copy your "MyFeature" folder (which is under the "Features" folder) to the following location&lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES&lt;br /&gt;&lt;br /&gt;Step 12-Install your feature by the following command in the command prompt-&lt;br /&gt;stsadm -o InstallFeature -name MyFeature -force&lt;br /&gt;&lt;br /&gt;Stsadm exe will be found in the following path &lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE&lt;br /&gt;&lt;br /&gt;Step 13-Activate your feature from the site setting-&gt;site features&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/TUztfV9q-7I/AAAAAAAABUY/QnTa9m7nSEY/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 95px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/TUztfV9q-7I/AAAAAAAABUY/QnTa9m7nSEY/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5570087961878002610" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 14-After activation , you will find the title and label under the menu&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/TUzutyUPYWI/AAAAAAAABUg/_It1BcquVn4/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 242px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/TUzutyUPYWI/AAAAAAAABUg/_It1BcquVn4/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5570089309518651746" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 15-Click on the "Go To MyModule" ,you will be navigated to your MyModule.aspx&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/TUzvgjkgpFI/AAAAAAAABUo/qdXq2wXRUvM/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 242px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/TUzvgjkgpFI/AAAAAAAABUo/qdXq2wXRUvM/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5570090181733688402" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 16-After deactivation of your feature ,all of these thing will be undone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-6491577788944612614?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/6491577788944612614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=6491577788944612614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6491577788944612614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6491577788944612614'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2011/02/create-simple-feature.html' title='Create A Simple Feature'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/TUzrkn7hbNI/AAAAAAAABUQ/sdQmD4gRJ0M/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2351204968791078168</id><published>2010-05-31T14:30:00.005+05:30</published><updated>2011-02-05T09:36:53.372+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Different Isolation Level in SQL Server 2005</title><content type='html'>There are four types of isolation level as follows&lt;br /&gt;READ UNCOMMITTED &lt;br /&gt;READ COMMITTED &lt;br /&gt;REPEATABLE READ &lt;br /&gt;SERIALIZABLE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Read uncommitted:When it's used, SQL Server not issue shared locks while reading data. So, you can read an uncommitted transaction that might get rolled back later. This isolation level is also called dirty read. This is the lowest isolation level. It ensures only that a physically corrupt data will not be read.&lt;br /&gt;&lt;br /&gt;Read committed:This is the default isolation level in SQL Server. When it's used, SQL Server will use shared locks while reading data. It ensures that a physically corrupt data will not be read and will never read data that another application has changed and not yet committed, but it does not ensure that the data will not be changed before the end of the transaction.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Repeatable read:When it's used, the dirty reads and nonrepeatable reads cannot occur. It means that locks will be placed on all data that is used in a query, and another transactions cannot update the data.&lt;br /&gt;&lt;br /&gt;Serializable:Most restrictive isolation level. When it's used, then phantom values cannot occur. It prevents other users from updating or inserting rows into the data set until the transaction is complete.&lt;br /&gt;&lt;br /&gt;SET TRANSACTION ISOLATION LEVEL &lt;br /&gt;    {&lt;br /&gt;        READ COMMITTED &lt;br /&gt;        | READ UNCOMMITTED &lt;br /&gt;        | REPEATABLE READ &lt;br /&gt;        | SERIALIZABLE&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED&lt;br /&gt;GO&lt;br /&gt;DBCC USEROPTIONS&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Different Concurrency Level:&lt;br /&gt;&lt;br /&gt;Nonrepeatable read&lt;br /&gt;When a transaction reads the same row more than one time, and between the&lt;br /&gt;two (or more) reads, a separate transaction modifies that row. Because the&lt;br /&gt;row was modified between reads within the same transaction, each read&lt;br /&gt;produces different values, which introduces inconsistency.Nonrepeatable read—Nonrepeatable reads happen when a transaction performs the same query two or more times and each time the data is different. This is usually due to another concurrent transaction updating the data&lt;br /&gt;between the queries.&lt;br /&gt;&lt;br /&gt;Dirty read—Dirty reads occur when one transaction reads data that has been written but not yet committed by another transaction. If the changes are later rolled back, the data obtained by the first transaction will be invalid.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;phantom&lt;br /&gt;Phantom behavior occurs when a transaction attempts to select a row that&lt;br /&gt;does not exist and a second transaction inserts the row before the first&lt;br /&gt;transaction finishes. If the row is inserted, the row appears as a phantom&lt;br /&gt;to the first transaction, inconsistently appearing and disappearing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2351204968791078168?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2351204968791078168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2351204968791078168' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2351204968791078168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2351204968791078168'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/05/different-isolation-level-in-sql-server.html' title='Different Isolation Level in SQL Server 2005'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-6955241708459975210</id><published>2010-05-02T11:22:00.000+05:30</published><updated>2010-05-22T09:29:38.676+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to get records in random order from a sql query in sql server?</title><content type='html'>In SQL Server we can get records in random order from a sql query using NEWID() Function like:&lt;br /&gt;&lt;br /&gt;SELECT Subject FROM dbo.test ORDER BY NEWID()&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-6955241708459975210?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/6955241708459975210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=6955241708459975210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6955241708459975210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6955241708459975210'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/05/how-to-get-records-in-random-order-from.html' title='How to get records in random order from a sql query in sql server?'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-9214997154181358515</id><published>2010-05-02T11:06:00.002+05:30</published><updated>2010-05-02T11:12:00.754+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>What are the default databases of SQL Server</title><content type='html'>Microsoft SQL SERVER Provides 4 default databases &lt;br /&gt;&lt;br /&gt;1.Master (Controls other Databases):The Master database holds information for all databases located on the SQL Server instance and is the glue that holds the engine together. Because SQL Server cannot start without a functioning master database, you must administer this database with care.&lt;br /&gt;&lt;br /&gt;2.Model (Template for new Databases)&lt;br /&gt;&lt;br /&gt;3.Msdb (Scheduling and Job Information):The msdb database stores information regarding database backups, SQL Agent information, DTS packages, SQL Server jobs, and some replication information such as for log shipping.&lt;br /&gt;&lt;br /&gt;4.Tempdb (Temporary Storage):The tempdb holds temporary objects such as global and local temporary tables and stored procedures. The model is essentially a template database used in the creation of any new user database created in the instance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-9214997154181358515?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/9214997154181358515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=9214997154181358515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/9214997154181358515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/9214997154181358515'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/05/what-are-default-databases-of-sql.html' title='What are the default databases of SQL Server'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2629004860528122664</id><published>2010-04-24T19:56:00.011+05:30</published><updated>2010-04-24T20:28:25.235+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Maximum Capacity of different properties for SQL Server</title><content type='html'>The following table specifies the maximum sizes and numbers of various objects defined in SQL Server databases or referenced in Transact-SQL statements.&lt;br /&gt;&lt;table cellspacing="0" cellpadding="0" width="450" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;SQL Server Database Engine object &lt;/th&gt;&lt;th&gt;Maximum sizes/numbers SQL Server (32-bit) &lt;/th&gt;&lt;th&gt;Maximum sizes/numbers SQL Server (64-bit) &lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Batch size 1&lt;/td&gt;&lt;td&gt;65,536 * Network Packet Size&lt;/td&gt;&lt;td&gt;65,536 * Network Packet Size&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes per short string column&lt;/td&gt;&lt;td&gt;8,000&lt;/td&gt;&lt;td&gt;8,000&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes per GROUP BY, ORDER BY&lt;/td&gt;&lt;td&gt;8,060&lt;/td&gt;&lt;td&gt;8,060&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes per index key&lt;span class="sup"&gt;2&lt;/span&gt;&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes per foreign key&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes per primary key&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes per row&lt;span class="sup"&gt;8&lt;/span&gt;&lt;/td&gt;&lt;td&gt;8,060&lt;/td&gt;&lt;td&gt;8,060&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes in source text of a stored procedure&lt;/td&gt;&lt;td&gt;Lesser of batch size or 250 MB&lt;/td&gt;&lt;td&gt;Lesser of batch size or 250 MB&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bytes per &lt;strong&gt;varchar(max)&lt;/strong&gt;, &lt;strong&gt;varbinary(max)&lt;/strong&gt;, &lt;strong&gt;xml&lt;/strong&gt;, &lt;strong&gt;text&lt;/strong&gt;, or &lt;strong&gt;image&lt;/strong&gt; column&lt;/td&gt;&lt;td&gt;2^31-1&lt;/td&gt;&lt;td&gt;2^31-1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Characters per &lt;strong&gt;ntext&lt;/strong&gt; or &lt;strong&gt;nvarchar(max)&lt;/strong&gt; column&lt;/td&gt;&lt;td&gt;2^30-1&lt;/td&gt;&lt;td&gt;2^30-1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Clustered indexes per table&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns in GROUP BY, ORDER BY&lt;/td&gt;&lt;td&gt;Limited only by number of bytes&lt;/td&gt;&lt;td&gt;Limited only by number of bytes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns or expressions in a GROUP BY WITH CUBE or WITH ROLLUP statement&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per index key&lt;span class="sup"&gt;7&lt;/span&gt;&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per foreign key&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per primary key&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per nonwide table&lt;/td&gt;&lt;td&gt;1,024&lt;/td&gt;&lt;td&gt;1,024&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per wide table&lt;/td&gt;&lt;td&gt;30,000&lt;/td&gt;&lt;td&gt;30,000&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per SELECT statement&lt;/td&gt;&lt;td&gt;4,096&lt;/td&gt;&lt;td&gt;4,096&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per INSERT statement&lt;/td&gt;&lt;td&gt;4096&lt;/td&gt;&lt;td&gt;4096&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Connections per client&lt;/td&gt;&lt;td&gt;Maximum value of configured connections&lt;/td&gt;&lt;td&gt;Maximum value of configured connections&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Database size&lt;/td&gt;&lt;td&gt;524,272 terabytes&lt;/td&gt;&lt;td&gt;524,272 terabytes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Databases per instance of SQL Server&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Filegroups per database&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Files per database&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;File size (data)&lt;/td&gt;&lt;td&gt;16 terabytes&lt;/td&gt;&lt;td&gt;16 terabytes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;File size (log)&lt;/td&gt;&lt;td&gt;2 terabytes&lt;/td&gt;&lt;td&gt;2 terabytes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Foreign key table references per table&lt;span class="sup"&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td&gt;253&lt;/td&gt;&lt;td&gt;253&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Identifier length (in characters)&lt;/td&gt;&lt;td&gt;128&lt;/td&gt;&lt;td&gt;128&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Instances per computer&lt;/td&gt;&lt;td&gt;50 instances on a stand-alone server for all SQL Server editions except for Workgroup. Workgroup supports a maximum of 16 instances per computer.SQL Server supports 25 instances on a failover cluster.&lt;/td&gt;&lt;td&gt;50 instances on a stand-alone server.25 instances on a failover cluster.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Length of a string containing SQL statements (batch size)&lt;span class="sup"&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td&gt;65,536 * Network packet size&lt;/td&gt;&lt;td&gt;65,536 * Network packet size&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Locks per connection&lt;/td&gt;&lt;td&gt;Maximum locks per server&lt;/td&gt;&lt;td&gt;Maximum locks per server&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Locks per instance of SQL Server&lt;span class="sup"&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;Up to 2,147,483,647&lt;/td&gt;&lt;td&gt;Limited only by memory&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nested stored procedure levels&lt;span class="sup"&gt;6&lt;/span&gt;&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nested subqueries&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nested trigger levels&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nonclustered indexes per table&lt;/td&gt;&lt;td&gt;999&lt;/td&gt;&lt;td&gt;999&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Number of distinct expressions in the GROUP BY clause when any of the following are present: CUBE, ROLLUP, GROUPING SETS, WITH CUBE, WITH ROLLUP&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Number of grouping sets generated by operators in the GROUP BY clause&lt;/td&gt;&lt;td&gt;4,096&lt;/td&gt;&lt;td&gt;4,096&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Parameters per stored procedure&lt;/td&gt;&lt;td&gt;2,100&lt;/td&gt;&lt;td&gt;2,100&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Parameters per user-defined function&lt;/td&gt;&lt;td&gt;2,100&lt;/td&gt;&lt;td&gt;2,100&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;REFERENCES per table&lt;/td&gt;&lt;td&gt;253&lt;/td&gt;&lt;td&gt;253&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Rows per table&lt;/td&gt;&lt;td&gt;Limited by available storage&lt;/td&gt;&lt;td&gt;Limited by available storage&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tables per database&lt;span class="sup"&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;Limited by number of objects in a database&lt;/td&gt;&lt;td&gt;Limited by number of objects in a database&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Partitions per partitioned table or index&lt;/td&gt;&lt;td&gt;1,000&lt;/td&gt;&lt;td&gt;1,000&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Statistics on non-indexed columns&lt;/td&gt;&lt;td&gt;30,000&lt;/td&gt;&lt;td&gt;30,000&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tables per SELECT statement&lt;/td&gt;&lt;td&gt;Limited only by available resources&lt;/td&gt;&lt;td&gt;Limited only by available resources&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Triggers per table&lt;span class="sup"&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;Limited by number of objects in a database&lt;/td&gt;&lt;td&gt;Limited by number of objects in a database&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Columns per UPDATE statement (Wide Tables)&lt;/td&gt;&lt;td&gt;4096&lt;/td&gt;&lt;td&gt;4096&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;User connections&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;td&gt;32,767&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;XML indexes&lt;/td&gt;&lt;td&gt;249&lt;/td&gt;&lt;td&gt;249&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;1Network Packet Size is the size of the tabular data stream (TDS) packets used to communicate between applications and the relational Database Engine. The default packet size is 4 KB, and is controlled by the network packet size configuration option.2The maximum number of bytes in any index key cannot exceed 900 in SQL Server. You can define a key using variable-length columns whose maximum sizes add up to more than 900, provided no row is ever inserted with more than 900 bytes of data in those columns. In SQL Server, you can include nonkey columns in a nonclustered index to avoid the maximum index key size of 900 bytes.3Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints. The sum of the number of all objects in a database cannot exceed 2,147,483,647.4Although a table can contain an unlimited number of FOREIGN KEY constraints, the recommended maximum is 253. Depending on the hardware configuration hosting SQL Server, specifying additional FOREIGN KEY constraints may be expensive for the query optimizer to process.5This value is for static lock allocation. Dynamic locks are limited only by memory.6If a stored procedure accesses more than 8 databases, or more than 2 databases in interleaving, you will receive an error.7If the table contains one or more XML indexes, the clustering key of the user table is limited to 15 columns because the XML column is added to the clustering key of the primary XML index. In SQL Server, you can include nonkey columns in a nonclustered index to avoid the limitation of a maximum of 16 key columns. For more information, see &lt;a href="http://msdn.microsoft.com/en-us/library/ms190806.aspx"&gt;Index with Included Columns&lt;/a&gt;.8 SQL Server supports row-overflow storage which enables variable length columns to be pushed off-row. Only a 24-byte root is stored in the main record for variable length columns pushed out of row; because of this, the effective row limit is higher than in previous releases of SQL Server. For more information, see the "Row-Overflow Data Exceeding 8 KB" topic in SQL Server Books Online. &lt;br /&gt;&lt;br /&gt;Document Obtain From:&lt;br /&gt;http://msdn.microsoft.com/en-us/library/ms143432.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2629004860528122664?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2629004860528122664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2629004860528122664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2629004860528122664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2629004860528122664'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/04/maximum-capacity-of-sql-server.html' title='Maximum Capacity of different properties for SQL Server'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-5785903172513867531</id><published>2010-04-24T17:53:00.002+05:30</published><updated>2010-04-24T17:58:21.813+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Summarizing Data Using ROLLUP and CUBE</title><content type='html'>The ROLLUP operator is useful in generating reports that contain subtotals and totals. &lt;br /&gt;&lt;br /&gt;For example, a simple table Inventory contains the following:&lt;br /&gt;Item                 Color                Quantity                   &lt;br /&gt;-------------------- -------------------- -------------------------- &lt;br /&gt;Table                Blue                 124                        &lt;br /&gt;Table                Red                  223                        &lt;br /&gt;Chair                Blue                 101                        &lt;br /&gt;Chair                Red                  210                        &lt;br /&gt;&lt;br /&gt;This query generates a subtotal report:&lt;br /&gt;&lt;br /&gt;SELECT CASE WHEN (GROUPING(Item) = 1) THEN 'ALL'&lt;br /&gt;            ELSE ISNULL(Item, 'UNKNOWN')&lt;br /&gt;       END AS Item,&lt;br /&gt;       CASE WHEN (GROUPING(Color) = 1) THEN 'ALL'&lt;br /&gt;            ELSE ISNULL(Color, 'UNKNOWN')&lt;br /&gt;       END AS Color,&lt;br /&gt;       SUM(Quantity) AS QtySum&lt;br /&gt;FROM Inventory&lt;br /&gt;GROUP BY Item, Color WITH ROLLUP&lt;br /&gt;&lt;br /&gt;Item                 Color                QtySum                     &lt;br /&gt;-------------------- -------------------- -------------------------- &lt;br /&gt;Chair                Blue                 101.00                     &lt;br /&gt;Chair                Red                  210.00                     &lt;br /&gt;Chair                ALL                  311.00                     &lt;br /&gt;Table                Blue                 124.00                     &lt;br /&gt;Table                Red                  223.00                     &lt;br /&gt;Table                ALL                  347.00                     &lt;br /&gt;ALL                  ALL                  658.00                     &lt;br /&gt;&lt;br /&gt;(7 row(s) affected)&lt;br /&gt;&lt;br /&gt;If the ROLLUP keyword in the query is changed to CUBE, the CUBE result set is the same, except these two additional rows are returned at the end:&lt;br /&gt;ALL                  Blue                 225.00                     &lt;br /&gt;ALL                  Red                  433.00       &lt;br /&gt;&lt;br /&gt;Following are the specific differences between CUBE and ROLLUP: &lt;br /&gt;&lt;br /&gt;CUBE generates a result set that shows aggregates for all combinations of values in the selected columns.&lt;br /&gt;&lt;br /&gt;ROLLUP generates a result set that shows aggregates for a hierarchy of values in the selected columns.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-5785903172513867531?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/5785903172513867531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=5785903172513867531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5785903172513867531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5785903172513867531'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/04/summarizing-data-using-rollup-and-cube.html' title='Summarizing Data Using ROLLUP and CUBE'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-23535970388959084</id><published>2010-04-13T22:34:00.006+05:30</published><updated>2010-04-24T17:39:26.715+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Rank Function in SQL Server</title><content type='html'>SQL Server 2005 introduced new ranking functions. This article is an introduction to these functions, difference between them and when to use each and a few examples. &lt;div style="COLOR: transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div  style="color:transparent;"&gt;&lt;span style="font-size:large;"&gt;Ranking What:&lt;/span&gt;&lt;/div&gt;&lt;div  style="color:transparent;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div  style="color:transparent;"&gt;The new ranking functions are new internal functions to SQL Server 2005/2008.&lt;/div&gt;&lt;div color="transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div color="transparent"&gt;In simple terms, ranking functions allow you to sequentially number your result set. Your result set can be partitioned so the numbering essentially resets for each partition for example you can get the sales rank of employees partitioned by their department, or manager etc..&lt;/div&gt;&lt;div color="transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div color="transparent"&gt;What's worth mentioning is that ranking functions are non-deterministic so you cannot use them in something like an indexed view.&lt;/div&gt;&lt;div color="transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div color="transparent"&gt;&lt;span style="font-size:large;"&gt;Sample Table:&lt;/span&gt;&lt;/div&gt;&lt;div color="transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div color="transparent"&gt;This will serve as our sample table for all our examples. &lt;/div&gt;&lt;div color="transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div color="transparent"&gt;sales_employee&lt;/div&gt;&lt;div color="transparent"&gt;&lt;table style="BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; BORDER-LEFT-COLOR: rgb(136,136,136); BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: rgb(136,136,136); MARGIN: 0px; BORDER-TOP-COLOR: rgb(136,136,136); BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: rgb(136,136,136)" bordercolor="#888" cellspacing="0" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;name&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;territory&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;sales_amount&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;A&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;100&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;B&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;C&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;D&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;E&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;400&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;F&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;G&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;H&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;500&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;I&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;600&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;J&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Z&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;K&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Z&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;700&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;div color="transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div color="transparent"&gt;&lt;span style="font-size:large;"&gt;Syntax and Examples:&lt;/span&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;ROW_NUMBER () OVER ( [ &amp;lt;partition_by_clause&amp;gt; ] &amp;lt;order_by_clause&amp;gt; )&lt;/div&gt;WHERE&lt;br /&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;Returns the row number of the result set for each row in a partition based on the order provided in the order by clause.&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;RANK () OVER ( [ &amp;lt;partition_by_clause&amp;gt; ] &amp;lt;order_by_clause&amp;gt; )&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;Similar to Row_Number() only Rank determines the position, or lack for a better word, ranking of each row based on the Order By clause. Rank is usually used with the Partition clause to cluster your result sets. Rank also skips numbers, if 2 or more records tie in value, they will receive the same rank. The following rank would 1+ the total number of records in the same partition so for example (1, 2, 2, 2, 5, 6)&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;DENSE_RANK () OVER ( [ &amp;lt;partition_by_clause&amp;gt; ] &amp;lt;order_by_clause&amp;gt; )&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;Same as Rank() only guarantees consecutive integers (No skipping) (1, 2, 2, 2, 2, 3). If a tie occurs, it will sort arbitrarily (based on the execution plan and indexes used) and continue.&lt;br /&gt;&lt;br /&gt;NTILE (integer_expression) OVER ( [ &amp;lt;partition_by_clause&amp;gt; ] &amp;lt;order_by_clause&amp;gt; )&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;Used to distribute the rows in an ordered partition into x number of groups. Each row receives the group number it belongs to.&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;b&gt;Example: Simple ORDER BY clause&lt;/b&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;/div&gt;&lt;div class="sites-codeblock sites-codesnippet-block" style="BORDER-RIGHT: rgb(41,51,54) 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: rgb(41,51,54) 1px solid; DISPLAY: block; PADDING-LEFT: 1em; PADDING-BOTTOM: 0.5em; BORDER-LEFT: rgb(41,51,54) 1px solid; LINE-HEIGHT: 13px; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(41,51,54) 1px solid; BACKGROUND-COLOR: rgb(29,30,30)"&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;SELECT&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;name&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,territory&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,ROW_NUMBER() OVER ( ORDER BY sales_amount ) AS [row_number]&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,RANK() OVER ( ORDER BY sales_amount ) AS [rank]&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,DENSE_RANK() OVER ( ORDER BY sales_amount ) AS [dense_rank]&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,NTILE(4) OVER ( ORDER BY sales_amount ) AS [ntile]&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;FROM&lt;/code&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;sales_employee&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;table style="BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; BORDER-LEFT-COLOR: rgb(136,136,136); BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: rgb(136,136,136); MARGIN: 0px; BORDER-TOP-COLOR: rgb(136,136,136); BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: rgb(136,136,136)" bordercolor="#888" cellspacing="0" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;name&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;territory&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;sales_amount&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;ROW_NUMBER&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;RANK&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;DENSE_RANK&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;NTILE&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;A&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;100&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;B&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;C&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;D&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;5&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;5&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;E&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;400&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;8&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;8&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;F&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;6&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;5&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;G&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;7&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;5&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;H&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;500&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;9&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;9&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;5&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;I&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;600&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;10&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;10&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;6&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;J&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Z&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;K&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Z&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;700&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;11&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;11&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;7&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;b&gt;Example: Using PARTITION BY&lt;/b&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;/div&gt;&lt;div class="sites-codeblock sites-codesnippet-block" style="BORDER-RIGHT: rgb(41,51,54) 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: rgb(41,51,54) 1px solid; DISPLAY: block; PADDING-LEFT: 1em; PADDING-BOTTOM: 0.5em; BORDER-LEFT: rgb(41,51,54) 1px solid; LINE-HEIGHT: 13px; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(41,51,54) 1px solid; BACKGROUND-COLOR: rgb(29,30,30)"&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;SELECT&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;name&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,territory&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,ROW_NUMBER() OVER ( PARTITION BY territory ORDER BY sales_amount ) AS [row_number]&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,RANK() OVER ( PARTITION BY territory ORDER BY sales_amount ) AS [rank]&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,DENSE_RANK() OVER ( PARTITION BY territory ORDER BY sales_amount ) AS [dense_rank]&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;,NTILE(4) OVER ( PARTITION BY territory ORDER BY sales_amount ) AS [ntile]&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;FROM&lt;/code&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="WHITE-SPACE: pre"&gt;&lt;/span&gt;&lt;code style="COLOR: rgb(51,153,255)"&gt;sales_employee&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;div style="BACKGROUND-COLOR: transparent"&gt;&lt;table style="BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; BORDER-LEFT-COLOR: rgb(136,136,136); BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: rgb(136,136,136); MARGIN: 0px; BORDER-TOP-COLOR: rgb(136,136,136); BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: rgb(136,136,136)" bordercolor="#888" cellspacing="0" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;name&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;territory&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 30px"&gt;sales_amount&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;ROW_NUMBER&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;RANK&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;DENSE_RANK&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;NTILE&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;A&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;100&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;B&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;C&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;D&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;E&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;X&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;400&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;5&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;5&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;F&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;G&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;300&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;H&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;500&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;I&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Y&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;600&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;3&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;J&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Z&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;200&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 56px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;K&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 92px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;Z&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 106px; PADDING-TOP: 1px; HEIGHT: 15px"&gt;700&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;td style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; VERTICAL-ALIGN: top; WIDTH: 60px; PADDING-TOP: 1px"&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-23535970388959084?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/23535970388959084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=23535970388959084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/23535970388959084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/23535970388959084'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/04/rank-function-in-sql-server.html' title='Rank Function in SQL Server'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2339901999144939779</id><published>2010-03-18T13:08:00.003+05:30</published><updated>2010-03-18T13:24:44.143+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Get all Child IDs from Self Referential Table(DFS)</title><content type='html'>When you have a self referential table as follows,&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/S6HaPVrZwpI/AAAAAAAABSM/P3G5olQCV58/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5449876981147091602" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 341px; CURSOR: hand; HEIGHT: 210px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/S6HaPVrZwpI/AAAAAAAABSM/P3G5olQCV58/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and you need a stored proc which will take the parent key and return all the Childs and Sub Childs ID's along with the parent key.Like&lt;/p&gt;&lt;p&gt;if you supply :2&lt;/p&gt;&lt;p&gt;it will return 2,4,5,6,7,8 and&lt;/p&gt;&lt;p&gt;if you supply :5&lt;/p&gt;&lt;p&gt;it will return :5,7,8&lt;/p&gt;&lt;p&gt;In this context, you can create the following SP&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stored Proc:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;ALTER PROCEDURE [dbo].[FnGetChildIDs]&lt;br /&gt;@KEYID INT,&lt;br /&gt;@IDCOL VARCHAR(20),&lt;br /&gt;@IDVAL VARCHAR(20),&lt;br /&gt;@PIDCOL VARCHAR(20),&lt;br /&gt;@TABLENAME VARCHAR(200)&lt;br /&gt;AS&lt;br /&gt;&lt;br /&gt;DECLARE @STR VARCHAR(2000)&lt;br /&gt;Begin&lt;br /&gt;SET @STR= 'WITH RECURSIONCTE(' + @IDCOL +',CATEGORYDESCRIPTION)&lt;br /&gt;AS&lt;br /&gt;(&lt;br /&gt;SELECT '+@IDCOL +','+@IDVAL +'&lt;br /&gt;FROM ' + @TABLENAME +'&lt;br /&gt;WHERE ' +@IDCOL +'='+ CAST(@KEYID AS VARCHAR) +&lt;br /&gt;' UNION ALL&lt;br /&gt;SELECT R1.' +@IDCOL+',&lt;br /&gt;R1.'+@IDVAL +&lt;br /&gt;' FROM '+@TABLENAME + ' AS R1&lt;br /&gt;JOIN RECURSIONCTE AS R2 ON R1.'+@PIDCOL +'=R2.'+@IDCOL+'&lt;br /&gt;)&lt;br /&gt;SELECT '+ @IDCOL +' FROM RECURSIONCTE'&lt;br /&gt;PRINT(@STR)&lt;br /&gt;EXEC (@STR)&lt;br /&gt;&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if @@Error &lt;&gt; 0&lt;br /&gt;Begin&lt;br /&gt;Raiserror ('GetChildIDs',16,1)&lt;br /&gt;End &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Table Schema&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;CREATE TABLE [dbo].[tblProductMaster](&lt;br /&gt;[ProductID] [bigint] NOT NULL,&lt;br /&gt;[Name] [varchar](50) NULL,&lt;br /&gt;[ParentID] [bigint] NULL,&lt;br /&gt;CONSTRAINT [PK_tblProductMaster] PRIMARY KEY CLUSTERED&lt;br /&gt;(&lt;br /&gt;[ProductID] ASC&lt;br /&gt;)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Execute the SP:&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;EXEC FNGETCHILDIDS 2,'PRODUCTID','NAME','PARENTID','DBO.TBLPRODUCTMASTER' &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2339901999144939779?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2339901999144939779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2339901999144939779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2339901999144939779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2339901999144939779'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/03/get-all-child-ids-from-self-referential.html' title='Get all Child IDs from Self Referential Table(DFS)'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/S6HaPVrZwpI/AAAAAAAABSM/P3G5olQCV58/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-3510277712496317035</id><published>2010-02-24T10:24:00.003+05:30</published><updated>2010-02-24T10:31:50.195+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Dynamic Bulk Copy using OPENXML</title><content type='html'>&lt;strong&gt;SQL Stored Proc :&lt;/strong&gt;&lt;br /&gt;USE [WMMM]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  StoredProcedure [dbo].[spBulkInsert]    Script Date: 02/24/2010 10:21:49 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE PROCEDURE [dbo].[spBulkInsert] &lt;br /&gt;@ITEMS NTEXT,&lt;br /&gt;@TABLENAME VARCHAR(2000),&lt;br /&gt;@COLUMN_NAME VARCHAR(2000),&lt;br /&gt;@COLUMNNAMESWITHDATATYPE VARCHAR(2000),&lt;br /&gt;@DELETEOLDRECORD VARCHAR(1)&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;DECLARE @INSERT AS NVARCHAR(2000)&lt;br /&gt;BEGIN&lt;br /&gt; SET NOCOUNT ON;&lt;br /&gt;BEGIN TRY&lt;br /&gt; BEGIN TRANSACTION;&lt;br /&gt;  if @DELETEOLDRECORD='Y'&lt;br /&gt;  BEGIN&lt;br /&gt;   EXEC('DELETE FROM '+@TABLENAME)&lt;br /&gt;  END&lt;br /&gt;   DECLARE @HDOC INT &lt;br /&gt;   EXEC SP_XML_PREPAREDOCUMENT @HDOC OUTPUT,@ITEMS&lt;br /&gt;   SET @INSERT=&lt;br /&gt;   'INSERT INTO '+@TABLENAME +'('+@COLUMN_NAME +')&lt;br /&gt;   SELECT '+ @COLUMN_NAME +'&lt;br /&gt;   FROM OPENXML (@HDOC2, ''/ITEMS/ITEM'',2)&lt;br /&gt;   WITH ('+ @COLUMNNAMESWITHDATATYPE +') XMLITEMS'&lt;br /&gt;&lt;br /&gt;   DECLARE @PARMDEFINITION NVARCHAR(500);&lt;br /&gt;   SET @PARMDEFINITION = N'@HDOC2 INT';&lt;br /&gt;&lt;br /&gt;   EXECUTE SP_EXECUTESQL @INSERT, @PARMDEFINITION,&lt;br /&gt;         @HDOC2 = @HDOC;&lt;br /&gt;&lt;br /&gt;   EXEC SP_XML_REMOVEDOCUMENT @HDOC &lt;br /&gt; COMMIT TRANSACTION;&lt;br /&gt;END TRY&lt;br /&gt;BEGIN CATCH&lt;br /&gt; ROLLBACK TRANSACTION;&lt;br /&gt; EXEC dbo.sp_GetErrorInfo&lt;br /&gt;END CATCH &lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Execute The Above Sp Input Parameters :&lt;br /&gt;USE [WMMM]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;DECLARE @return_value int&lt;br /&gt;&lt;br /&gt;EXEC @return_value = [dbo].[spBulkInsert]&lt;br /&gt;  @ITEMS = N'&amp;lt;ITEMS&amp;gt;&amp;lt;ITEM&amp;gt;&amp;lt;PRODUCTID&amp;gt;1&amp;lt;/PRODUCTID&amp;gt;&amp;lt;NAME&amp;gt;..&amp;lt;/NAME&amp;gt;&amp;lt;PARENTID&amp;gt;0&amp;lt;/PARENTID&amp;gt;&amp;lt;/ITEM&amp;gt;&amp;lt;ITEM&amp;gt;&amp;lt;PRODUCTID&amp;gt;2&amp;lt;/PRODUCTID&amp;gt;&amp;lt;NAME&amp;gt;CHOCO DELIGHT&amp;lt;/NAME&amp;gt;&amp;lt;PARENTID&amp;gt;1&amp;lt;/PARENTID&amp;gt;&amp;lt;/ITEM&amp;gt;&amp;lt;ITEM&amp;gt;&amp;lt;PRODUCTID&amp;gt;3&amp;lt;/PRODUCTID&amp;gt;&amp;lt;NAME&amp;gt;WOW VANILLA&amp;lt;/NAME&amp;gt;&amp;lt;PARENTID&amp;gt;1&amp;lt;/PARENTID&amp;gt;&amp;lt;/ITEM&amp;gt;&amp;lt;ITEM&amp;gt;&amp;lt;PRODUCTID&amp;gt;4&amp;lt;/PRODUCTID&amp;gt;&amp;lt;NAME&amp;gt;CHOCO2&amp;lt;/NAME&amp;gt;&amp;lt;PARENTID&amp;gt;2&amp;lt;/PARENTID&amp;gt;&amp;lt;/ITEM&amp;gt;&amp;lt;ITEM&amp;gt;&amp;lt;PRODUCTID&amp;gt;5&amp;lt;/PRODUCTID&amp;gt;&amp;lt;NAME&amp;gt;CHOCO2_3&amp;lt;/NAME&amp;gt;&amp;lt;PARENTID&amp;gt;4&amp;lt;/PARENTID&amp;gt;&amp;lt;/ITEM&amp;gt;&amp;lt;ITEM&amp;gt;&amp;lt;PRODUCTID&amp;gt;6&amp;lt;/PRODUCTID&amp;gt;&amp;lt;NAME&amp;gt;CHOCO2_3_4&amp;lt;/NAME&amp;gt;&amp;lt;PARENTID&amp;gt;5&amp;lt;/PARENTID&amp;gt;&amp;lt;/ITEM&amp;gt;&amp;lt;ITEM&amp;gt;&amp;lt;PRODUCTID&amp;gt;7&amp;lt;/PRODUCTID&amp;gt;&amp;lt;NAME&amp;gt;CHOCO2_3_4_5&amp;lt;/NAME&amp;gt;&amp;lt;PARENTID&amp;gt;6&amp;lt;/PARENTID&amp;gt;&amp;lt;/ITEM&amp;gt;&amp;lt;/ITEMS&amp;gt;',&lt;br /&gt;  @TABLENAME = N'TBLTEST',&lt;br /&gt;  @COLUMN_NAME = N'PRODUCTID,NAME,PARENTID',&lt;br /&gt;  @COLUMNNAMESWITHDATATYPE = N'PRODUCTID BIGINT,NAME VARCHAR(50),PARENTID BIGINT',&lt;br /&gt;  @DELETEOLDRECORD = N'N'&lt;br /&gt;&lt;br /&gt;SELECT 'Return Value' = @return_value&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;--@COLUMN_NAME and @COLUMNNAMESWITHDATATYPE must be match with the destination &lt;br /&gt;--table name i.e TBLTEST&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Table Schema of tblTest:&lt;br /&gt;&lt;br /&gt;USE [WMMM]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  Table [dbo].[tblTest]    Script Date: 02/24/2010 10:29:03 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;SET ANSI_PADDING ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[tblTest](&lt;br /&gt; [ProductID] [bigint] NULL,&lt;br /&gt; [Name] [varchar](50) NULL,&lt;br /&gt; [ParentID] [bigint] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;SET ANSI_PADDING OFF&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-3510277712496317035?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/3510277712496317035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=3510277712496317035' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3510277712496317035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3510277712496317035'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2010/02/dynamic-bulk-copy-using-openxml.html' title='Dynamic Bulk Copy using OPENXML'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-8259270015499278642</id><published>2009-12-23T16:41:00.004+05:30</published><updated>2009-12-23T16:52:16.951+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Binding ASP .NET Treeview with LINQ to Stored Procedure</title><content type='html'>//--------------------------Table Structure---------------------------&lt;br /&gt;USE [WMMM]&lt;br /&gt;GO&lt;br /&gt;/****** Object: Table [dbo].[MenuMaster] Script Date: 12/23/2009 16:41:36 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;SET ANSI_PADDING ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[MenuMaster](&lt;br /&gt;[ID] [bigint] NOT NULL,&lt;br /&gt;[Name] [varchar](50) NULL,&lt;br /&gt;[ParentID] [bigint] NULL,&lt;br /&gt;CONSTRAINT [PK_MenuMaster] PRIMARY KEY CLUSTERED&lt;br /&gt;(&lt;br /&gt;[ID] ASC&lt;br /&gt;)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;&lt;br /&gt;//-------------------------Stored Proc To Retive Data----------------------&lt;br /&gt;USE [WMMM]&lt;br /&gt;GO&lt;br /&gt;/****** Object: StoredProcedure [dbo].[spMenuMasterSelect] Script Date: 12/23/2009 16:43:03 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;ALTER PROCEDURE [dbo].[spMenuMasterSelect]&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;SELECT ID,Name,ParentID from dbo.MenuMaster&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;SET ANSI_PADDING OFF&lt;br /&gt;//----------------------Code To Create Treeview---------------------&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using DAL;&lt;br /&gt;&lt;br /&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;/// Summary description for MenuBLL&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;///&lt;br /&gt;&lt;br /&gt;public class MenuBLL : IDisposable&lt;br /&gt;{&lt;br /&gt;WMMMDataContext db;&lt;br /&gt;//list of all nodes&lt;br /&gt;SortedList&amp;lt;int, MenuMaster&amp;gt; myMenus = new SortedList&amp;lt;int, MenuMaster&amp;gt;();&lt;br /&gt;//list of all created nodes&lt;br /&gt;SortedList&amp;lt;int, TreeNode&amp;gt; myCreatedNodes = new SortedList&amp;lt;int, TreeNode&amp;gt;();&lt;br /&gt;&lt;br /&gt;public MenuBLL()&lt;br /&gt;{&lt;br /&gt;//&lt;br /&gt;// TODO: Add constructor logic here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;public void CreateMenu(MenuBO objMenuBo)&lt;br /&gt;{&lt;br /&gt;TreeView TreeView1 = objMenuBo.LeftTreeView;&lt;br /&gt;TreeView1.Nodes.Clear();&lt;br /&gt;db = new WMMMDataContext();&lt;br /&gt;var found = from o in db.spMenuMasterSelect()&lt;br /&gt;select new { o.ID, o.Name, o.ParentID };&lt;br /&gt;MenuMaster mnuMaster = null;&lt;br /&gt;foreach (var result in found)&lt;br /&gt;{&lt;br /&gt;mnuMaster = new MenuMaster();&lt;br /&gt;mnuMaster.MenuID = Convert.ToInt32(result.ID);&lt;br /&gt;mnuMaster.MenuName = result.Name;&lt;br /&gt;mnuMaster.MenuParentId = Convert.ToInt32(result.ParentID);&lt;br /&gt;myMenus.Add(mnuMaster.MenuID, mnuMaster);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;TreeNode aNode = null;&lt;br /&gt;foreach (int akey in myMenus.Keys)&lt;br /&gt;{&lt;br /&gt;string code = myMenus[akey].MenuID.ToString();&lt;br /&gt;aNode = new TreeNode(myMenus[akey].MenuName, code);&lt;br /&gt;CreateNode(aNode, TreeView1);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public void CreateNode(TreeNode aNode, TreeView TreeView1)&lt;br /&gt;{&lt;br /&gt;//This list stores all the nodes id from the current node to the ultimate parent&lt;br /&gt;List&amp;lt;int&amp;gt; myPath = new List&amp;lt;int&amp;gt;();&lt;br /&gt;if (!myCreatedNodes.ContainsValue(aNode))//if the node was not alreazdy created&lt;br /&gt;{&lt;br /&gt;int nodeId = 1001;&lt;br /&gt;nodeId = Convert.ToInt32(aNode.Value);&lt;br /&gt;//Building the current node path untill the ultimate parent&lt;br /&gt;myPath.Add(nodeId);&lt;br /&gt;while (nodeId != 0)&lt;br /&gt;{&lt;br /&gt;if (nodeId != 0)&lt;br /&gt;{&lt;br /&gt;nodeId = myMenus[nodeId].MenuParentId;&lt;br /&gt;myPath.Add(nodeId);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;//descending from Ultimate parent until the node&lt;br /&gt;//if the current node does not exists we create it and add it to created nodes collection.&lt;br /&gt;//if it has not a parent we add it to the treeview&lt;br /&gt;//if it has a parent,the parent was already created because we come from it, so we add the current node to the parent.&lt;br /&gt;TreeNode nodeToAdd = null, ParentNodeTofind = null;&lt;br /&gt;for (int j = myPath.Count - 1; j &amp;gt; -1; j--)&lt;br /&gt;{&lt;br /&gt;if (myPath[j] != 0)&lt;br /&gt;{&lt;br /&gt;//checking for each path if the nodes was already created&lt;br /&gt;if (!myCreatedNodes.Keys.Contains(myMenus[myPath[j]].MenuID))&lt;br /&gt;{&lt;br /&gt;//creating the node and adding it to the created nodes collection.&lt;br /&gt;nodeToAdd = new TreeNode(myMenus[myPath[j]].MenuName, myMenus[myPath[j]].MenuID.ToString());&lt;br /&gt;nodeToAdd.NavigateUrl = "../Nodes/Dashboard.aspx?NodeID=" + myMenus[myPath[j]].MenuID.ToString();&lt;br /&gt;myCreatedNodes.Add(myMenus[myPath[j]].MenuID, nodeToAdd);&lt;br /&gt;int parentId = myMenus[myPath[j]].MenuParentId;&lt;br /&gt;//checking if the node has a parent&lt;br /&gt;if (parentId == 0)//this node has no parent we add it to the tree view&lt;br /&gt;{&lt;br /&gt;TreeView1.Nodes.Add(nodeToAdd);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else//this node has a parent&lt;br /&gt;{&lt;br /&gt;//rerieving parent node (sure to find it)&lt;br /&gt;ParentNodeTofind = myCreatedNodes[myMenus[myPath[j]].MenuParentId];&lt;br /&gt;//we add the node to its parent childNodes&lt;br /&gt;ParentNodeTofind.ChildNodes.Add(nodeToAdd);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#region IDisposable Members&lt;br /&gt;public void Dispose()&lt;br /&gt;{&lt;br /&gt;Dispose(true);&lt;br /&gt;GC.SuppressFinalize(this);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;private bool disposedValue = false;// To detect redundant calls&lt;br /&gt;protected virtual void Dispose(bool disposing)&lt;br /&gt;{&lt;br /&gt;if (!this.disposedValue)&lt;br /&gt;{&lt;br /&gt;if (disposing)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;// TODO: free managed resources when explicitly called&lt;br /&gt;//if (dbCommand != null)&lt;br /&gt;//{&lt;br /&gt;// dbCommand.Dispose();&lt;br /&gt;// //GC.SuppressFinalize(dbCommand);&lt;br /&gt;//}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;// TODO: free shared unmanaged resources&lt;br /&gt;this.disposedValue = true;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class MenuMaster&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;private string _MenuName;&lt;br /&gt;private int _MenuID;&lt;br /&gt;private int _MenuParentId;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public string MenuName&lt;br /&gt;{&lt;br /&gt;get { return _MenuName; }&lt;br /&gt;&lt;br /&gt;set { _MenuName = value; }&lt;br /&gt;}&lt;br /&gt;public int MenuID&lt;br /&gt;{&lt;br /&gt;get { return _MenuID; }&lt;br /&gt;set { _MenuID = value; }&lt;br /&gt;}&lt;br /&gt;public int MenuParentId&lt;br /&gt;{&lt;br /&gt;get { return _MenuParentId; }&lt;br /&gt;set { _MenuParentId = value; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//--------------------------Tree View in ASPX Page---------------&lt;br /&gt;&amp;lt;asp:TreeView ID="tvLeftMenu" runat="server" CssClass="input-value" ShowLines="True"&lt;br /&gt;BackColor="Transparent" BorderColor="DarkGray" Font-Bold="True" Font-Size="Small"&lt;br /&gt;ForeColor="Black" ExpandDepth="13" ShowExpandCollapse="false" Width="100px" Font-Names="Times New Roman"&amp;gt;&lt;br /&gt;&amp;lt;/asp:TreeView&amp;gt;&lt;br /&gt;&lt;br /&gt;//-----------------------SQL Table Data-----------------&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SzH84cWdS4I/AAAAAAAABRg/xUTx2U_WZ3w/s1600-h/SQL+Table.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5418389873316678530" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 261px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SzH84cWdS4I/AAAAAAAABRg/xUTx2U_WZ3w/s400/SQL+Table.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;//------------------------Output Of the Treeview-------------------&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SzH9BNUN1kI/AAAAAAAABRo/il9F42cK7IE/s1600-h/Tree.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5418390023899567682" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 123px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SzH9BNUN1kI/AAAAAAAABRo/il9F42cK7IE/s400/Tree.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;//------------------------For LINQ To Stored Proc Visit the following URL&lt;br /&gt;&lt;a href="http://portal-management.blogspot.com/2009/12/introduction-to-linq-to-stored.html"&gt;Introduction to Linq To Stored Procedure&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-8259270015499278642?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/8259270015499278642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=8259270015499278642' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/8259270015499278642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/8259270015499278642'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/binding-asp-net-treeview-with-linq-to.html' title='Binding ASP .NET Treeview with LINQ to Stored Procedure'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/SzH84cWdS4I/AAAAAAAABRg/xUTx2U_WZ3w/s72-c/SQL+Table.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-1417813954956939608</id><published>2009-12-20T21:42:00.030+05:30</published><updated>2009-12-20T23:28:55.631+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Create Multi Layer Architecture using WCF</title><content type='html'>WCF is the Microsoft next generation technology for developing distributed applications.WCF is based on SOA.So,if we want to expose our component as a service,we can use WCF to host the service in IIS,WAS,Self Hosting or managed windows service.&lt;br /&gt;In the following example ,the main component is written in CalculateNumber class which contains a method Calculate.The calculate method takes two integer number and return an integer.So this is the component class.&lt;br /&gt;Now we have created CalculateServiceLayer class in the another project to make the component class(CalculateNumber ) to be available in the WCF Host.So in one side ,it will contain System.ServiceModel namespace for WCF and on the other side it will refer the component class CalculateNumber.&lt;br /&gt;Then as we need to host the service we need a console application projectHost) to hosting the service.The Host application configure the necessary settings like address,binding and contract and start the service in a particular address mentioned in the end point.&lt;br /&gt;Now the service is available for invoking.So we will create a client application (web/windows) to invoke the service.&lt;br /&gt;Lets start the step by step development.&lt;br /&gt;&lt;br /&gt;Step 1.Create a Class Library Project "CalculateNumber"&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5chUSHYoI/AAAAAAAABP4/O23n1LsmJMY/s1600-h/1CreateComponentCalculateNumber.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 287px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5chUSHYoI/AAAAAAAABP4/O23n1LsmJMY/s400/1CreateComponentCalculateNumber.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417369129223414402" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 2. Write a method in the class and build your component class CalculateNumber.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace CalculateNumber&lt;br /&gt;{&lt;br /&gt;    public class CalculateNumber&lt;br /&gt;    {&lt;br /&gt;        public int Calculate(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            return x + y;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 3.Add a new project (Service Layer) in the solution&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5dP9zxKEI/AAAAAAAABQA/1AiIHG2akqA/s1600-h/3AddNewProjForServiceLayer.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 171px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5dP9zxKEI/AAAAAAAABQA/1AiIHG2akqA/s400/3AddNewProjForServiceLayer.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417369930644400194" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 4.Choose a class library project and put the project name "CalculateServiceLayer".&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1EZkGmmHBwc/Sy5dzqbwZAI/AAAAAAAABQI/jMFHkNR18ME/s1600-h/4AddProjCalculateServiceLayer.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 258px;" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/Sy5dzqbwZAI/AAAAAAAABQI/jMFHkNR18ME/s400/4AddProjCalculateServiceLayer.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417370543918703618" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 5.Add a reference of System.ServiceModel and your component class dll i.e CalculateNumber.dll&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1EZkGmmHBwc/Sy5eQYPcR0I/AAAAAAAABQQ/yteDUYKPUhc/s1600-h/5AddRefSystemServiceModel.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 328px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/Sy5eQYPcR0I/AAAAAAAABQQ/yteDUYKPUhc/s400/5AddRefSystemServiceModel.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417371037251422018" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 6.Modify the class name Class1.cs to ICalculateSevice.cs and copy the entire code in place of existing code in Class1.cs&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using CalculateNumber;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;&lt;br /&gt;namespace CalculateServiceLayer&lt;br /&gt;{&lt;br /&gt;    [ServiceContract]&lt;br /&gt;    interface ICalculateSevice&lt;br /&gt;    {&lt;br /&gt;        [OperationContract]&lt;br /&gt;        int CalcalculateNumber(int m,int n);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 7.Add an another class file CalculateServiceType.cs and write the following code.Then build your application&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using CalculateNumber;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;&lt;br /&gt;namespace CalculateServiceLayer&lt;br /&gt;{&lt;br /&gt;    public class CalculateServiceType:ICalculateSevice&lt;br /&gt;    {&lt;br /&gt;        CalculateNumber.CalculateNumber cn;&lt;br /&gt;        #region ICalculateSevice Members&lt;br /&gt;&lt;br /&gt;        public int CalcalculateNumber(int m, int n)&lt;br /&gt;        {&lt;br /&gt;            cn=new CalculateNumber.CalculateNumber();&lt;br /&gt;            return cn.Calculate(m, n);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 8.Now add a Host console application in the same solution&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1EZkGmmHBwc/Sy5fcRcoOVI/AAAAAAAABQY/FpTMzikl8CI/s1600-h/8ConsoleAppHost.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 258px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/Sy5fcRcoOVI/AAAAAAAABQY/FpTMzikl8CI/s400/8ConsoleAppHost.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417372341097740626" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 9.Add a reference of System.ServiceModel and CalculateServiceLayer.dll.&lt;br /&gt;Open the Program.cs and write the code as follows&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;using CalculateServiceLayer;&lt;br /&gt;&lt;br /&gt;namespace Host&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            ServiceHost sh = new ServiceHost(typeof(CalculateServiceLayer.CalculateServiceType));&lt;br /&gt;            sh.Open();&lt;br /&gt;            Console.WriteLine("The Service is ready to use");&lt;br /&gt;            Console.ReadKey(true);&lt;br /&gt;            sh.Close();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 10.Add an App.config file in your Host project&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5gSLvsIZI/AAAAAAAABQg/4-IHfXjoq4U/s1600-h/10AddAppConfig.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 242px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5gSLvsIZI/AAAAAAAABQg/4-IHfXjoq4U/s400/10AddAppConfig.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417373267280011666" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 11.Write the necessary configuration in your App.config file as follows&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;    &amp;lt;behaviors&amp;gt;&lt;br /&gt;      &amp;lt;serviceBehaviors&amp;gt;&lt;br /&gt;        &amp;lt;behavior name="NewBehavior"&amp;gt;&lt;br /&gt;          &amp;lt;serviceMetadata httpGetEnabled="true" /&amp;gt;&lt;br /&gt;        &amp;lt;/behavior&amp;gt;&lt;br /&gt;      &amp;lt;/serviceBehaviors&amp;gt;&lt;br /&gt;    &amp;lt;/behaviors&amp;gt;&lt;br /&gt;    &amp;lt;services&amp;gt;&lt;br /&gt;      &amp;lt;service behaviorConfiguration="NewBehavior" name="CalculateServiceLayer.CalculateServiceType"&amp;gt;&lt;br /&gt;        &amp;lt;endpoint address="basic" binding="basicHttpBinding" bindingConfiguration=""&lt;br /&gt;            contract="CalculateServiceLayer.ICalculateSevice" /&amp;gt;&lt;br /&gt;        &amp;lt;host&amp;gt;&lt;br /&gt;          &amp;lt;baseAddresses&amp;gt;&lt;br /&gt;            &amp;lt;add baseAddress="http://localhost:3333/" /&amp;gt;&lt;br /&gt;          &amp;lt;/baseAddresses&amp;gt;&lt;br /&gt;        &amp;lt;/host&amp;gt;&lt;br /&gt;      &amp;lt;/service&amp;gt;&lt;br /&gt;    &amp;lt;/services&amp;gt;&lt;br /&gt;  &amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 12.Now your overall solution structure will be as follows&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5g9otOQdI/AAAAAAAABQo/eeinkdKTG5Y/s1600-h/12OverAllPgmStruct.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 214px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5g9otOQdI/AAAAAAAABQo/eeinkdKTG5Y/s400/12OverAllPgmStruct.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417374013788668370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 13.Right click on your Host application and click on "Start new instance" under Debug menu&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5hZVLj-QI/AAAAAAAABQw/BBJiTXZgJWI/s1600-h/13StartNewInstance.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 242px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5hZVLj-QI/AAAAAAAABQw/BBJiTXZgJWI/s400/13StartNewInstance.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417374489583548674" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 14.You can see the following console output&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5hk6plFJI/AAAAAAAABQ4/BDinU13bUMQ/s1600-h/14RunApplicationOutput.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 198px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5hk6plFJI/AAAAAAAABQ4/BDinU13bUMQ/s400/14RunApplicationOutput.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417374688620123282" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 15.Now create a web application that will invoke the Wcf service.Right click on the Reference and click on "Add service reference".&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sy5iOTCGFiI/AAAAAAAABRA/5RVYm3qqWxY/s1600-h/15AddServiceRef.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 301px; height: 332px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sy5iOTCGFiI/AAAAAAAABRA/5RVYm3qqWxY/s400/15AddServiceRef.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417375399540037154" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 16.Put the address "http://localhost:3333/"  ,click on Go and then select the service and click OK.Before that make sure your host application is running.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5jMYS7NUI/AAAAAAAABRI/CVXcO5q3zEo/s1600-h/untitled.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 326px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5jMYS7NUI/AAAAAAAABRI/CVXcO5q3zEo/s400/untitled.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417376466104694082" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 17.Now implement the service in your aspx page as follows&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;namespace ImplementCalculateNumber&lt;br /&gt;{&lt;br /&gt;    public partial class _Default : System.Web.UI.Page&lt;br /&gt;    {&lt;br /&gt;        protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            ServiceReference1.CalculateSeviceClient myproxy = new ImplementCalculateNumber.ServiceReference1.CalculateSeviceClient();&lt;br /&gt;            Response.Write(myproxy.CalcalculateNumber(19, 30).ToString());&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 18.Run your application ,you can see the following output&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sy5jwkt5B9I/AAAAAAAABRQ/2bPtL7dPHc4/s1600-h/17RunWebApp.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 329px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sy5jwkt5B9I/AAAAAAAABRQ/2bPtL7dPHc4/s400/17RunWebApp.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417377087914313682" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 19.If you modify in the component or service layer,update the service reference in the client (web) application&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5lHFZsWaI/AAAAAAAABRY/nbeXMPzL-VE/s1600-h/untitled2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 200px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5lHFZsWaI/AAAAAAAABRY/nbeXMPzL-VE/s400/untitled2.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5417378574156716450" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-1417813954956939608?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/1417813954956939608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=1417813954956939608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1417813954956939608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1417813954956939608'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/create-multi-layer-architecture-using.html' title='Create Multi Layer Architecture using WCF'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sy5chUSHYoI/AAAAAAAABP4/O23n1LsmJMY/s72-c/1CreateComponentCalculateNumber.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-5205150653929070612</id><published>2009-12-19T11:21:00.039+05:30</published><updated>2009-12-19T12:33:49.036+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><title type='text'>Introduction to Linq To Stored Procedure</title><content type='html'>LINQ to SQL provides a runtime infrastructure for managing relational data as objects without losing the ability to query. Your application is free to manipulate the objects while LINQ to SQL stays in the background tracking your changes automatically.It is possible to migrate current ADO.NET solutions to LINQ to SQL in a piecemeal fashion (sharing the same connections and transactions) since LINQ to SQL is simply another component in the ADO.NET family. LINQ to SQL also has extensive support for stored procedures, allowing reuse of the existing enterprise assets. In addition it can filter data in .NET end which are coming from the stored proc.&lt;br /&gt;Following are the steps describe you how LINQ to Stored proc works together.&lt;br /&gt;Step 1-First create a table in your SQL server database-&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SyxtsqLe50I/AAAAAAAABOg/PiYUeKzfLyc/s1600-h/1createtable.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416825065823987522" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 242px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SyxtsqLe50I/AAAAAAAABOg/PiYUeKzfLyc/s400/1createtable.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I have created a table MyTable in the Northwind database.The table contains three feilds(MyID int,MyName Varchar,MyAddress varchar) MyID is a autogenerate number and primary key in this table.&lt;br /&gt;Put some data in yout table&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Syxy9wkPW2I/AAAAAAAABPY/yneKb2dqxc0/s1600-h/8PutdataIntable.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416830857154354018" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 255px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Syxy9wkPW2I/AAAAAAAABPY/yneKb2dqxc0/s400/8PutdataIntable.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 2.Write the following stored proc in your database&lt;br /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;br /&gt;USE [Northwind]&lt;br /&gt;GO&lt;br /&gt;/****** Object: StoredProcedure [dbo].[spMyTableDelete] Script Date: 12/07/2009 00:08:17 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE PROCEDURE [dbo].[spMyTableDelete]&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;@MyID int&lt;br /&gt;-- @MyName varchar(50),&lt;br /&gt;-- @MyAddress varchar(50)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;DELETE from dbo.MyTable where MyID=@MyID&lt;br /&gt;--SELECT MyID,MyName,MyAddress from dbo.MyTable&lt;br /&gt;END&lt;br /&gt;--select * from MyTable&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;USE [Northwind]&lt;br /&gt;GO&lt;br /&gt;/****** Object: StoredProcedure [dbo].[spMyTableInsert] Script Date: 12/07/2009 00:09:25 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE PROCEDURE [dbo].[spMyTableInsert]&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;@MyName varchar(50),&lt;br /&gt;@MyAddress varchar(50)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;INSERT INTO dbo.MyTable(MyName,MyAddress)VALUES(@MyName,@MyAddress)&lt;br /&gt;END&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;USE [Northwind]&lt;br /&gt;GO&lt;br /&gt;/****** Object: StoredProcedure [dbo].[spMyTableSelect] Script Date: 12/07/2009 00:10:08 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE PROCEDURE [dbo].[spMyTableSelect]&lt;br /&gt;&lt;br /&gt;-- (&lt;br /&gt;-- @MyID int,&lt;br /&gt;-- @MyName varchar(50),&lt;br /&gt;-- @MyAddress varchar(50)&lt;br /&gt;-- )&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;SELECT MyID,MyName,MyAddress from dbo.MyTable&lt;br /&gt;END&lt;br /&gt;--select * from MyTable&lt;br /&gt;----------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;USE [Northwind]&lt;br /&gt;GO&lt;br /&gt;/****** Object: StoredProcedure [dbo].[spMyTableSelectMulti] Script Date: 12/07/2009 00:10:40 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE PROCEDURE [dbo].[spMyTableSelectMulti]&lt;br /&gt;&lt;br /&gt;-- (&lt;br /&gt;-- @MyID int&lt;br /&gt;-- @MyName varchar(50),&lt;br /&gt;-- @MyAddress varchar(50)&lt;br /&gt;-- )&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;&lt;br /&gt;SELECT MyID,MyName,MyAddress from dbo.MyTable where MyID=2&lt;br /&gt;SELECT MyID,MyName,MyAddress from dbo.MyTable where MyID=1&lt;br /&gt;END&lt;br /&gt;--select * from MyTable&lt;br /&gt;----------------------------------------------------------------------------------------------------------------------&lt;br /&gt;USE [Northwind]&lt;br /&gt;GO&lt;br /&gt;/****** Object: StoredProcedure [dbo].[spMyTableSelectMultiWithOutputParam] Script Date: 12/07/2009 00:11:27 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE PROCEDURE [dbo].[spMyTableSelectMultiWithOutputParam]&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;@MyID int,&lt;br /&gt;@MyName varchar(50) output&lt;br /&gt;-- @MyAddress varchar(50)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;&lt;br /&gt;SELECT MyID,MyName,MyAddress from dbo.MyTable&lt;br /&gt;SELECT @MyName=(SELECT MyName from dbo.MyTable where MyID=@MyID)&lt;br /&gt;END&lt;br /&gt;--select * from MyTable&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;USE [Northwind]&lt;br /&gt;GO&lt;br /&gt;/****** Object: StoredProcedure [dbo].[spMyTableUpdate] Script Date: 12/07/2009 00:12:25 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE PROCEDURE [dbo].[spMyTableUpdate]&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;@MyID int,&lt;br /&gt;@MyName varchar(50),&lt;br /&gt;@MyAddress varchar(50)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;UPDATE dbo.MyTable SET MyName=@MyName,MyAddress=@MyAddress&lt;br /&gt;WHERE MyID=@MyID&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;Step 3.Create a new web site in .NET IDE&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/Syxu91zpKII/AAAAAAAABOo/W-1huvtSxw0/s1600-h/2NewWebsite.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416826460514625666" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 261px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/Syxu91zpKII/AAAAAAAABOo/W-1huvtSxw0/s400/2NewWebsite.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 4.Choose "Add New Item" on your App_Code folder&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SyxvTGkEfBI/AAAAAAAABOw/ip1FbQAtWQk/s1600-h/3AddNewItem.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416826825789963282" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 256px; CURSOR: hand; HEIGHT: 345px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SyxvTGkEfBI/AAAAAAAABOw/ip1FbQAtWQk/s400/3AddNewItem.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 5.Choose "LINQ to SQL Classes" in yourAdd New Item Dialog and put the file name "MyDataClasses.dbml".&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/Syxv1JMsofI/AAAAAAAABO4/qhjzJ16w53c/s1600-h/4CreatedbmlFile.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416827410612789746" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 265px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/Syxv1JMsofI/AAAAAAAABO4/qhjzJ16w53c/s400/4CreatedbmlFile.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 6.Open the MyDataClasses.dbml and modify the name "MyDataContext".Click on "Server Explorer" in MyDataClasses.dbml&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyxxoEaCgII/AAAAAAAABPA/Lr3YzCYmg1M/s1600-h/5CheckTheNameClickServerExpl.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416829385011527810" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 242px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyxxoEaCgII/AAAAAAAABPA/Lr3YzCYmg1M/s400/5CheckTheNameClickServerExpl.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step7.In the Server Explorer click on "Connect to database" icon&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/Syxx26cBjiI/AAAAAAAABPI/l5keAR-iqE0/s1600-h/6ClickOnConnectToDb.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416829640033537570" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 253px; CURSOR: hand; HEIGHT: 186px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/Syxx26cBjiI/AAAAAAAABPI/l5keAR-iqE0/s400/6ClickOnConnectToDb.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 8.In "Add Connection" dialog put the server name,database name and required credentials&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/Syxyq_cqb8I/AAAAAAAABPQ/NtwjbVzRo4k/s1600-h/7AddConnection.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416830534731591618" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 269px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/Syxyq_cqb8I/AAAAAAAABPQ/NtwjbVzRo4k/s400/7AddConnection.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 9.Drag the requird Stored proc in your Method Pane&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyxzV9jDJhI/AAAAAAAABPg/6lm693HkUsw/s1600-h/9DragSptoMethodPane.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416831272955880978" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 242px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyxzV9jDJhI/AAAAAAAABPg/6lm693HkUsw/s400/9DragSptoMethodPane.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 10.If the Method Pane is not visible,right click on the designer and click on "Show Methods Pane".&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyxzqMluozI/AAAAAAAABPo/sX8vnxpItv8/s1600-h/10ShowMethodPane.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416831620591035186" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 242px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyxzqMluozI/AAAAAAAABPo/sX8vnxpItv8/s400/10ShowMethodPane.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 11.Now go to your Default.aspx page and create few buttons ,event and a gridview&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;asp:GridView ID="grdData" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnInsert" runat="server" OnClick="btnInsert_Click" Text="Insert" /&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Update" /&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnSelect" runat="server" OnClick="btnSelect_Click" Text="Select" /&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" Text="Delete" /&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnSelectMulti" runat="server" OnClick="btnSelectMulti_Click" Text="SelectMultipleDatatable" /&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnSelectMultiWithOutputParam" runat="server" OnClick="btnSelectMultiWithOutputParam_Click"&lt;br /&gt;Text="SelectMultipleWithOutputParameter" /&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;Step 12.In the Default.aspx.cs call the required stored procedure for Insert ,update ,select and Delete&lt;br /&gt;MyDataContext db = new MyDataContext();&lt;br /&gt;&lt;br /&gt;protected void btnInsert_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;var q3 = db.spMyTableInsert("Indra", "Jadavpur");&lt;br /&gt;}&lt;br /&gt;protected void btnUpdate_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;var update = db.spMyTableUpdate(2,"Indra", "Jadavpur");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;protected void btnSelect_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;var Select2 = from o in db.spMyTableSelect()&lt;br /&gt;where o.MyID &lt;= 12 select new { o.MyID, o.MyName, o.MyAddress }; &lt;br /&gt;grdData.DataSource = Select2; &lt;br /&gt;grdData.DataBind(); &lt;br /&gt;} protected void btnDelete_Click(object sender, EventArgs e) &lt;br /&gt;{ &lt;br /&gt;var delete = db.spMyTableDelete(3);&lt;br /&gt;} &lt;br /&gt;Step 13.Now if you like to call a stored proc like dbo.spMyTableSelectMultiWithOutputParam which has a output param write teh follwoing code in your btnSelectMultiWithOutputParam click event &lt;br /&gt;protected void btnSelectMultiWithOutputParam_Click(object sender, EventArgs e) &lt;br /&gt;{ &lt;br /&gt;string strCustName = ""; &lt;br /&gt;var q2 = db.spMyTableSelectMultiWithOutputParam(1, ref strCustName); &lt;br /&gt;Response.Write(strCustName.ToString()); &lt;br /&gt;grdData.DataSource = q2; grdData.DataBind();&lt;br /&gt;} &lt;br /&gt;The spMyTableSelectMultiWithOutputParam is like this &lt;br /&gt;ALTER PROCEDURE dbo.spMyTableSelectMultiWithOutputParam &lt;br /&gt;( &lt;br /&gt;@MyID int, @MyName varchar(50) output &lt;br /&gt;) AS &lt;br /&gt;BEGIN &lt;br /&gt;SET NOCOUNT ON; &lt;br /&gt;SELECT MyID,MyName,MyAddress from dbo.MyTable &lt;br /&gt;SELECT @MyName=(SELECT MyName from dbo.MyTable where MyID=@MyID) &lt;br /&gt;END Step &lt;br /&gt;14.Now if you want to call a storedproc which is returning multiple select statement like spMyTableSelectMulti,do the following steps--- &lt;br /&gt;The stored proc is like this &lt;br /&gt;ALTER PROCEDURE dbo.spMyTableSelectMulti &lt;br /&gt;AS &lt;br /&gt;BEGIN &lt;br /&gt;SET NOCOUNT ON; &lt;br /&gt;SELECT MyID,MyName,MyAddress from dbo.MyTable where MyID=2 &lt;br /&gt;SELECT MyID,MyName,MyAddress from dbo.MyTable where MyID=1 &lt;br /&gt;END &lt;br /&gt;Open the MyDataClassesDesigner.cs and comment the class spMyTableSelectMultiResult . &lt;br /&gt;&lt;br /&gt;Then create a new class file clsMultiRecords.cs in App_code and create two partial class spMyTableSelectMultiResult and spMyTableSelectMultiResult2 First Class return the first SQL query and the second one return the second sql query. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.Linq;&lt;br /&gt;using System.Data.Linq.Mapping;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Linq.Expressions;&lt;br /&gt;using System.Reflection;&lt;br /&gt;&lt;br /&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;/// Summary description for clsMultiRecords&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;public class clsMultiRecords&lt;br /&gt;{&lt;br /&gt; public clsMultiRecords()&lt;br /&gt; {&lt;br /&gt;  //&lt;br /&gt;  // TODO: Add constructor logic here&lt;br /&gt;  //&lt;br /&gt; }&lt;br /&gt;    //[Function(Name = "dbo.spMyTableSelectMulti"), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult)), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult2))]&lt;br /&gt;    //public IMultipleResults spMyTableSelectMulti()&lt;br /&gt;    //{&lt;br /&gt;    //    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;    //    return ((IMultipleResults)(result.ReturnValue));&lt;br /&gt;    //}&lt;br /&gt;&lt;br /&gt;    public partial class spMyTableSelectMultiResult&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        private int _MyID;&lt;br /&gt;&lt;br /&gt;        private string _MyName;&lt;br /&gt;&lt;br /&gt;        private string _MyAddress;&lt;br /&gt;&lt;br /&gt;        public spMyTableSelectMultiResult()&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyID", DbType = "Int NOT NULL")]&lt;br /&gt;        public int MyID&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyID;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyID != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyID = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyName", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyName&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyName;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyName != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyName = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyAddress", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyAddress&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyAddress;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyAddress != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyAddress = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    public partial class spMyTableSelectMultiResult2&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        private int _MyID;&lt;br /&gt;&lt;br /&gt;        private string _MyName;&lt;br /&gt;&lt;br /&gt;        private string _MyAddress;&lt;br /&gt;&lt;br /&gt;        public spMyTableSelectMultiResult2()&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyID", DbType = "Int NOT NULL")]&lt;br /&gt;        public int MyID&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyID;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyID != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyID = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyName", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyName&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyName;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyName != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyName = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyAddress", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyAddress&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyAddress;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyAddress != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyAddress = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Again open the DataClassesDesigner.cs and delete the follwoing portion &lt;br /&gt;&lt;br /&gt;[Function(Name = "dbo.spMyTableSelectMulti")]&lt;br /&gt;    public ISingleResult&lt;spMyTableSelectMultiResult&gt; spMyTableSelectMulti()&lt;br /&gt;    {&lt;br /&gt;        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;        return ((ISingleResult&lt;spMyTableSelectMultiResult&gt;)(result.ReturnValue));&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;and write the following code in place of that &lt;br /&gt;&lt;br /&gt;[Function(Name = "dbo.spMyTableSelectMulti"), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult)), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult2))]&lt;br /&gt;    public IMultipleResults spMyTableSelectMulti()&lt;br /&gt;    {&lt;br /&gt;        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;        return ((IMultipleResults)(result.ReturnValue));&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;This method will return the IMultipleResults instead of ISingleResult. Mind it,if you open the dbml(MyDataClasses.dbml not MyDataClasses.designer.cs) file and save/modify it, this above portion will be overridden by ISingleResult. Now go to the click event of btnSelectMulti and write the following code &lt;br /&gt;protected void btnSelectMulti_Click(object sender, EventArgs e) &lt;br /&gt;{ &lt;br /&gt;IMultipleResults results = new MyDataContext().spMyTableSelectMulti(); List&lt;clsmultirecords.spmytableselectmultiresult&gt; result1 = results.GetResult&lt;clsmultirecords.spmytableselectmultiresult&gt;().ToList();&lt;br /&gt;&lt;br /&gt;List&lt;clsmultirecords.spmytableselectmultiresult2&gt; result2 = results.GetResult&lt;clsmultirecords.spmytableselectmultiresult2&gt;().ToList();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;grdData.DataSource = result2;&lt;br /&gt;grdData.DataBind();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Step 15.Now run your application ,you can now see the following output,click on different button to obeserve the operation&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/Syx22-6GJ_I/AAAAAAAABPw/lZzEl_eAKxo/s1600-h/19Output.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5416835138791548914" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 242px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/Syx22-6GJ_I/AAAAAAAABPw/lZzEl_eAKxo/s400/19Output.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am attaching the complete code for Default.aspx.cs ,MyDataContext class and clsMultiRecords.cs&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Default.aspx.cs&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Data.Linq;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page &lt;br /&gt;{&lt;br /&gt;    MyDataContext db = new MyDataContext();&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        &lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;    protected void btnInsert_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        var q3 = db.spMyTableInsert("Indra", "Jadavpur");&lt;br /&gt;    }&lt;br /&gt;    protected void btnUpdate_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        var update = db.spMyTableUpdate(2,"Indra", "Jadavpur");&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    protected void btnSelect_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;        var Select2 = from o in db.spMyTableSelect()&lt;br /&gt;                      where o.MyID &amp;lt;= 12&lt;br /&gt;                      select new { o.MyID, o.MyName, o.MyAddress };&lt;br /&gt;&lt;br /&gt;        grdData.DataSource = Select2;&lt;br /&gt;        grdData.DataBind();&lt;br /&gt;    }&lt;br /&gt;    protected void btnDelete_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        var delete = db.spMyTableDelete(3);&lt;br /&gt;    }&lt;br /&gt;    protected void btnSelectMulti_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        IMultipleResults results = new MyDataContext().spMyTableSelectMulti();&lt;br /&gt;        List&amp;lt;clsMultiRecords.spMyTableSelectMultiResult&amp;gt; result1 = results.GetResult&amp;lt;clsMultiRecords.spMyTableSelectMultiResult&amp;gt;().ToList();&lt;br /&gt;&lt;br /&gt;        List&amp;lt;clsMultiRecords.spMyTableSelectMultiResult2&amp;gt; result2 = results.GetResult&amp;lt;clsMultiRecords.spMyTableSelectMultiResult2&amp;gt;().ToList();&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;        grdData.DataSource = result2;&lt;br /&gt;        grdData.DataBind();&lt;br /&gt;    }&lt;br /&gt;    protected void btnSelectMultiWithOutputParam_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        string strCustName = "";&lt;br /&gt;        var q2 = db.spMyTableSelectMultiWithOutputParam(1, ref strCustName);&lt;br /&gt;        Response.Write(strCustName.ToString());&lt;br /&gt;        grdData.DataSource = q2;&lt;br /&gt;        grdData.DataBind();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;MyDataContext class&lt;/strong&gt;&lt;br /&gt;#pragma warning disable 1591&lt;br /&gt;//------------------------------------------------------------------------------&lt;br /&gt;// &amp;lt;auto-generated&amp;gt;&lt;br /&gt;//     This code was generated by a tool.&lt;br /&gt;//     Runtime Version:2.0.50727.3053&lt;br /&gt;//&lt;br /&gt;//     Changes to this file may cause incorrect behavior and will be lost if&lt;br /&gt;//     the code is regenerated.&lt;br /&gt;// &amp;lt;/auto-generated&amp;gt;&lt;br /&gt;//------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.Linq;&lt;br /&gt;using System.Data.Linq.Mapping;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Linq.Expressions;&lt;br /&gt;using System.Reflection;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[System.Data.Linq.Mapping.DatabaseAttribute(Name="Northwind")]&lt;br /&gt;public partial class MyDataContext : System.Data.Linq.DataContext&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();&lt;br /&gt; &lt;br /&gt;  #region Extensibility Method Definitions&lt;br /&gt;  partial void OnCreated();&lt;br /&gt;  #endregion&lt;br /&gt; &lt;br /&gt; public MyDataContext() : &lt;br /&gt;   base(global::System.Configuration.ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString, mappingSource)&lt;br /&gt; {&lt;br /&gt;  OnCreated();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public MyDataContext(string connection) : &lt;br /&gt;   base(connection, mappingSource)&lt;br /&gt; {&lt;br /&gt;  OnCreated();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public MyDataContext(System.Data.IDbConnection connection) : &lt;br /&gt;   base(connection, mappingSource)&lt;br /&gt; {&lt;br /&gt;  OnCreated();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public MyDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : &lt;br /&gt;   base(connection, mappingSource)&lt;br /&gt; {&lt;br /&gt;  OnCreated();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public MyDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : &lt;br /&gt;   base(connection, mappingSource)&lt;br /&gt; {&lt;br /&gt;  OnCreated();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Function(Name="dbo.spMyTableInsert")]&lt;br /&gt; public int spMyTableInsert([Parameter(Name="MyName", DbType="VarChar(50)")] string myName, [Parameter(Name="MyAddress", DbType="VarChar(50)")] string myAddress)&lt;br /&gt; {&lt;br /&gt;  IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), myName, myAddress);&lt;br /&gt;  return ((int)(result.ReturnValue));&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Function(Name="dbo.spMyTableUpdate")]&lt;br /&gt; public int spMyTableUpdate([Parameter(Name="MyID", DbType="Int")] System.Nullable&amp;lt;int&amp;gt; myID, [Parameter(Name="MyName", DbType="VarChar(50)")] string myName, [Parameter(Name="MyAddress", DbType="VarChar(50)")] string myAddress)&lt;br /&gt; {&lt;br /&gt;  IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), myID, myName, myAddress);&lt;br /&gt;  return ((int)(result.ReturnValue));&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Function(Name="dbo.spMyTableSelect")]&lt;br /&gt; public ISingleResult&amp;lt;spMyTableSelectResult&amp;gt; spMyTableSelect()&lt;br /&gt; {&lt;br /&gt;  IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;  return ((ISingleResult&amp;lt;spMyTableSelectResult&amp;gt;)(result.ReturnValue));&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Function(Name="dbo.spMyTableDelete")]&lt;br /&gt; public int spMyTableDelete([Parameter(Name="MyID", DbType="Int")] System.Nullable&amp;lt;int&amp;gt; myID)&lt;br /&gt; {&lt;br /&gt;  IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), myID);&lt;br /&gt;  return ((int)(result.ReturnValue));&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;    //[Function(Name = "dbo.spMyTableSelectMulti")]&lt;br /&gt;    //public ISingleResult&amp;lt;spMyTableSelectMultiResult&amp;gt; spMyTableSelectMulti()&lt;br /&gt;    //{&lt;br /&gt;    //    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;    //    return ((ISingleResult&amp;lt;spMyTableSelectMultiResult&amp;gt;)(result.ReturnValue));&lt;br /&gt;    //}&lt;br /&gt;    [Function(Name = "dbo.spMyTableSelectMulti"), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult)), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult2))]&lt;br /&gt;    public IMultipleResults spMyTableSelectMulti()&lt;br /&gt;    {&lt;br /&gt;        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;        return ((IMultipleResults)(result.ReturnValue));&lt;br /&gt;    }&lt;br /&gt;    //[Function(Name = "dbo.spMyTableSelectMulti")]&lt;br /&gt;    //public IMultipleResults spMyTableSelectMulti()&lt;br /&gt;    //{&lt;br /&gt;    //    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;    //    return (IMultipleResults)(result.ReturnValue);&lt;br /&gt;    //}&lt;br /&gt; &lt;br /&gt; [Function(Name="dbo.spMyTableSelectMultiWithOutputParam")]&lt;br /&gt; public ISingleResult&amp;lt;spMyTableSelectMultiWithOutputParamResult&amp;gt; spMyTableSelectMultiWithOutputParam([Parameter(Name="MyID", DbType="Int")] System.Nullable&amp;lt;int&amp;gt; myID, [Parameter(Name="MyName", DbType="VarChar(50)")] ref string myName)&lt;br /&gt; {&lt;br /&gt;  IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), myID, myName);&lt;br /&gt;  myName = ((string)(result.GetParameterValue(1)));&lt;br /&gt;  return ((ISingleResult&amp;lt;spMyTableSelectMultiWithOutputParamResult&amp;gt;)(result.ReturnValue));&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public partial class spMyTableSelectResult&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; private int _MyID;&lt;br /&gt; &lt;br /&gt; private string _MyName;&lt;br /&gt; &lt;br /&gt; private string _MyAddress;&lt;br /&gt; &lt;br /&gt; public spMyTableSelectResult()&lt;br /&gt; {&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Column(Storage="_MyID", DbType="Int NOT NULL")]&lt;br /&gt; public int MyID&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   return this._MyID;&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   if ((this._MyID != value))&lt;br /&gt;   {&lt;br /&gt;    this._MyID = value;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Column(Storage="_MyName", DbType="VarChar(50)")]&lt;br /&gt; public string MyName&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   return this._MyName;&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   if ((this._MyName != value))&lt;br /&gt;   {&lt;br /&gt;    this._MyName = value;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Column(Storage="_MyAddress", DbType="VarChar(50)")]&lt;br /&gt; public string MyAddress&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   return this._MyAddress;&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   if ((this._MyAddress != value))&lt;br /&gt;   {&lt;br /&gt;    this._MyAddress = value;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//public partial class spMyTableSelectMultiResult&lt;br /&gt;//{&lt;br /&gt; &lt;br /&gt;//    private int _MyID;&lt;br /&gt; &lt;br /&gt;//    private string _MyName;&lt;br /&gt; &lt;br /&gt;//    private string _MyAddress;&lt;br /&gt; &lt;br /&gt;//    public spMyTableSelectMultiResult()&lt;br /&gt;//    {&lt;br /&gt;//    }&lt;br /&gt; &lt;br /&gt;//    [Column(Storage="_MyID", DbType="Int NOT NULL")]&lt;br /&gt;//    public int MyID&lt;br /&gt;//    {&lt;br /&gt;//        get&lt;br /&gt;//        {&lt;br /&gt;//            return this._MyID;&lt;br /&gt;//        }&lt;br /&gt;//        set&lt;br /&gt;//        {&lt;br /&gt;//            if ((this._MyID != value))&lt;br /&gt;//            {&lt;br /&gt;//                this._MyID = value;&lt;br /&gt;//            }&lt;br /&gt;//        }&lt;br /&gt;//    }&lt;br /&gt; &lt;br /&gt;//    [Column(Storage="_MyName", DbType="VarChar(50)")]&lt;br /&gt;//    public string MyName&lt;br /&gt;//    {&lt;br /&gt;//        get&lt;br /&gt;//        {&lt;br /&gt;//            return this._MyName;&lt;br /&gt;//        }&lt;br /&gt;//        set&lt;br /&gt;//        {&lt;br /&gt;//            if ((this._MyName != value))&lt;br /&gt;//            {&lt;br /&gt;//                this._MyName = value;&lt;br /&gt;//            }&lt;br /&gt;//        }&lt;br /&gt;//    }&lt;br /&gt; &lt;br /&gt;//    [Column(Storage="_MyAddress", DbType="VarChar(50)")]&lt;br /&gt;//    public string MyAddress&lt;br /&gt;//    {&lt;br /&gt;//        get&lt;br /&gt;//        {&lt;br /&gt;//            return this._MyAddress;&lt;br /&gt;//        }&lt;br /&gt;//        set&lt;br /&gt;//        {&lt;br /&gt;//            if ((this._MyAddress != value))&lt;br /&gt;//            {&lt;br /&gt;//                this._MyAddress = value;&lt;br /&gt;//            }&lt;br /&gt;//        }&lt;br /&gt;//    }&lt;br /&gt;//}&lt;br /&gt;&lt;br /&gt;public partial class spMyTableSelectMultiWithOutputParamResult&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; private int _MyID;&lt;br /&gt; &lt;br /&gt; private string _MyName;&lt;br /&gt; &lt;br /&gt; private string _MyAddress;&lt;br /&gt; &lt;br /&gt; public spMyTableSelectMultiWithOutputParamResult()&lt;br /&gt; {&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Column(Storage="_MyID", DbType="Int NOT NULL")]&lt;br /&gt; public int MyID&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   return this._MyID;&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   if ((this._MyID != value))&lt;br /&gt;   {&lt;br /&gt;    this._MyID = value;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Column(Storage="_MyName", DbType="VarChar(50)")]&lt;br /&gt; public string MyName&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   return this._MyName;&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   if ((this._MyName != value))&lt;br /&gt;   {&lt;br /&gt;    this._MyName = value;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; [Column(Storage="_MyAddress", DbType="VarChar(50)")]&lt;br /&gt; public string MyAddress&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   return this._MyAddress;&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   if ((this._MyAddress != value))&lt;br /&gt;   {&lt;br /&gt;    this._MyAddress = value;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;#pragma warning restore 1591&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;clsMultiRecords.cs&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.Linq;&lt;br /&gt;using System.Data.Linq.Mapping;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Linq.Expressions;&lt;br /&gt;using System.Reflection;&lt;br /&gt;&lt;br /&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;/// Summary description for clsMultiRecords&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;public class clsMultiRecords&lt;br /&gt;{&lt;br /&gt; public clsMultiRecords()&lt;br /&gt; {&lt;br /&gt;  //&lt;br /&gt;  // TODO: Add constructor logic here&lt;br /&gt;  //&lt;br /&gt; }&lt;br /&gt;    //[Function(Name = "dbo.spMyTableSelectMulti"), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult)), ResultType(typeof(clsMultiRecords.spMyTableSelectMultiResult2))]&lt;br /&gt;    //public IMultipleResults spMyTableSelectMulti()&lt;br /&gt;    //{&lt;br /&gt;    //    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));&lt;br /&gt;    //    return ((IMultipleResults)(result.ReturnValue));&lt;br /&gt;    //}&lt;br /&gt;&lt;br /&gt;    public partial class spMyTableSelectMultiResult&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        private int _MyID;&lt;br /&gt;&lt;br /&gt;        private string _MyName;&lt;br /&gt;&lt;br /&gt;        private string _MyAddress;&lt;br /&gt;&lt;br /&gt;        public spMyTableSelectMultiResult()&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyID", DbType = "Int NOT NULL")]&lt;br /&gt;        public int MyID&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyID;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyID != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyID = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyName", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyName&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyName;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyName != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyName = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyAddress", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyAddress&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyAddress;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyAddress != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyAddress = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    public partial class spMyTableSelectMultiResult2&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        private int _MyID;&lt;br /&gt;&lt;br /&gt;        private string _MyName;&lt;br /&gt;&lt;br /&gt;        private string _MyAddress;&lt;br /&gt;&lt;br /&gt;        public spMyTableSelectMultiResult2()&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyID", DbType = "Int NOT NULL")]&lt;br /&gt;        public int MyID&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyID;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyID != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyID = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyName", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyName&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyName;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyName != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyName = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [Column(Storage = "_MyAddress", DbType = "VarChar(50)")]&lt;br /&gt;        public string MyAddress&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return this._MyAddress;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                if ((this._MyAddress != value))&lt;br /&gt;                {&lt;br /&gt;                    this._MyAddress = value;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-5205150653929070612?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/5205150653929070612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=5205150653929070612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5205150653929070612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5205150653929070612'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/introduction-to-linq-to-stored.html' title='Introduction to Linq To Stored Procedure'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1EZkGmmHBwc/SyxtsqLe50I/AAAAAAAABOg/PiYUeKzfLyc/s72-c/1createtable.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-1807405095671235621</id><published>2009-12-14T23:49:00.006+05:30</published><updated>2009-12-15T09:39:03.361+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cost Estimation'/><title type='text'>Estimation using Fuction Point Analysis-Phase Considaration and cost calculation(Part 6)</title><content type='html'>We generally distribute the phase of a project in the following manner after getting the total Man Days&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SyaDEbBp-kI/AAAAAAAABOI/Rg4jRJVdOjY/s1600-h/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 309px;" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SyaDEbBp-kI/AAAAAAAABOI/Rg4jRJVdOjY/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5415159713957018178" /&gt;&lt;/a&gt;&lt;br /&gt;And the we can asign resources in the following manner ,it can vary according to your company strength or company policy.this is just a sample &lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SyaEObvU0FI/AAAAAAAABOQ/uZn3RzsF0nQ/s1600-h/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 174px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SyaEObvU0FI/AAAAAAAABOQ/uZn3RzsF0nQ/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5415160985458888786" /&gt;&lt;/a&gt;&lt;br /&gt;Now you can calculate your total cost for your project depending on the salary of your team member and other cost.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SyaE4sSl76I/AAAAAAAABOY/AcVqPrKnJH4/s1600-h/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 277px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SyaE4sSl76I/AAAAAAAABOY/AcVqPrKnJH4/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5415161711456284578" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-1807405095671235621?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/1807405095671235621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=1807405095671235621' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1807405095671235621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1807405095671235621'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/estimation-using-fuction-point-analysis_4193.html' title='Estimation using Fuction Point Analysis-Phase Considaration and cost calculation(Part 6)'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1EZkGmmHBwc/SyaDEbBp-kI/AAAAAAAABOI/Rg4jRJVdOjY/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-1698799138017271855</id><published>2009-12-14T23:44:00.002+05:30</published><updated>2009-12-15T09:39:03.362+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cost Estimation'/><title type='text'>Estimation using Fuction Point Analysis-Productivity Factor(Part 5)</title><content type='html'>To convert the adjusted FP to man hour or man hour we need to calculate the Productivity factor that indicates how many FP your company can achive in a day.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyaBfWorP1I/AAAAAAAABOA/_OCHAP5eyN0/s1600-h/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 214px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SyaBfWorP1I/AAAAAAAABOA/_OCHAP5eyN0/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5415157977611714386" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-1698799138017271855?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/1698799138017271855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=1698799138017271855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1698799138017271855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1698799138017271855'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/estimation-using-fuction-point-analysis_14.html' title='Estimation using Fuction Point Analysis-Productivity Factor(Part 5)'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1EZkGmmHBwc/SyaBfWorP1I/AAAAAAAABOA/_OCHAP5eyN0/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-3562703812921771078</id><published>2009-12-14T22:56:00.011+05:30</published><updated>2009-12-15T09:39:03.363+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cost Estimation'/><title type='text'>Estimation using Fuction Point Analysis-GSC(Part 4)</title><content type='html'>&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;Now that we have covered five Fundamental of FPA-EI,EO,EQ,EIF,ILF.&lt;br /&gt;Lets move ahead General System Characteristics(GSC) and adjusted function point.On the top of those five things we will apply GSC.&lt;br /&gt;I am providing a GSC template where you have to put the value first in place of "1" in this case and calculate GSC.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;GSC factor&lt;/th&gt;&lt;th&gt;Definitions&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Data Communications&lt;/td&gt;&lt;td&gt;How many communication facilities are there to aid in the transfer or exchange of information with the application or system?&lt;br /&gt;Data Communications describes the degree to which the application communicates directly with the processor.&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. Application is pure batch processing or a stand-alone PC.&lt;br /&gt;1. Application is batch but has remote data entry or remote printing.&lt;br /&gt;2. Application is batch but has remote data entry and remote printing.&lt;br /&gt;3. Application includes online data collection or TP (teleprocessing) front&lt;br /&gt;end to a batch process or query system.&lt;br /&gt;4. Application is more than a front-end, but supports only one type of TP&lt;br /&gt;communications protocol.&lt;br /&gt;5. Application is more than a front-end, and supports more than one type&lt;br /&gt;of TP communications protocol.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Distributed Data Processing&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;How are distributed data and processing functions handled?&lt;br /&gt;Distributed Data Processing describes the degree to which the application&lt;br /&gt;transfers data among components of the application.&lt;br /&gt;Score As Descriptions To Determine Degree of Influence&lt;br /&gt;0. Application does not aid the transfer of data or processing functions&lt;br /&gt;between components of the system.&lt;br /&gt;1. Application prepares data for user processing on another component of&lt;br /&gt;the system such as PC spreadsheets and PC DBMS.&lt;br /&gt;2. Data is prepared for transfer, then is transferred and processed on&lt;br /&gt;another component of the system (not for end-user processing).&lt;br /&gt;3. Distributed processing and data transfer are online and in one direction only.&lt;br /&gt;4. Distributed processing and data transfer are online and in both&lt;br /&gt;directions.&lt;br /&gt;5. Processing functions are dynamically performed on the most appropriate&lt;br /&gt;component of the system.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Performance&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;Did the user require response time or throughput?&lt;br /&gt;Performance describes the degree to which response time and throughput&lt;br /&gt;performance considerations influenced the application development.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. No special performance requirements were stated by the user.&lt;br /&gt;1. Performance and design requirements were stated and reviewed but no special actions&lt;br /&gt;were required.&lt;br /&gt;2. Response time or throughput is critical during peak hours. No special design for&lt;br /&gt;CPU utilization was required. Processing deadline is for the next business day.&lt;br /&gt;3. Response time or throughput is critical during all business hours. No special design for&lt;br /&gt;CPU utilization was required. Processing deadline requirements with interfacing systems&lt;br /&gt;are constraining.&lt;br /&gt;4. In addition, stated user performance requirements are stringent enough to&lt;br /&gt;require performance analysis tasks in the design phase.&lt;br /&gt;5. In addition, performance analysis tools were used in the design, development,&lt;br /&gt;and/or implementation phases to meet the stated user performance requirements.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Heavily Used Configuration&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;How heavily used is the current hardware platform where the application will be executed?&lt;br /&gt;Heavily Used Configuration describes the degree to which computer resource&lt;br /&gt;restrictions influenced the development of the application.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. No explicit or implicit operational restrictions are included.&lt;br /&gt;1. Operational restrictions do exist, but are less restrictive than a typical application.&lt;br /&gt;No special effort is needed to meet the restrictions.&lt;br /&gt;2. Some security or timing considerations are included.&lt;br /&gt;3. Specific processor requirements for a specific piece of the application are included.&lt;br /&gt;4. Stated operation restrictions require special constraints on the application in the&lt;br /&gt;central processor or a dedicated processor.&lt;br /&gt;5. In addition, there are special constraints on the application in the&lt;br /&gt;distributed components of the system.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Transaction Rate&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;How frequently are transactions executed; daily, weekly, monthly, etc.?&lt;br /&gt;Transaction Rate describes the degree to which the rate of business&lt;br /&gt;transactions influenced the development of the application.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. No peak transaction period is anticipated.&lt;br /&gt;1. Peak transaction period (e.g., monthly, quarterly, seasonally, annually) is anticipated.&lt;br /&gt;2. Weekly peak transaction period is anticipated.&lt;br /&gt;3. Daily peak transaction period is anticipated.&lt;br /&gt;4. High transaction rate(s) stated by the user in the application requirements or service&lt;br /&gt;level agreements are high enough to require performance analysis tasks in the&lt;br /&gt;design phase.&lt;br /&gt;5. High transaction rate(s) stated by the user in the application requirements or service&lt;br /&gt;level agreements are high enough to require performance analysis tasks and, in&lt;br /&gt;addition, require the use of performance analysis tools in the design, development,&lt;br /&gt;and/or installation phases.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;On-line Data Entry&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;What percentage of the information is entered On-Line?&lt;br /&gt;Online Update describes the degree to which internal logical files are updated&lt;br /&gt;online.&lt;br /&gt;&lt;br /&gt;Online Data Entry describes the degree to which data is entered through&lt;br /&gt;interactive transactions.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. All transactions are processed in batch mode.&lt;br /&gt;1. 1% to 7% of transactions are interactive data entry.&lt;br /&gt;2. 8% to 15% of transactions are interactive data entry.&lt;br /&gt;3. 16% to 23% of transactions are interactive data entry.&lt;br /&gt;4. 24% to 30% of transactions are interactive data entry.&lt;br /&gt;5. More than 30% of transactions are interactive data entry.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;End-user Efficiency &lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;Was the application designed for end-user efficiency?&lt;br /&gt;End-User Efficiency describes the degree of consideration for human factors&lt;br /&gt;and ease of use for the user of the application measured.&lt;br /&gt;&lt;br /&gt;The online functions provided emphasize a design for end-user efficiency. The&lt;br /&gt;design includes:&lt;br /&gt;· Navigational aids (for example, function keys, jumps, dynamically generated menus)&lt;br /&gt;· Menus&lt;br /&gt;· Online help and documents&lt;br /&gt;· Automated cursor movement&lt;br /&gt;· Scrolling&lt;br /&gt;· Remote printing via online transactions&lt;br /&gt;· Pre-assigned function keys&lt;br /&gt;· Batch jobs submitted from online transactions&lt;br /&gt;· Cursor selection of screen data&lt;br /&gt;· Heavy use of reverse video, highlighting, colors underlining, and other indicators&lt;br /&gt;· Hard copy user documentation of online transactions&lt;br /&gt;· Mouse interface&lt;br /&gt;· Pop-up windows&lt;br /&gt;· As few screens as possible to accomplish a business function&lt;br /&gt;· Bilingual support (supports two languages; count as four items)&lt;br /&gt;· Multilingual support (supports more than two languages; count as six items)&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence&lt;br /&gt;0. None of the above.&lt;br /&gt;1. One to three of the above.&lt;br /&gt;2. Four to five of the above.&lt;br /&gt;3. Six or more of the above, but there are no specific user requirements related to efficiency.&lt;br /&gt;4. Six or more of the above, and stated requirements for end-user efficiency are strong&lt;br /&gt;enough to require design tasks for human factors to be included (for example, minimize&lt;br /&gt;key strokes, maximize defaults, use of templates).&lt;br /&gt;5. Six or more of the above, and stated requirements for end-user efficiency are strong&lt;br /&gt;enough to require use of special tools and processes to demonstrate that the objectives&lt;br /&gt;have been achieved.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;On-line Updates&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;How many ILF’s are updated by On-Line transaction?&lt;br /&gt;Online Update describes the degree to which internal logical files are updated&lt;br /&gt;online.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. None.&lt;br /&gt;1. Online update of one to three control files is included. Volume of updating is low&lt;br /&gt;and recovery is easy.&lt;br /&gt;2. Online update of four or more control files is included. Volume of updating is low&lt;br /&gt;and recovery easy.&lt;br /&gt;3. Online update of major internal logical files is included.&lt;br /&gt;4. In addition, protection against data lost is essential and has been specially designed&lt;br /&gt;and programmed in the system.&lt;br /&gt;5. In addition, high volumes bring cost considerations into the recovery process.&lt;br /&gt;Highly automated recovery procedures with minimum operator intervention are included.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Complex Processing&lt;/td&gt;&lt;td&gt;Does the application have extensive logical or mathematical processing?&lt;br /&gt;Complex processing describes the degree to which processing logic influenced&lt;br /&gt;the development of the application.&lt;br /&gt;&lt;br /&gt;The following components are present:&lt;br /&gt;· Sensitive control (for example, special audit processing) and/or application&lt;br /&gt;specific security processing&lt;br /&gt;· Extensive logical processing&lt;br /&gt;· Extensive mathematical processing&lt;br /&gt;· Much exception processing resulting in incomplete transactions that must be&lt;br /&gt;processed again (for example, incomplete ATM transactions caused by TP&lt;br /&gt;interruption, missing data values, or failed validations)&lt;br /&gt;· Complex processing to handle multiple input/output possibilities (for example,&lt;br /&gt;multimedia, or device independence)&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. None of the above.&lt;br /&gt;1. Any one of the above.&lt;br /&gt;2. Any two of the above.&lt;br /&gt;3. Any three of the above.&lt;br /&gt;4. Any four of the above.&lt;br /&gt;5. All five of the above.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Reusability&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;Was the application developed to meet one or many user’s needs?&lt;br /&gt;Reusability describes the degree to which the application and the code in the application&lt;br /&gt;have been specifically designed, developed, and supported to be usable in other applications.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. No reusable code.&lt;br /&gt;1. Reusable code is used within the application.&lt;br /&gt;2. Less than 10% of the application considered more than one user's needs.&lt;br /&gt;3. Ten percent (10%) or more of the application considered more than one user's needs.&lt;br /&gt;4. The application was specifically packaged and/or documented to ease re-use, and&lt;br /&gt;the application is customized by the user at source code level.&lt;br /&gt;5. The application was specifically packaged and/or documented to ease re-use, and&lt;br /&gt;the application is customized for use by means of user parameter maintenance.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Installation Ease&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;How difficult is conversion and installation?&lt;br /&gt;Installation Ease describes the degree to which conversion from previous environments influenced the development of the application.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. No special considerations were stated by the user, and no special setup is required&lt;br /&gt;for installation.&lt;br /&gt;1. No special considerations were stated by the user but special setup is required for&lt;br /&gt;installation.&lt;br /&gt;2. Conversion and installation requirements were stated by the user, and conversion&lt;br /&gt;and installation guides were provided and tested. The impact of conversion on the project&lt;br /&gt;is not considered to be important.&lt;br /&gt;3. Conversion and installation requirements were stated by the user, and conversion&lt;br /&gt;and installation guides were provided and tested. The impact of conversion on the project&lt;br /&gt;is considered to be important.&lt;br /&gt;4. In addition to 2 above, automated conversion and installation tools were provided and&lt;br /&gt;tested.&lt;br /&gt;5. In addition to 3 above, automated conversion and installation tools were provided and&lt;br /&gt;tested.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Operational Ease&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;How effective and/or automated are start-up, back up, and recovery procedures?&lt;br /&gt;Operational Ease describes the degree to which the application attends to&lt;br /&gt;operational aspects, such as start-up, back-up, and recovery processes.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. No special operational considerations other than the normal back-up procedures&lt;br /&gt;were stated by the user.&lt;br /&gt;1 - 4 One, some, or all of the following items apply to the application. Select&lt;br /&gt;all that apply. Each item has a point value of one, except as noted otherwise.&lt;br /&gt;· Effective start-up, back-up, and recovery processes were provided,&lt;br /&gt;but operator intervention is required.&lt;br /&gt;· Effective start-up, back-up, and recovery processes were provided,&lt;br /&gt;but no operator intervention is required (count as two items).&lt;br /&gt;· The application minimizes the need for tape mounts.&lt;br /&gt;· The application minimizes the need for paper handling.&lt;br /&gt;5. The application is designed for unattended operation. Unattended operation means&lt;br /&gt;no operator intervention is required to operate the system other than to start up or&lt;br /&gt;shut down the application. Automatic error recovery is a feature of the application.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Multiple Sites&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;Was the application specifically designed, developed, and supported to be installed at multiple sites for multiple organizations?&lt;br /&gt;Multiple Sites describes the degree to which the application has been&lt;br /&gt;developed for multiple locations and user organizations.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. User requirements do not require considering the needs of more than one user/installation site.&lt;br /&gt;1. Needs of multiple sites were considered in the design, and the application is designed to&lt;br /&gt;operate only under identical hardware and software environments.&lt;br /&gt;2. Needs of multiple sites were considered in the design, and the application is designed to&lt;br /&gt;operate only under similar hardware and/or software environments.&lt;br /&gt;3. Needs of multiple sites were considered in the design, and the application is designed to&lt;br /&gt;operate under different hardware and/or software environments.&lt;br /&gt;4. Documentation and support plan are provided and tested to support the application at&lt;br /&gt;multiple sites and the application is as described by 1 or 2.&lt;br /&gt;5. Documentation and support plan are provided and tested to support the application at&lt;br /&gt;multiple sites and the application is as described by 3.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Facilitate Changes&lt;/td&gt;&lt;td&gt;&lt;hr /&gt;&lt;br /&gt;Was the application specifically designed, developed, and supported to facilitate change?&lt;br /&gt;Facilitate Change describes the degree to which the application has been developed for easy modification of processing logic or data structure.&lt;br /&gt;&lt;br /&gt;The following characteristics can apply for the application:&lt;br /&gt;· Flexible query and report facility is provided that can handle simple requests;&lt;br /&gt;for example, and/or logic applied to only one internal logical file.&lt;br /&gt;· Flexible query and report facility is provided that can handle requests of average complexity,&lt;br /&gt;for example, and/or logic applied to more than one internal logical file.&lt;br /&gt;· Flexible query and report facility is provided that can handle complex requests,&lt;br /&gt;for example, and/or logic combinations on one or more internal logical files.&lt;br /&gt;· Business control data is kept in tables that are maintained by the user with online interactive processes, but&lt;br /&gt;changes take effect only on the next business day.&lt;br /&gt;· Business control data is kept in tables that are maintained by the user with online interactive processes, and&lt;br /&gt;the changes take effect immediately.&lt;br /&gt;&lt;br /&gt;Score As Descriptions To Determine Degree of Influence:&lt;br /&gt;0. None of the above.&lt;br /&gt;1. A total of one item from above.&lt;br /&gt;2. A total of two items from above.&lt;br /&gt;3. A total of three items from above.&lt;br /&gt;4. A total of four items from above.&lt;br /&gt;5. A total of five items from above.&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;Now using the GSC we can calculate VAF and then we can achive Adjusted FP&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SyZ_IqKpGkI/AAAAAAAABN4/mKU9ZfZvH1k/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5415155388694207042" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 98px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SyZ_IqKpGkI/AAAAAAAABN4/mKU9ZfZvH1k/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-3562703812921771078?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/3562703812921771078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=3562703812921771078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3562703812921771078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3562703812921771078'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/estimation-using-fuction-point-analysis.html' title='Estimation using Fuction Point Analysis-GSC(Part 4)'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1EZkGmmHBwc/SyZ_IqKpGkI/AAAAAAAABN4/mKU9ZfZvH1k/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2785127501022316460</id><published>2009-12-04T15:01:00.013+05:30</published><updated>2009-12-15T09:39:03.364+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cost Estimation'/><title type='text'>Estimation using Fuction Point Analysis-EIF,ILF(Part 3)</title><content type='html'>&lt;strong&gt;&lt;span style="color:#660000;"&gt;What is External Interface File(EIF):&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxjXih6cILI/AAAAAAAABM8/6Bbn5k0iavY/s1600-h/2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5411311940504658098" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 218px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxjXih6cILI/AAAAAAAABM8/6Bbn5k0iavY/s400/2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;EIF is a user-indentifiable logically related data which is utilized by the applicatin but maintained by some other application.They are not maintained by the application.&lt;br /&gt;For example,if you are using credit card information,or using some kind of payment gateway that are only referencing and application don't have the control directly,then this file ise a EIF.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Complexity Table of EIF:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;It depends on two things:&lt;br /&gt;&lt;span style="color:#000099;"&gt;-Record Element type(RET):&lt;/span&gt;They are logical sub groupings of DET from user view point.If there is no logical grouping of data then we consider it as one RET. In the following context there are several phone number for a customer,but they are logically grouping.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxjafvnHNwI/AAAAAAAABNE/Vdr6nCNkuaE/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5411315191176967938" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 235px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxjafvnHNwI/AAAAAAAABNE/Vdr6nCNkuaE/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;-Data Element Type(DET):&lt;/span&gt;Counting of DET doesn't change for EIF,EI,EO,EQ .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;EIF complexity table:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SxjaxyRlv-I/AAAAAAAABNM/fLOrVbbtSbc/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5411315501129646050" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 283px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SxjaxyRlv-I/AAAAAAAABNM/fLOrVbbtSbc/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#660000;"&gt;&lt;strong&gt;What is Internal Logical File(ILF):&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;An ILF is a user identifiable group of logically related data maintained by the application.&lt;br /&gt;Application have directly control on ILF.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Identify ILF's:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Stored internal to the application&lt;br /&gt;Maintained through a standarized process of application.&lt;br /&gt;User identified.&lt;br /&gt;Temp file are not count as ILF's.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sxjds7sKjiI/AAAAAAAABNU/QKgLyrZruY8/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5411318716292566562" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 378px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sxjds7sKjiI/AAAAAAAABNU/QKgLyrZruY8/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In the above context if your client thing that there is only one phone number for a customer but still you have maintained it in two tables for scale up your application,then you have to count 1 ILF ,but if a customer has multiple phone number and you require two table(master &amp;amp; details) then the ILF should be 2.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Complexity of ILF: &lt;/span&gt;&lt;/strong&gt;It depends on two things:&lt;br /&gt;-Record Element type(RET)&lt;br /&gt;-Data Element Type(DET)&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Complexity Table of ILF:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sxje0a0BvaI/AAAAAAAABNc/FwtDjGUs-cI/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5411319944417754530" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 303px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Sxje0a0BvaI/AAAAAAAABNc/FwtDjGUs-cI/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2785127501022316460?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2785127501022316460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2785127501022316460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2785127501022316460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2785127501022316460'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/estimation-using-fuction-point_04.html' title='Estimation using Fuction Point Analysis-EIF,ILF(Part 3)'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1EZkGmmHBwc/SxjXih6cILI/AAAAAAAABM8/6Bbn5k0iavY/s72-c/2.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-8394857903852196239</id><published>2009-12-03T16:10:00.023+05:30</published><updated>2009-12-15T09:39:03.365+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cost Estimation'/><title type='text'>Estimation using Fuction Point Analysis-EO,EQ(Part 2)</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SxjT3BOfoHI/AAAAAAAABMs/ZyZSuLNsC2I/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5411307894461145202" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 221px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SxjT3BOfoHI/AAAAAAAABMs/ZyZSuLNsC2I/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;What is External Output(EO)?&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;External Output(EO)-EO's are functions which manipulate data and present to the user.&lt;br /&gt;Manipulation means derived and calculated informaton.&lt;br /&gt;Some of real time EO examples are(becuse it need complex query along with the calculation) -&lt;br /&gt;-Balance sheet report&lt;br /&gt;-Customer monthly statement&lt;br /&gt;-Complex graphical charts like bar chart ,pie chart etc.&lt;br /&gt;If the same EO data is produced on two different media output should be counted as two EO's.In short if the same data is sent on a web page and also on a mobile will be counted as 2 EO's.&lt;br /&gt;Graphical output of data in Pie chart ,bar chart etc should be counted as EO's.&lt;br /&gt;If a report is generated by report generator it should be counted as EO.One&lt;strong&gt; &lt;span style="color:#990000;"&gt;EI&lt;/span&gt;&lt;/strong&gt; should be counted for each report command like search ,sort ,merge etc generated by report generator.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;What are not EO's?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;ADHOC reporting where the end user can fire SQL and generate report is not a EO.For example ,if you have made a simple query window where the end user can fire and get the data are not EO.&lt;br /&gt;Two report showing the different data with same processing logic (suppose one query output is ascending order and another is descending order)should be counted as on EO&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Complexity of EO:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Like EI,Complexity of EO is depends on &lt;span style="color:#000099;"&gt;File type reference(FTR)&lt;/span&gt; and &lt;span style="color:#000099;"&gt;Data element type(DET)&lt;/span&gt;&lt;br /&gt;DET are fields and attributes.&lt;br /&gt;DET should be unique and user recognizable.&lt;br /&gt;Count DET for each parameter in the report.Suppose you are generating reports based on the user input i.e Cust ID and Cust Name,then the DTE is 2&lt;br /&gt;Count DET for each numerical value in a graphical output.Suppose you are showing graph which showing percentage value or other numeric value,you need to count the DET.&lt;br /&gt;Count DET for summary and totalling fields.Suppose yoy are showing each month summery profit and total year profit ,then you should count 1 DET.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Complexity Table for EO:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Like EI,you can determine the complexity of EO from the Complexity table of EO as follows-&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxevjWdSzKI/AAAAAAAABMk/M932n8y9iV4/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5410986499167669410" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 366px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxevjWdSzKI/AAAAAAAABMk/M932n8y9iV4/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;What is External Quaries(EQ):&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;EQ is a unique request for retrieving data.&lt;br /&gt;EQ does not update any ILF's or EIF's.&lt;br /&gt;EQ doesnot contain derived data it simply retrieves the information where EO retrives complex calculated data.Suppose in customer screen ,customer dropdown is EO because it direct fetch data from Customer Master table.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Example of EQ:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Dynamic dropdown or list display&lt;br /&gt;Simple reports displayed from a single table without data manipulation&lt;br /&gt;Section of data retrieval based on input.&lt;br /&gt;Different graphical display request by a user should be counted as EQ.&lt;br /&gt;Help functionality which displays help text or field sensitive help will be counted as one EQ Perscreen.Suppose you have a screen where F1 key press shows the help,then the EQ will be 1 for that.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Complexity of EO:&lt;/span&gt;&lt;/strong&gt; Like EI,EO,Complexity of EQ is depends on File type reference(FTR) and Data element type(DET)&lt;br /&gt;&lt;br /&gt;Complexity Table for EQ:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxjWHnxDv3I/AAAAAAAABM0/8JD-siU2OQo/s1600-h/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxjWHnxDv3I/AAAAAAAABM0/8JD-siU2OQo/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5411310378707828594" /&gt;&lt;/a&gt;&lt;br /&gt;But remember for complex Query ,calculated output you should consider EO and for simple query you should consider EQ(EQ just go for one ILF and displays information)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-8394857903852196239?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/8394857903852196239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=8394857903852196239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/8394857903852196239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/8394857903852196239'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/estimation-using-fuction-point_03.html' title='Estimation using Fuction Point Analysis-EO,EQ(Part 2)'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/SxjT3BOfoHI/AAAAAAAABMs/ZyZSuLNsC2I/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-1103690546645206619</id><published>2009-12-03T12:00:00.036+05:30</published><updated>2009-12-15T09:39:03.365+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cost Estimation'/><title type='text'>Estimation using Fuction Point Analysis-EI(Part 1)</title><content type='html'>Fuction point is a unit of measurefor software size based on user requirements(not the internal process i.e we should not consider the internal complexity or workflow,only consider the user requirement).It was developed by Mr.Allan Albrecht at IBM in the late 1970s,as an alternative of line of code.(line of code has some limitations like its vary language to language and its difficult to predict).&lt;br /&gt;&lt;br /&gt;Software measure is a numerical value assigned to a software project depending on the complexity of project.The complexity of software can be known from "Data Collected" and "ClientArtifacts".It can be-&lt;br /&gt;1)Function Points&lt;br /&gt;2)Use case points&lt;br /&gt;3)Lines of code&lt;br /&gt;and convert to Man days,Man month or Man hours numerical values.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SxdetB_QOzI/AAAAAAAABLg/yTtM0kfBdWA/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5410897605029804850" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 120px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SxdetB_QOzI/AAAAAAAABLg/yTtM0kfBdWA/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The objective of this tutorial is how to calculate this Function point and arrive to Man days so that you can give a proposal to a client.&lt;br /&gt;&lt;br /&gt;First see what are the different operations a user does with an application-&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sxd2jvyE2sI/AAAAAAAABLw/Engc1yYMSr8/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5410923833802939074" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 184px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/Sxd2jvyE2sI/AAAAAAAABLw/Engc1yYMSr8/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The major element of Function point analysis is Application boundaries.There are two &lt;strong&gt;&lt;span style="color:#000099;"&gt;Application boundaries&lt;/span&gt;&lt;/strong&gt;-&lt;br /&gt;-1.Internal:Data which is maintained and directly controlled by application(ILF)&lt;br /&gt;-2.External:When data is referenced to external entities(EIF)&lt;br /&gt;The more you have external application boundary the more complexity.So first differentiate the application boundary before FPA.&lt;br /&gt;&lt;br /&gt;Now come to the rest of the elements like EI,EO,EQ,EIF and ILF etc.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;EI(External Input)-&lt;/span&gt;&lt;/strong&gt;EI moves the data in to the application from external app boundary to internal boundary.EI mainly updates ILF information.&lt;br /&gt;For every add/update and delete count one EI&lt;br /&gt;Every input screen is not a EI.i.e Query screen ,login screen,menus reports screen cannot be counted as EI even there is a user input.&lt;br /&gt;Process that maintain ILF like windows process or batch process that update database should be counted as EI.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/Sxd8nlK6D5I/AAAAAAAABL4/2eX3dtofsHk/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5410930496743542674" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 278px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/Sxd8nlK6D5I/AAAAAAAABL4/2eX3dtofsHk/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;EI has two attributes which basically define the complexity of EI&lt;br /&gt;-1.&lt;span style="color:#000099;"&gt;File type reference(FTR):&lt;/span&gt;&lt;br /&gt;FTR is a file or data referenced by EI.&lt;br /&gt;Count 1 FTR for every ILF maintained.&lt;br /&gt;Count 1 FTR for every ILF referenced.&lt;br /&gt;Count 1 FTR for every EIF referenced.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxeNaFaid3I/AAAAAAAABMI/U-fCRq4uF3c/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5410948956578543474" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 298px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxeNaFaid3I/AAAAAAAABMI/U-fCRq4uF3c/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;-2.&lt;span style="color:#000099;"&gt;Data element type(DET):&lt;/span&gt;&lt;br /&gt;DET are fields and attributes.In the above customer screen Customer code,Customer Name are fields or attributes ,so these are DETs.&lt;br /&gt;DET should be unique and user recognizable.If the customer screen comes again for another operation from another menu we should not count DET.&lt;br /&gt;Foreign keys are also DET's.Suppose customer ID is foreign key of address table ,then this foreign key should be counted as DET.&lt;br /&gt;Auto generated fields are also counted as DET as they are maintained in the ILF.Because we have to write seperate logic to create autogenerate numbers.&lt;br /&gt;Duplicate fields populated by the same user input should be counted as one DET.&lt;br /&gt;Error message are counted as DET.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxeDSw3kGkI/AAAAAAAABMA/v5ewsw7XlGY/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5410937835687778882" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 289px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxeDSw3kGkI/AAAAAAAABMA/v5ewsw7XlGY/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So In this example there is 12 DET and 3 FTR,So from EI rating table 6 is a complexity level of customer screen&lt;br /&gt;If we consider, 3 is a simple,4 is a medium and 6 is a complex,then from EI complexity table we can get the complexity value "complex" for this Customer screen&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxeXARnWXKI/AAAAAAAABMY/w0LRpf5geUU/s1600-h/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 289px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SxeXARnWXKI/AAAAAAAABMY/w0LRpf5geUU/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5410959508293180578" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-1103690546645206619?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/1103690546645206619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=1103690546645206619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1103690546645206619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1103690546645206619'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/estimation-using-fuction-point.html' title='Estimation using Fuction Point Analysis-EI(Part 1)'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/SxdetB_QOzI/AAAAAAAABLg/yTtM0kfBdWA/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-6328204751691163029</id><published>2009-12-01T16:21:00.002+05:30</published><updated>2009-12-01T16:25:05.225+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 14:Exception Handling</title><content type='html'>Exceptions are unforeseen errors that happen in your programs. Most of the time, you can, and should, detect and handle program errors in your code. For example, validating user input, checking for null objects, and verifying the values returned from methods are what you expect, are all examples of good standard error handling that you should be doing all the time. &lt;br /&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;&lt;br /&gt;class FinallyDemo&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        FileStream outStream = null;&lt;br /&gt;        FileStream inStream = null;&lt;br /&gt;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            outStream = File.OpenWrite("DestinationFile.txt");&lt;br /&gt;            inStream = File.OpenRead("BogusInputFile.txt");&lt;br /&gt;        }&lt;br /&gt;        catch(Exception ex)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine(ex.ToString());&lt;br /&gt;        }&lt;br /&gt;        finally&lt;br /&gt;        {&lt;br /&gt;            if (outStream != null)&lt;br /&gt;            {&lt;br /&gt;                outStream.Close();&lt;br /&gt;                Console.WriteLine("outStream closed.");&lt;br /&gt;            }&lt;br /&gt;            if (inStream != null)&lt;br /&gt;            {&lt;br /&gt;                inStream.Close();&lt;br /&gt;                Console.WriteLine("inStream closed.");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-6328204751691163029?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/6328204751691163029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=6328204751691163029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6328204751691163029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6328204751691163029'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-14exception-handling.html' title='Tutorial 14:Exception Handling'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-370065830275429459</id><published>2009-12-01T16:15:00.002+05:30</published><updated>2009-12-01T16:19:42.362+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 13:Events</title><content type='html'>An event is a member that enables an object or class to provide notifications. &lt;br /&gt;As compared to delegates events works with source and listener methodology. So listeners who are interested in receiving some events they subscribe to the source. Once this subscription is done the source raises events to its entire listener when needed. One source can have multiple listeners. &lt;br /&gt;In C# events are based on delegates, with the originator defining one or more call back functions. A call back function is a function in which one piece of code defines another implements, in other words, one piece of code says, “If you implement a function which looks like this, I can call it”. A class that wants to sue events defines callback functions or delegates, and the listening object then implements them. &lt;br /&gt;Events have no return type. &lt;br /&gt;There are following two differences:&lt;br /&gt;1. Events use delegates. &lt;br /&gt;2. Delegates are function pointers they can move across any client. &lt;br /&gt;&lt;br /&gt;// File name : events.cs &lt;br /&gt;using System; &lt;br /&gt;namespace CSharp.AStepAhead.events &lt;br /&gt;{ &lt;br /&gt;class Button &lt;br /&gt;{ &lt;br /&gt;public event EventHandler Click; &lt;br /&gt;public void Reset() &lt;br /&gt;{ &lt;br /&gt;Click = null; &lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt;public class impButton &lt;br /&gt;{ &lt;br /&gt;Button Button1 = new Button(); &lt;br /&gt;public impButton() &lt;br /&gt;{ &lt;br /&gt;Button1.Click += new EventHandler(Button1_Click); &lt;br /&gt;} &lt;br /&gt;public void Connect() &lt;br /&gt;{ &lt;br /&gt;Console.WriteLine("Attaching the event handler"); &lt;br /&gt;Button1.Click += new EventHandler(Button1_Click); &lt;br /&gt;} &lt;br /&gt;void Button1_Click(object s, EventArgs e) &lt;br /&gt;{ &lt;br /&gt;Console.WriteLine("Button1 clicked!"); &lt;br /&gt;} &lt;br /&gt;public void Disconnect() &lt;br /&gt;{ &lt;br /&gt;Console.WriteLine("Removng the event handler"); &lt;br /&gt;Button1.Click -= new EventHandler(Button1_Click); &lt;br /&gt;} &lt;br /&gt;static void Main() &lt;br /&gt;{ &lt;br /&gt;impButton objButton = new impButton(); &lt;br /&gt;objButton.Connect(); &lt;br /&gt;Console.ReadLine(); &lt;br /&gt;objButton.Disconnect(); &lt;br /&gt;Console.ReadLine(); &lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-370065830275429459?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/370065830275429459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=370065830275429459' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/370065830275429459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/370065830275429459'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-13events.html' title='Tutorial 13:Events'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-6449286402863227437</id><published>2009-12-01T16:07:00.002+05:30</published><updated>2009-12-01T16:14:05.666+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 12:Delegates</title><content type='html'>A delegate is a type-safe object that can point to another method (or possibly multiple methods) in the application, which can be invoked at later time.&lt;br /&gt;when you want to create a delegate in C# you make use of delegate keyword.&lt;br /&gt;&lt;br /&gt;The name of your delegate can be whatever you desire. However, you must define the delegate to match the signature of the method it will point to. fo example the following delegate can point to any method taking two integers and returning an integer.&lt;br /&gt;&lt;br /&gt;public delegate int DelegateName(int x, int y);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;A Delegate Usage Example&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;namespace MyFirstDelegate&lt;br /&gt;{&lt;br /&gt;    //This delegate can point to any method,&lt;br /&gt;    //taking two integers and returning an&lt;br /&gt;    //integer.&lt;br /&gt;    public delegate int MyDelegate(int x, int y);&lt;br /&gt;    //This class contains methods that MyDelegate will point to.&lt;br /&gt;    public class MyClass&lt;br /&gt;    {&lt;br /&gt;        public static int Add(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            return x + y;&lt;br /&gt;        }&lt;br /&gt;        public static int Multiply(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            return x * y;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //Create an Instance of MyDelegate&lt;br /&gt;            //that points to MyClass.Add().&lt;br /&gt;            MyDelegate del1 = new MyDelegate(MyClass.Add);&lt;br /&gt;            //Invoke Add() method using the delegate.&lt;br /&gt;            int addResult = del1(5, 5);&lt;br /&gt;            Console.WriteLine("5 + 5 = {0}\n", addResult);&lt;br /&gt;            //Create an Instance of MyDelegate&lt;br /&gt;            //that points to MyClass.Multiply().&lt;br /&gt;            MyDelegate del2 = new MyDelegate(MyClass.Multiply);&lt;br /&gt;            //Invoke Multiply() method using the delegate.&lt;br /&gt;            int multiplyResult = del2(5, 5);&lt;br /&gt;            Console.WriteLine("5 X 5 = {0}", multiplyResult);&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;strong&gt;Delegate ability to Multicast&lt;/strong&gt;&lt;br /&gt;Delegate's ability to multicast means that a delegate object can maintain a list of methods to call, rather than a single method &lt;br /&gt;if you want to add a method to the invocation list of a delegate object , you simply make use of the overloaded += operator, and if you want to remove a method from the invocation list you make use of the overloaded operator -= .&lt;br /&gt;Note: The Multicast delegate here contain methods that return void, if you want to create a multicast delegate with return type you will get the return type of the last method in the invocation list.&lt;br /&gt;A Multicast Delegate Example&lt;br /&gt;namespace MyMulticastDelegate&lt;br /&gt;{&lt;br /&gt;    //this delegate will be used to call more than one &lt;br /&gt;    //method at once&lt;br /&gt;    public delegate void MulticastDelegate(int x, int y);&lt;br /&gt;    //This class contains methods that MyDelegate will point to.&lt;br /&gt;    public class MyClass&lt;br /&gt;    {&lt;br /&gt;        public static void Add(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("You are in Add() Method");&lt;br /&gt;            Console.WriteLine("{0} + {1} = {2}\n", x, y, x + y);&lt;br /&gt;        }&lt;br /&gt;        public static void Multiply(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("You are in Multiply() Method");&lt;br /&gt;            Console.WriteLine("{0} X {1} = {2}", x, y, x * y);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //Create an Instance of MulticastDelegate&lt;br /&gt;            //that points to MyClass.Add().&lt;br /&gt;            MulticastDelegate del = new MulticastDelegate(MyClass.Add);&lt;br /&gt;            //using the same instance of MulticastDelegate&lt;br /&gt;            //to call MyClass.Multibly() by adding it to it's &lt;br /&gt;            //invocation list.&lt;br /&gt;            del += new MulticastDelegate(MyClass.Multiply);&lt;br /&gt;            //Invoke Add() and  Multiply() methods using the delegate.&lt;br /&gt;            //Note that these methods must have a void return vlue&lt;br /&gt;            Console.WriteLine("****calling Add() and Multibly() Methods.****\n\n");&lt;br /&gt;            del(5, 5);&lt;br /&gt;            //removing the Add() method from the invocation list&lt;br /&gt;            del -= new MulticastDelegate(MyClass.Add);&lt;br /&gt;            Console.WriteLine("\n\n****Add() Method removed.****\n\n");&lt;br /&gt;            //this will invoke the Multibly() method only.&lt;br /&gt;            del(5, 5);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-6449286402863227437?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/6449286402863227437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=6449286402863227437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6449286402863227437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6449286402863227437'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-12delegates.html' title='Tutorial 12:Delegates'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-4038407979843571043</id><published>2009-12-01T15:19:00.002+05:30</published><updated>2009-12-01T15:57:41.167+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 11:Interfaces</title><content type='html'>An interface looks like a class, but has no implementation. The only thing it contains are definitions of events, indexers, methods and/or properties. &lt;br /&gt;&lt;br /&gt;Defining an Interface: MyInterface.cs&lt;br /&gt;&lt;br /&gt;interface IMyInterface&lt;br /&gt;{&lt;br /&gt;    void MethodToImplement();&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Using an Interface: InterfaceImplementer.cs&lt;br /&gt;&lt;br /&gt;class InterfaceImplementer : IMyInterface&lt;br /&gt;{&lt;br /&gt;    static void Main()&lt;br /&gt;    {&lt;br /&gt;        InterfaceImplementer iImp = new InterfaceImplementer();&lt;br /&gt;        iImp.MethodToImplement();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void MethodToImplement()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("MethodToImplement() called.");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Interface Inheritance&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;interface IParentInterface&lt;br /&gt;{&lt;br /&gt;    void ParentInterfaceMethod();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;interface IMyInterface : IParentInterface&lt;br /&gt;{&lt;br /&gt;    void MethodToImplement();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class InterfaceImplementer : IMyInterface&lt;br /&gt;{&lt;br /&gt;    static void Main()&lt;br /&gt;    {&lt;br /&gt;        InterfaceImplementer iImp = new InterfaceImplementer();&lt;br /&gt;        iImp.MethodToImplement();&lt;br /&gt;        iImp.ParentInterfaceMethod();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void MethodToImplement()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("MethodToImplement() called.");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void ParentInterfaceMethod()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("ParentInterfaceMethod() called.");&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-4038407979843571043?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/4038407979843571043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=4038407979843571043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4038407979843571043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4038407979843571043'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-11interfaces.html' title='Tutorial 11:Interfaces'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2999594577387836315</id><published>2009-12-01T15:15:00.001+05:30</published><updated>2009-12-01T15:17:07.595+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 10:Indexers</title><content type='html'>C# introduces a new concept known as Indexers which are used for treating an object as an array. The indexers are usually known as smart arrays in C# community. Defining a C# indexer is much like defining properties. We can say that an indexer is a member that enables an object to be indexed in the same way as an array. &lt;br /&gt;&lt;br /&gt; &lt;modifier&gt; &lt;return type&gt; this [argument list]&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   // Get codes goes here&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   // Set codes goes here&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;Where the modifier can be private, public, protected or internal. The return type can be any valid C# types. The 'this' is a special keyword in C# to indicate the object of the current class. The formal-argument-list specifies the parameters of the indexer. The formal parameter list of an indexer corresponds to that of a method, except that at least one parameter must be specified, and that the ref and out parameter modifiers are not permitted. Remember that indexers in C# must have at least one parameter. Other wise the compiler will generate a compilation error. &lt;br /&gt;The following program shows a C# indexer in action &lt;br /&gt;&lt;br /&gt;// C#: INDEXER&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections;&lt;br /&gt;&lt;br /&gt;class MyClass&lt;br /&gt;{&lt;br /&gt; private string []data = new string[5];&lt;br /&gt; public string this [int index]&lt;br /&gt; {&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;   return data[index];&lt;br /&gt;  }&lt;br /&gt;  set&lt;br /&gt;  {&lt;br /&gt;   data[index] = value;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class MyClient&lt;br /&gt;{&lt;br /&gt; public static void Main()&lt;br /&gt; {&lt;br /&gt;  MyClass mc = new MyClass();&lt;br /&gt;  mc[0] = "Rajesh";&lt;br /&gt;  mc[1] = "A3-126";&lt;br /&gt;  mc[2] = "Snehadara";&lt;br /&gt;  mc[3] = "Irla";&lt;br /&gt;  mc[4] = "Mumbai";&lt;br /&gt; Console.WriteLine("{0},{1},{2},{3},{4}",mc[0],mc[1],mc[2],mc[3],mc[4]);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The indexers in C# can be overloaded just like member functions. The formal parameter list of an indexer defines the signature of the indexer. Specifically, the signature of an indexer consists of the number and types of its formal parameters. The element type is not part of an indexer's signature, nor is the names of the formal parameters. The signature of an indexer must differ from the signatures of all other indexers declared in the same class. C# do not have the concept of static indexers. If we declare an indexer static, the compiler will show a compilation time error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2999594577387836315?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2999594577387836315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2999594577387836315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2999594577387836315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2999594577387836315'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-10indexers.html' title='Tutorial 10:Indexers'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-1905100293916718372</id><published>2009-12-01T15:02:00.005+05:30</published><updated>2009-12-01T15:10:37.570+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 9:Properties</title><content type='html'>Properties allow you to access objects state with field-like syntax.&lt;br /&gt;Accessing Class Fields With Properties.&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class Customer&lt;br /&gt;{&lt;br /&gt;    private int m_id = -1;&lt;br /&gt;&lt;br /&gt;    public int ID&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return m_id;&lt;br /&gt;        }&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            m_id = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private string m_name = string.Empty;&lt;br /&gt;&lt;br /&gt;    public string Name&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return m_name;&lt;br /&gt;        }&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            m_name = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class CustomerManagerWithProperties&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        Customer cust = new Customer();&lt;br /&gt;&lt;br /&gt;        cust.ID = 1;&lt;br /&gt;        cust.Name = "Amelio Rosales";&lt;br /&gt;&lt;br /&gt; Console.WriteLine(&lt;br /&gt;            "ID: {0}, Name: {1}",&lt;br /&gt;            cust.ID,&lt;br /&gt;            cust.Name);&lt;br /&gt;&lt;br /&gt;        Console.ReadKey();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;It shows how to create and use a property. The Customer class has the ID and Name property implementations. There are also private fields named m_id and m_name; which ID and Name, respectively, encapsulate. Each property has two accessors, get and set. The accessor returns the value of a field. The set accessor sets the value of a field with the contents of value, which is the value being assigned by calling code. The value shown in the accessor is a C# reserved word. &lt;br /&gt;When setting a property, just assign a value to the property as if it were a field. The CustomerManagerWithProperties class uses the ID and Name properties in the Customer class. The first line of Main instantiates a Customer object named cust. Next the value of the m_id and m_name fields of cust are set by using the ID and Name properties. &lt;br /&gt;To read from a property, use the property as if it were a field. Console.WriteLine prints the value of the m_id and m_name fields of cust. It does this by calling the ID and Name properties of cust.&lt;br /&gt;This was a read/write property, but you can also create read-only properties&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Read-Only Properties&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class Customer&lt;br /&gt;{&lt;br /&gt;    private int m_id = -1;&lt;br /&gt;    private string m_name = string.Empty;&lt;br /&gt;&lt;br /&gt;    public Customer(int id, string name)&lt;br /&gt;    {&lt;br /&gt;        m_id = id;&lt;br /&gt;        m_name = name;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int ID&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return m_id;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public string Name&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return m_name;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class ReadOnlyCustomerManager&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        Customer cust = new Customer(1, "Amelio Rosales");&lt;br /&gt;&lt;br /&gt;        Console.WriteLine(&lt;br /&gt;            "ID: {0}, Name: {1}",&lt;br /&gt;            cust.ID,&lt;br /&gt;            cust.Name);&lt;br /&gt;&lt;br /&gt;        Console.ReadKey();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Creating a Write-Only Property&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class Customer&lt;br /&gt;{&lt;br /&gt;    private int m_id = -1;&lt;br /&gt;&lt;br /&gt;    public int ID&lt;br /&gt;    {&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            m_id = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private string m_name = string.Empty;&lt;br /&gt;&lt;br /&gt;    public string Name&lt;br /&gt;    {&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            m_name = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void DisplayCustomerData()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("ID: {0}, Name: {1}", m_id, m_name);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class WriteOnlyCustomerManager&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        Customer cust = new Customer();&lt;br /&gt;&lt;br /&gt;        cust.ID = 1;&lt;br /&gt;        cust.Name = "Amelio Rosales";&lt;br /&gt;&lt;br /&gt;        cust.DisplayCustomerData();&lt;br /&gt;&lt;br /&gt;        Console.ReadKey();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Auto-Impemented Properties&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class Customer&lt;br /&gt;{&lt;br /&gt;    public int ID { get; set; }&lt;br /&gt;    public string Name { get; set; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class AutoImplementedCustomerManager&lt;br /&gt;{&lt;br /&gt;    static void Main()&lt;br /&gt;    {&lt;br /&gt;        Customer cust = new Customer();&lt;br /&gt;&lt;br /&gt;        cust.ID = 1;&lt;br /&gt;        cust.Name = "Amelio Rosales";&lt;br /&gt;&lt;br /&gt;        Console.WriteLine(&lt;br /&gt;            "ID: {0}, Name: {1}",&lt;br /&gt;            cust.ID,&lt;br /&gt;            cust.Name);&lt;br /&gt;&lt;br /&gt;        Console.ReadKey();&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-1905100293916718372?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/1905100293916718372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=1905100293916718372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1905100293916718372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1905100293916718372'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-9properties.html' title='Tutorial 9:Properties'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2345138791046237563</id><published>2009-12-01T14:47:00.002+05:30</published><updated>2009-12-01T15:01:19.791+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 8:Polymorphism</title><content type='html'>A virtual method in C# specifies an implementation of a method that can be polymorphicaly overridden derived method. A non-virtual method can’t be polymorphically override in a Derived class.  &lt;br /&gt;&lt;br /&gt;A virtual method can be declared by using the keyword virtual as follows.&lt;br /&gt;&lt;br /&gt;class Base&lt;br /&gt;{&lt;br /&gt;           public virtual void Method()&lt;br /&gt;           {&lt;br /&gt;           }&lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;When we declare a virtual method, it must contain a method body. Other wise the compiler will generate an error. Remember that, since virtual methods are used for achieving polymorphism and since polymorphism works only with objects, it not possible to declare a static method as virtual in C#. Similarly the private methods are also not possible to declare virtual, since they can’t override inside a derived class.  &lt;br /&gt;&lt;br /&gt;In C#, it is not necessary to override a Base class virtual method inside a Derived class. &lt;br /&gt;&lt;br /&gt;The following program will work absolutely correct. &lt;br /&gt;&lt;br /&gt;// Inheritance : Virtual methods&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;class Base&lt;br /&gt;{&lt;br /&gt;            public virtual void Method()&lt;br /&gt;            {&lt;br /&gt;                        Console.WriteLine("Base method");&lt;br /&gt;            }&lt;br /&gt;}&lt;br /&gt;class Derived : Base&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;class MyClient&lt;br /&gt;{&lt;br /&gt;            public static void Main()&lt;br /&gt;            {&lt;br /&gt;                        Derived d1 = new Derived();&lt;br /&gt;                        d1.Method(); // Displays 'Base Method'&lt;br /&gt;            }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Or even it is possible to override a virtual method non-polymorphically inside a Derived class as shown below.&lt;br /&gt;&lt;br /&gt;// Inheritance : Virtual methods&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;class Base&lt;br /&gt;{&lt;br /&gt;            public virtual void Method()&lt;br /&gt;            {&lt;br /&gt;                        Console.WriteLine("Base method");&lt;br /&gt;            }&lt;br /&gt;}&lt;br /&gt;class Derived : Base&lt;br /&gt;{&lt;br /&gt;            public virtual void Method()&lt;br /&gt;            {&lt;br /&gt;                        Console.WriteLine("Derived method");&lt;br /&gt;            }&lt;br /&gt;}&lt;br /&gt;class MyClient&lt;br /&gt;{&lt;br /&gt;            public static void Main()&lt;br /&gt;            {&lt;br /&gt;                        Derived d1 = new Derived();&lt;br /&gt;                        d1.Method(); // Displays 'Derived Method'&lt;br /&gt;            }&lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;Even it is possible to omit the keyword virtual from the Derived class method or it is possible to declare the Derived class method as new. &lt;br /&gt;&lt;br /&gt;When we want to override a virtual method polymorphically inside a Derived class, we have to use the keyword override along with the method declaration. The example is shown below.  &lt;br /&gt;&lt;br /&gt;In C#, a Base class reference can hold an object of the Derived class and when it invokes the methods, it will invoke always the Derived class methods, if you already override that method inside the Derived class by using the override keyword. Also the Base class method must declare using the keyword virtual. This is what is known as Polymorphism in C#.&lt;br /&gt;&lt;br /&gt;// Inheritance : Virtual methods/Polymorphism&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;class Base&lt;br /&gt;{&lt;br /&gt;            public virtual void Method()&lt;br /&gt;            {&lt;br /&gt;                        Console.WriteLine("Base method");&lt;br /&gt;            }&lt;br /&gt;}&lt;br /&gt;class Derived : Base&lt;br /&gt;{&lt;br /&gt;            public override void Method()&lt;br /&gt;            {&lt;br /&gt;                        Console.WriteLine("Derived method");&lt;br /&gt;            }&lt;br /&gt;}&lt;br /&gt;class MyClient&lt;br /&gt;{&lt;br /&gt;            public static void Main()&lt;br /&gt;            {&lt;br /&gt;                        Base b1 = new Derived();&lt;br /&gt;                        b1.Method(); // Displays 'Base Method'&lt;br /&gt;            }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;As with a virtual method, we must include a method body with an override method; other wise the compiler will generate an error during compilation.  &lt;br /&gt;&lt;br /&gt;Remember that in C#, we can use the override keyword with only virtual method, when overriding inside a Derived class. An overridden declaration must be identical in every way to the virtual method, it overrides. They must have the same access level; the same return type, the same name and same method signature. &lt;br /&gt;&lt;br /&gt;The overridden methods are implicitly virtual in nature and hence they can override in subsequent Derived classes. As like virtual methods, override methods can’t be declared as static or private.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2345138791046237563?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2345138791046237563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2345138791046237563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2345138791046237563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2345138791046237563'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-8polymorphism.html' title='Tutorial 8:Polymorphism'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-7753961014412634378</id><published>2009-12-01T14:36:00.002+05:30</published><updated>2009-12-01T14:45:18.202+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 7:Class Inheritance</title><content type='html'>Inheritance is one of the primary concepts of object-oriented programming. It allows you to reuse existing code. Through effective employment of reuse, you can save time in your programming. &lt;br /&gt;Inheritance consists of creating a class whose primary definition or behavior is based on another class. In other words, inheritance starts by having a class that can provide behavior that other classes can improve on.&lt;br /&gt;&lt;br /&gt;Inheritance: BaseClass.cs&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class ParentClass&lt;br /&gt;{&lt;br /&gt;    public ParentClass()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("Parent Constructor.");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void print()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("I'm a Parent Class.");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class ChildClass : ParentClass&lt;br /&gt;{&lt;br /&gt;    public ChildClass()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("Child Constructor.");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        ChildClass child = new ChildClass();&lt;br /&gt;&lt;br /&gt;        child.print();&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;Output: &lt;br /&gt;     Parent Constructor.&lt;br /&gt;    Child Constructor.&lt;br /&gt;    I'm a Parent Class.&lt;br /&gt;It shows two classes. The top class is named ParentClass and the main class is called ChildClass. What we want to do is create a child class, using existing code from ParentClass. &lt;br /&gt;First we must declare our intention to use ParentClass as the base class of ChildClass. This is accomplished through the ChildClass declaration public class ChildClass : ParentClass. The base class is specified by adding a colon, ":", after the derived class identifier and then specifying the base class name. &lt;br /&gt;C# supports single class inheritance only. Therefore, you can specify only one base class to inherit from. &lt;br /&gt;ChildClass has exactly the same capabilities as ParentClass. Because of this, you can also say ChildClass "is" a ParentClass. This is shown in the Main() method of ChildClass when the print() method is called. ChildClass does not have its own print() method, so it uses the ParentClass print() method. You can see the results in the 3rd line of output. &lt;br /&gt;Base classes are automatically instantiated before derived classes. Notice the output,The ParentClass constructor executed before the ChildClass constructor. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Derived Class Communicating with Base Class with base keyword&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt; &lt;br /&gt;public class Parent&lt;br /&gt;{&lt;br /&gt;    string parentString;&lt;br /&gt;    public Parent()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("Parent Constructor.");&lt;br /&gt;    }&lt;br /&gt;    public Parent(string myString)&lt;br /&gt;    {&lt;br /&gt;        parentString = myString;&lt;br /&gt;        Console.WriteLine(parentString);&lt;br /&gt;    }&lt;br /&gt;    public void print()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("I'm a Parent Class.");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;public class Child : Parent&lt;br /&gt;{&lt;br /&gt;    public Child() : base("From Derived")&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("Child Constructor.");&lt;br /&gt;    }&lt;br /&gt;    public new void print()&lt;br /&gt;    {&lt;br /&gt;        base.print();&lt;br /&gt;        Console.WriteLine("I'm a Child Class.");&lt;br /&gt;    }&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        Child child = new Child();&lt;br /&gt;        child.print();&lt;br /&gt;        ((Parent)child).print();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;Output: &lt;br /&gt;     From Derived&lt;br /&gt;    Child Constructor.&lt;br /&gt;    I'm a Parent Class.&lt;br /&gt;    I'm a Child Class.&lt;br /&gt;    I'm a Parent Class.&lt;br /&gt;In summary, you know how to create a derived/base class relationship. You can control instantiation of your base class and call its methods either implicitly or explicitly. You also understand that a derived class is a specialization of its base class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-7753961014412634378?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/7753961014412634378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=7753961014412634378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/7753961014412634378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/7753961014412634378'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-7class-inheritance.html' title='Tutorial 7:Class Inheritance'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-1526323526415627995</id><published>2009-12-01T14:29:00.002+05:30</published><updated>2009-12-01T14:34:47.963+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 6:Introduction to Classes</title><content type='html'>Example C# Classes: Classes.cs&lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;// helper class&lt;br /&gt;class OutputClass &lt;br /&gt;{&lt;br /&gt;    string myString;&lt;br /&gt;&lt;br /&gt;    // Constructor&lt;br /&gt;    public OutputClass(string inputString) &lt;br /&gt;    {&lt;br /&gt;        myString = inputString;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Instance Method&lt;br /&gt;    public void printString() &lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("{0}", myString);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Destructor&lt;br /&gt;    ~OutputClass() &lt;br /&gt;    {&lt;br /&gt;        // Some resource cleanup routines&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Program start class&lt;br /&gt;class ExampleClass &lt;br /&gt;{&lt;br /&gt;    // Main begins program execution.&lt;br /&gt;    public static void Main() &lt;br /&gt;    {&lt;br /&gt;        // Instance of OutputClass&lt;br /&gt;        OutputClass outCl = new OutputClass("This is printed by the output class.");&lt;br /&gt;&lt;br /&gt;        // Call Output class' method&lt;br /&gt;        outCl.printString(); &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;The top class, OutputClass, has a constructor, instance method, and a destructor. It also had a field named myString. Notice how the OutputClass constructor is used to initialize data members of the class. In this case, the OutputClass constructor accepts a string argument, inputString. This string is copied to the class field myString. &lt;br /&gt;Constructors are not mandatory, as indicated by the implementation of ExampleClass. In this case, a default constructor is provided. A default constructor is simply a constructor with no arguments. &lt;br /&gt;In C#, there are two types of class members, instance and static. Instance class members belong to a specific occurrence of a class. Every time you declare an object of a certain class, you create a new instance of that class. The ExampleClass Main() method creates an instance of the OutputClass named outCl. You can create multiple instances of OutputClass with different names. Each of these instances are separate and stand alone. For example, if you create two OutputClass instances as follows: &lt;br /&gt;    OutputClass oc1 = new OutputClass("OutputClass1");&lt;br /&gt;    OutputClass oc2 = new OutputClass("OutputClass2"); &lt;br /&gt;You create two separate instances of OutputClass with separate myString fields and separate printString() methods. On the other hand, if a class member is static, you can access it simply by using the syntax &lt;classname&gt;.&lt;static class member&gt;. The instance names are oc1 and oc2. &lt;br /&gt;Suppose OutputClass had the following static method: &lt;br /&gt;    public static void staticPrinter() &lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("There is only one of me.");&lt;br /&gt;    } &lt;br /&gt;Then you could call that function from Main() like this: &lt;br /&gt;    OutputClass.staticPrinter();&lt;br /&gt;You must call static class members through their class name and not their instance name. This means that you don't need to instantiate a class to use its static members. There is only ever one copy of a static class member. A good use of static members is when there is a function to be performed and no intermediate state is required, such as math calculations. Matter of fact, the .NET Frameworks Base Class Library includes a Math class that makes extensive use of static members. &lt;br /&gt;Another type of constructor is the static constructor. Use static constructor to initialize static fields in a class. You declare a static constructor by using the keyword static just in front of the constructor name. A static constructor is called before an instance of a class is created, before a static member is called, and before the static constructor of a derived class (covered in a later chapter). They are called only once. &lt;br /&gt;OutputClass also has a destructor. Destructors look just like constructors, except they have a tilde, "~", in front of them. They don't take any parameters and do not return a value. Destructors are places where you could put code to release any resources your class was holding during its lifetime. They are normally called when the C# garbage collector decides to clean your object from memory. &lt;br /&gt;In summary, you can declare instance and static constructors. You know how to initialize class fields. When there is no need to instantiate an object, you can create static class members. You can also declare destructors for cleaning up resources.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-1526323526415627995?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/1526323526415627995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=1526323526415627995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1526323526415627995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/1526323526415627995'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-6introduction-to-classes.html' title='Tutorial 6:Introduction to Classes'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-3249105604831309431</id><published>2009-12-01T14:17:00.002+05:30</published><updated>2009-12-01T14:27:35.728+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 5:Namespaces</title><content type='html'>Namespaces are C# program elements designed to help you organize your programs. They also provide assistance in avoiding name clashes between two sets of code. Implementing Namespaces in your own code is a good habit because it is likely to save you from problems later when you want to reuse some of your code. &lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;// The Portal-management Namespace&lt;br /&gt;namespace Portal-management &lt;br /&gt;{&lt;br /&gt;    // Program start class&lt;br /&gt;    class NamespaceCSS &lt;br /&gt;    {&lt;br /&gt;        // Main begins program execution.&lt;br /&gt;        public static void Main() &lt;br /&gt;        {&lt;br /&gt;            // Write to console&lt;br /&gt;            Console.WriteLine("This is the new Portal-management Namespace."); &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;It shows how to create a namespace.  We declare the new namespace by putting the word namespace in front of Portal-management.  Curly braces surround the members inside the Portal-management namespace.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Nested Namespace &lt;/strong&gt;&lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;// The Portal-management Tutorial Namespace&lt;br /&gt;namespace Portal-management &lt;br /&gt;{&lt;br /&gt;    namespace tutorial &lt;br /&gt;    {&lt;br /&gt;        // Program start class&lt;br /&gt;        class NamespaceCSS &lt;br /&gt;        {&lt;br /&gt;            // Main begins program execution.&lt;br /&gt;            public static void Main() &lt;br /&gt;            {&lt;br /&gt;                // Write to console&lt;br /&gt;                Console.WriteLine("This is the new Portal-management Tutorial Namespace.");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Another Way to create Namespace using "." operator i.e Portal-management.tutorial &lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;// The Portal-management Tutorial Namespace&lt;br /&gt;namespace Portal-management.tutorial &lt;br /&gt;{&lt;br /&gt;    // Program start class&lt;br /&gt;    class NamespaceCSS &lt;br /&gt;    {&lt;br /&gt;        // Main begins program execution.&lt;br /&gt;        public static void Main() &lt;br /&gt;        {&lt;br /&gt;            // Write to console&lt;br /&gt;            Console.WriteLine("This is the new Portal-management Tutorial Namespace."); &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;It shows another way of writing nested namespaces. It specifies the nested namespace with the dot operator between Portal-management and tutorial.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Calling Namespace Members:&lt;/strong&gt; NamespaceCall.cs&lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;namespace Portal-management &lt;br /&gt;{&lt;br /&gt;    // nested namespace&lt;br /&gt;    namespace tutorial &lt;br /&gt;    {&lt;br /&gt;        class myExample1 &lt;br /&gt;        {&lt;br /&gt;            public static void myPrint1() &lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("First Example of calling another namespace member.");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Program start class&lt;br /&gt;    class NamespaceCalling &lt;br /&gt;    {&lt;br /&gt;        // Main begins program execution.&lt;br /&gt;        public static void Main() &lt;br /&gt;        {&lt;br /&gt;            // Write to console&lt;br /&gt;            tutorial.myExample1.myPrint1(); &lt;br /&gt;            tutorial.myExample2.myPrint2(); &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// same namespace as nested namespace above&lt;br /&gt;namespace Portal-management.tutorial &lt;br /&gt;{&lt;br /&gt;    class myExample2 &lt;br /&gt;    {&lt;br /&gt;        public static void myPrint2() &lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Second Example of calling another namespace member.");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Another way to calling namespaces with the help of "using" keyword or with the  Alias Directive:&lt;br /&gt;&lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;using Portal-management.tutorial;&lt;br /&gt;&lt;br /&gt;// Program start class&lt;br /&gt;class UsingDirective &lt;br /&gt;{&lt;br /&gt;    // Main begins program execution.&lt;br /&gt;    public static void Main() &lt;br /&gt;    {&lt;br /&gt;        // Call namespace member&lt;br /&gt;        myExample.myPrint(); &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Portal-management Tutorial Namespace&lt;br /&gt;namespace Portal-management.tutorial &lt;br /&gt;{&lt;br /&gt;    class myExample &lt;br /&gt;    {&lt;br /&gt;        public static void myPrint() &lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Example of using a using directive.");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;With the Alias Directive:&lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;using csTut = Portal-management.tutorial.myExample; // alias&lt;br /&gt;&lt;br /&gt;// Program start class&lt;br /&gt;class AliasDirective &lt;br /&gt;{&lt;br /&gt;    // Main begins program execution.&lt;br /&gt;    public static void Main() &lt;br /&gt;    {&lt;br /&gt;        // Call namespace member&lt;br /&gt;        csTut.myPrint();&lt;br /&gt;        myPrint();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Potentially ambiguous method.&lt;br /&gt;    static void myPrint() &lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("Not a member of Portal-management.tutorial.myExample.");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Portal-management Tutorial Namespace&lt;br /&gt;namespace Portal-management.tutorial &lt;br /&gt;{&lt;br /&gt;    class myExample &lt;br /&gt;    {&lt;br /&gt;        public static void myPrint() &lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("This is a member of Portal-management.tutorial.myExample.");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;In summary, you know what a namespace is and you can declare your own namespaces. If you don't want to type a fully qualified name, you know how to implement the using directive. When you want to shorten a long namespace declaration, you can use the alias directive. Also, you have been introduced to some of the other namespace members in addition to the class type.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-3249105604831309431?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/3249105604831309431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=3249105604831309431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3249105604831309431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3249105604831309431'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-5namespaces.html' title='Tutorial 5:Namespaces'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-4105337495616759070</id><published>2009-12-01T14:03:00.002+05:30</published><updated>2009-12-01T14:14:24.176+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 4:Methods</title><content type='html'>Methods are extremely useful because they allow you to separate your logic into different units. You can pass information to methods, have it perform one or more statements, and retrieve a return value.&lt;br /&gt;Here's a description of the syntax required for creating a method:&lt;br /&gt;     attributes modifiers return-type method-name(parameters )  &lt;br /&gt; {       &lt;br /&gt;statements  &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;The return-type can be any C# type. It can be assigned to a variable for use later in the program. The method name is a unique identifier for what you wish to call a method.Parameters allow you to pass information to and from a method.Statements within the curly braces carry out the functionality of the method.&lt;br /&gt;One Simple Method: OneMethod.cs&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;class OneMethod&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        string myChoice;&lt;br /&gt;&lt;br /&gt;        OneMethod om = new OneMethod();&lt;br /&gt;&lt;br /&gt;        do&lt;br /&gt;       {&lt;br /&gt;            myChoice = om.getChoice();&lt;br /&gt;&lt;br /&gt;            // Make a decision based on the user's choice&lt;br /&gt;            switch(myChoice)&lt;br /&gt;            {&lt;br /&gt;                case "A":&lt;br /&gt;                case "a":&lt;br /&gt;                    Console.WriteLine("You wish to add an address.");&lt;br /&gt;                    break;&lt;br /&gt;                case "D":&lt;br /&gt;                case "d":&lt;br /&gt;                    Console.WriteLine("You wish to delete an address.");&lt;br /&gt;                    break;&lt;br /&gt;                case "M":&lt;br /&gt;                case "m":&lt;br /&gt;                    Console.WriteLine("You wish to modify an address.");&lt;br /&gt;                    break;&lt;br /&gt;                case "V":&lt;br /&gt;                case "v":&lt;br /&gt;                    Console.WriteLine("You wish to view the address list.");&lt;br /&gt;                    break;&lt;br /&gt;                case "Q":&lt;br /&gt;                case "q":&lt;br /&gt;                    Console.WriteLine("Bye.");&lt;br /&gt;                    break;&lt;br /&gt;                default:&lt;br /&gt;                    Console.WriteLine("{0} is not a valid choice", myChoice);&lt;br /&gt;                    break;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            // Pause to allow the user to see the results&lt;br /&gt;            Console.WriteLine();&lt;br /&gt;            Console.Write("press Enter key to continue...");&lt;br /&gt;&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;            Console.WriteLine();&lt;br /&gt;&lt;br /&gt;        } while (myChoice != "Q" &amp;amp;&amp;amp; myChoice != "q"); // Keep going until the user wants to quit&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    string getChoice()&lt;br /&gt;    {&lt;br /&gt;        string myChoice;&lt;br /&gt;        // Print A Menu&lt;br /&gt;        Console.WriteLine("My Address Book\n");&lt;br /&gt;        Console.WriteLine("A - Add New Address");&lt;br /&gt;        Console.WriteLine("D - Delete Address");&lt;br /&gt;        Console.WriteLine("M - Modify Address");&lt;br /&gt;        Console.WriteLine("V - View Addresses");&lt;br /&gt;        Console.WriteLine("Q - Quit\n");&lt;br /&gt;        Console.Write("Choice (A,D,M,V,or Q): ");&lt;br /&gt;        // Retrieve the user's choice&lt;br /&gt;        myChoice = Console.ReadLine();&lt;br /&gt;        Console.WriteLine();&lt;br /&gt;&lt;br /&gt;        return myChoice;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Instead of printing the menu and accepting input in the Main() method, this functionality has been moved to a new method called getChoice(). The return type is a string. This string is used in the switch statement in Main(). The method name "getChoice" describes what happens when it is invoked. Since the parentheses are empty, no information will be transferred to the getChoice() method.&lt;br /&gt;Within the method block we first declare the variable myChoice. Although this is the same name and type as the myChoice variable in Main(), they are both unique variables. They are local variables and they are visible only in the block they are declared. In other words, the myChoice in getChoice() knows nothing about the existence of the myChoice in Main(), and vice versa.&lt;br /&gt;The getChoice() method prints a menu to the console and gets the user's input. The return statement sends the data from the myChoice variable back to the caller, Main(), of getChoice(). Notice that the type returned by the return statement must be the same as the return-type in the function declaration. In this case it is a string.&lt;br /&gt;In the Main() method we must instantiate a new OneMethod object before we can use getChoice(). This is because of the way getChoice() is declared. Since we did not specify a static modifier, as for Main(), getChoice() becomes an instance method. The difference between instance methods and static methods is that multiple instances of a class can be created (or instantiated) and each instance has its own separate getChoice() method. However, when a method is static, there are no instances of that method, and you can invoke only that one definition of the static method.&lt;br /&gt;So, as stated, getChoice() is not static and therefore, we must instantiate a new object to use it. This is done with the declaration OneMethod om = new OneMethod(). On the left hand side of the declaration is the object reference om which is of type OneMethod. The distinction of om being a reference is important. It is not an object itself, but it is a variable that can refer (or point ) to an object of type OneMethod. On the right hand side of the declaration is an assignment of a new OneMethod object to the reference om. The keyword new is a C# operator that creates a new instance of an object on the heap. What is happening here is that a new OneMethod instance is being created on the heap and then being assigned to the om reference. Now that we have an instance of the OneMethod class referenced by om, we can manipulate that instance through the om reference. Methods, fields, and other class members can be accessed, identified, or manipulated through the "." (dot) operator. Since we want to call getChoice(), we do so by using the dot operator through the om reference: om.getChoice().  The program then executes the statements in the getChoice() block and returns.  To capture the value getChoice() returns, we use the "=" (assignment) operator.  The returned string is placed into Main()'s local myChoice variable. From there, the rest of the program executes as expected, using concepts from earlier lessons.&lt;br /&gt;Method Parameters: MethodParams.cs&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class Address&lt;br /&gt;{&lt;br /&gt;    public string name;&lt;br /&gt;    public string address;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class MethodParams&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        string myChoice;&lt;br /&gt;&lt;br /&gt;        MethodParams mp = new MethodParams();&lt;br /&gt;&lt;br /&gt;        do&lt;br /&gt;       {&lt;br /&gt;            // show menu and get input from user&lt;br /&gt;            myChoice = mp.getChoice();&lt;br /&gt;&lt;br /&gt;            // Make a decision based on the user's choice&lt;br /&gt;            mp.makeDecision(myChoice);&lt;br /&gt;&lt;br /&gt;            // Pause to allow the user to see the results&lt;br /&gt;            Console.Write("press Enter key to continue...");&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;            Console.WriteLine();&lt;br /&gt;        } while (myChoice != "Q" &amp;amp;&amp;amp; myChoice != "q"); // Keep going until the user wants to quit&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // show menu and get user's choice&lt;br /&gt;    string getChoice()&lt;br /&gt;    {&lt;br /&gt;        string myChoice;&lt;br /&gt;&lt;br /&gt;        // Print A Menu&lt;br /&gt;        Console.WriteLine("My Address Book\n");&lt;br /&gt;&lt;br /&gt;        Console.WriteLine("A - Add New Address");&lt;br /&gt;        Console.WriteLine("D - Delete Address");&lt;br /&gt;        Console.WriteLine("M - Modify Address");&lt;br /&gt;        Console.WriteLine("V - View Addresses");&lt;br /&gt;        Console.WriteLine("Q - Quit\n");&lt;br /&gt;&lt;br /&gt;        Console.WriteLine("Choice (A,D,M,V,or Q): ");&lt;br /&gt;&lt;br /&gt;        // Retrieve the user's choice&lt;br /&gt;        myChoice = Console.ReadLine();&lt;br /&gt;&lt;br /&gt;        return myChoice;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // make decision&lt;br /&gt;    void makeDecision(string myChoice)&lt;br /&gt;    {&lt;br /&gt;        Address addr = new Address();&lt;br /&gt;&lt;br /&gt;        switch(myChoice)&lt;br /&gt;        {&lt;br /&gt;            case "A":&lt;br /&gt;            case "a":&lt;br /&gt;                addr.name = "Joe";&lt;br /&gt;                addr.address = "Portal-management";&lt;br /&gt;                this.addAddress(ref addr);&lt;br /&gt;                break;&lt;br /&gt;            case "D":&lt;br /&gt;            case "d":&lt;br /&gt;                addr.name = "Robert";&lt;br /&gt;                this.deleteAddress(addr.name);&lt;br /&gt;                break;&lt;br /&gt;            case "M":&lt;br /&gt;            case "m":&lt;br /&gt;                addr.name = "Matt";&lt;br /&gt;                this.modifyAddress(out addr);&lt;br /&gt;                Console.WriteLine("Name is now {0}.", addr.name);&lt;br /&gt;                break;&lt;br /&gt;            case "V":&lt;br /&gt;            case "v":&lt;br /&gt;                this.viewAddresses("Cheryl", "Joe", "Matt", "Robert");&lt;br /&gt;                break;&lt;br /&gt;            case "Q":&lt;br /&gt;            case "q":&lt;br /&gt;                Console.WriteLine("Bye.");&lt;br /&gt;                break;&lt;br /&gt;            default:&lt;br /&gt;                Console.WriteLine("{0} is not a valid choice", myChoice);&lt;br /&gt;                break;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // insert an address&lt;br /&gt;    void addAddress(ref Address addr)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("Name: {0}, Address: {1} added.", addr.name, addr.address);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // remove an address&lt;br /&gt;    void deleteAddress(string name)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("You wish to delete {0}'s address.", name);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // change an address&lt;br /&gt;    void modifyAddress(out Address addr)&lt;br /&gt;    {&lt;br /&gt;        //Console.WriteLine("Name: {0}.", addr.name); // causes error!&lt;br /&gt;        addr = new Address();&lt;br /&gt;        addr.name = "Joe";&lt;br /&gt;        addr.address = "Portal-management";&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // show addresses&lt;br /&gt;    void viewAddresses(params string[] names)&lt;br /&gt;    {&lt;br /&gt;        foreach (string name in names)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Name: {0}", name);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;There are 4 kinds of parameters a C# method can handle: out, ref, params, and value.  To help illustrate usage of parameters, we created an Address class with two string fields.&lt;br /&gt;In Main() we call getChoice() to get the user's input and put that string in the myChoice variable. Then we use myChoice as an argument to makeDecision(). In the declaration of makeDecision() you'll notice its one parameter is declared as a string with the name myChoice. Again, this is a new myChoice, separate from the caller's argument and local only to this method. Since makeDecision()'s myChoice parameter does not have any other modifiers, it is considered a value parameter. The actual value of the argument is copied on the stack. Variables given by value parameters are local and any changes to that local variable do not affect the value of the variable used in the caller's argument.&lt;br /&gt;The switch statement in makeDecision() calls a method for each case. These method calls are different from the ones we used in Main(). Instead of using the mp reference, they use the this keyword. this is a reference to the current object. We know the current object has been instantiated because makeDecision() is not a static method. Therefore, we can use the this reference to call methods within the same instance.&lt;br /&gt;The addAddress() method takes a ref parameter. This means that a reference to the parameter is copied to the method. This reference still refers to the same object on the heap as the original reference used in the caller's argument. This means any changes to the local reference's object also changes the caller reference's object. The code can't change the reference, but it can make changes to the object being referenced. You can think of this as a way to have an input/output parameter.&lt;br /&gt;As you know, methods have return values, but sometimes you'll want to return more than one value from a method. An out parameter allows you to return additional values from a method.&lt;br /&gt;modifyAddress() has an out parameter. out parameters are only passed back to the calling function. Because of definite assignment rules, you cannot use this variable until it has a valid value assigned. The first line in modifyAddress() is commented on purpose to illustrate this point. Uncomment it and compile to see what happens. Once assigned and the program returns, the value of the out parameter will be copied into the caller's argument variable. You must assign a value to an out parameter before your method returns.&lt;br /&gt;A very useful addition to the C# language is the params parameter, which lets you define a method that can accept a variable number of arguments. The params parameter must be a single dimension or jagged array. When calling viewAddresses(), we pass in four string arguments. The number of arguments is variable and will be converted to a string[] automatically. In viewAddresses() we use a foreach loop to print each of these strings. Instead of the list of string arguments, the input could have also been a string array. The params parameter is considered an input only parameter and any changes affect the local copy only. In summary, you understand the structure of a method. The four types of paramters are value, ref, out, and params. When you wish to use an instance method, you must instantiate its object as opposed to static methods that can be called any time. The this reference refers to its containing object and may be used to refer to its containing object's members, including methods.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-4105337495616759070?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/4105337495616759070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=4105337495616759070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4105337495616759070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4105337495616759070'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-4methods.html' title='Tutorial 4:Methods'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-7123812511361253258</id><published>2009-12-01T12:45:00.004+05:30</published><updated>2009-12-01T12:55:14.982+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 3:Control Statements - Selection</title><content type='html'>&lt;strong&gt;The if Statement:&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class IfSelect&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        string myInput;&lt;br /&gt;        int myInt; &lt;br /&gt;&lt;br /&gt;        Console.Write("Please enter a number: ");&lt;br /&gt;        myInput = Console.ReadLine();&lt;br /&gt;        myInt = Int32.Parse(myInput); &lt;br /&gt;&lt;br /&gt;        // Single Decision and Action with braces&lt;br /&gt;        if (myInt &gt; 0)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your number {0} is greater than zero.", myInt);&lt;br /&gt;        } &lt;br /&gt;&lt;br /&gt;        // Single Decision and Action without brackets&lt;br /&gt;        if (myInt &lt; 0) &lt;br /&gt;            Console.WriteLine("Your number {0} is less than zero.", myInt); &lt;br /&gt;&lt;br /&gt;        // Either/Or Decision&lt;br /&gt;        if (myInt != 0)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your number {0} is not equal to zero.", myInt);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;       {&lt;br /&gt;            Console.WriteLine("Your number {0} is equal to zero.", myInt);&lt;br /&gt;        } &lt;br /&gt;&lt;br /&gt;        // Multiple Case Decision&lt;br /&gt;        if (myInt &lt; 0 || myInt == 0)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your number {0} is less than or equal to zero.", myInt);&lt;br /&gt;        }&lt;br /&gt;        else if (myInt &gt; 0 &amp;&amp; myInt &lt;= 10)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your number {0} is in the range from 1 to 10.", myInt);&lt;br /&gt;        }&lt;br /&gt;        else if (myInt &gt; 10 &amp;&amp; myInt &lt;= 20)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your number {0} is in the range from 11 to 20.", myInt);&lt;br /&gt;        }&lt;br /&gt;        else if (myInt &gt; 20 &amp;&amp; myInt &lt;= 30)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your number {0} is in the range from 21 to 30.", myInt);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;       {&lt;br /&gt;            Console.WriteLine("Your number {0} is greater than 30.", myInt);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The switch Statement:&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class SwitchSelect&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        string myInput;&lt;br /&gt;        int myInt;&lt;br /&gt;&lt;br /&gt;        begin:&lt;br /&gt;&lt;br /&gt;        Console.Write("Please enter a number between 1 and 3: ");&lt;br /&gt;        myInput = Console.ReadLine();&lt;br /&gt;        myInt = Int32.Parse(myInput);&lt;br /&gt;&lt;br /&gt;        // switch with integer type&lt;br /&gt;        switch (myInt)&lt;br /&gt;        {&lt;br /&gt;            case 1:&lt;br /&gt;                Console.WriteLine("Your number is {0}.", myInt);&lt;br /&gt;                break;&lt;br /&gt;            case 2:&lt;br /&gt;                Console.WriteLine("Your number is {0}.", myInt);&lt;br /&gt;                break;&lt;br /&gt;            case 3:&lt;br /&gt;                Console.WriteLine("Your number is {0}.", myInt);&lt;br /&gt;                break;&lt;br /&gt;            default:&lt;br /&gt;                Console.WriteLine("Your number {0} is not between 1 and 3.", myInt);&lt;br /&gt;                break;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        decide:&lt;br /&gt;&lt;br /&gt;        Console.Write("Type \"continue\" to go on or \"quit\" to stop: ");&lt;br /&gt;        myInput = Console.ReadLine();&lt;br /&gt;&lt;br /&gt;        // switch with string type&lt;br /&gt;        switch (myInput)&lt;br /&gt;        {&lt;br /&gt;            case "continue":&lt;br /&gt;                goto begin;&lt;br /&gt;            case "quit":&lt;br /&gt;                Console.WriteLine("Bye.");&lt;br /&gt;                break;&lt;br /&gt;            default:&lt;br /&gt;                Console.WriteLine("Your input {0} is incorrect.", myInput);&lt;br /&gt;                goto decide;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxTEFzmiXpI/AAAAAAAABLY/1wPpCxiQPB4/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 85px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxTEFzmiXpI/AAAAAAAABLY/1wPpCxiQPB4/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5410164656409042578" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The while Loop:&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class WhileLoop&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        int myInt = 0;&lt;br /&gt;&lt;br /&gt;        while (myInt &lt; 10)&lt;br /&gt;        {&lt;br /&gt;            Console.Write("{0} ", myInt);&lt;br /&gt;            myInt++;&lt;br /&gt;        }&lt;br /&gt;        Console.WriteLine();&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The do Loop:&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class DoLoop&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        string myChoice;&lt;br /&gt;&lt;br /&gt;        do&lt;br /&gt;       {&lt;br /&gt;            // Print A Menu&lt;br /&gt;            Console.WriteLine("My Address Book\n");&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("A - Add New Address");&lt;br /&gt;            Console.WriteLine("D - Delete Address");&lt;br /&gt;            Console.WriteLine("M - Modify Address");&lt;br /&gt;            Console.WriteLine("V - View Addresses");&lt;br /&gt;            Console.WriteLine("Q - Quit\n");&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Choice (A,D,M,V,or Q): ");&lt;br /&gt;&lt;br /&gt;            // Retrieve the user's choice&lt;br /&gt;            myChoice = Console.ReadLine();&lt;br /&gt;&lt;br /&gt;            // Make a decision based on the user's choice&lt;br /&gt;            switch(myChoice)&lt;br /&gt;            {&lt;br /&gt;                case "A":&lt;br /&gt;                case "a":&lt;br /&gt;                    Console.WriteLine("You wish to add an address.");&lt;br /&gt;                    break;&lt;br /&gt;                case "D":&lt;br /&gt;                case "d":&lt;br /&gt;                    Console.WriteLine("You wish to delete an address.");&lt;br /&gt;                    break;&lt;br /&gt;                case "M":&lt;br /&gt;                case "m":&lt;br /&gt;                    Console.WriteLine("You wish to modify an address.");&lt;br /&gt;                    break;&lt;br /&gt;                case "V":&lt;br /&gt;                case "v":&lt;br /&gt;                    Console.WriteLine("You wish to view the address list.");&lt;br /&gt;                    break;&lt;br /&gt;                case "Q":&lt;br /&gt;                case "q":&lt;br /&gt;                    Console.WriteLine("Bye.");&lt;br /&gt;                    break;&lt;br /&gt;                default:&lt;br /&gt;                    Console.WriteLine("{0} is not a valid choice", myChoice);&lt;br /&gt;                    break;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            // Pause to allow the user to see the results&lt;br /&gt;            Console.Write("press Enter key to continue...");&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;            Console.WriteLine();&lt;br /&gt;        } while (myChoice != "Q" &amp;&amp; myChoice != "q"); // Keep going until the user wants to quit&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The for Loop:&lt;/strong&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class ForLoop&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        for (int i=0; i &lt; 20; i++)&lt;br /&gt;        {&lt;br /&gt;            if (i == 10)&lt;br /&gt;                break;&lt;br /&gt;&lt;br /&gt;            if (i % 2 == 0)&lt;br /&gt;                continue;&lt;br /&gt;&lt;br /&gt;            Console.Write("{0} ", i);&lt;br /&gt;        }&lt;br /&gt;        Console.WriteLine();&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The foreach Loop:&lt;/strong&gt;&lt;br /&gt;A foreach loop is used to iterate through the items in a list. It operates on arrays or collections such as ArrayList, which can be found in the System.Collections namespace. The syntax of a foreach loop is foreach (&lt;type&gt; &lt;iteration variable&gt; in &lt;list&gt;) { &lt;statements&gt; }. The type is the type of item contained in the list. For example, if the type of the list was int[] then the type would be int. &lt;br /&gt;The iteration variable is an identifier that you choose, which could be anything but should be meaningful. For example, if the list contained an array of people's ages, then a meaningful name for item name would be age. &lt;br /&gt;The in keyword is required.&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class ForEachLoop&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        string[] names = {"Cheryl", "Joe", "Matt", "Robert"};&lt;br /&gt;&lt;br /&gt;        foreach (string person in names)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("{0} ", person);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Summary:&lt;/strong&gt;&lt;br /&gt;Loops allow you to execute a block of statements repeatedly. C# offers several statements to construct loops with, including the while, do, for, and foreach loops. while loops execute a block of statements as long as an expression is true, do loops execute a block of statements at least once and then keep going as long as a condition is true, for loops execute a block of statements a specified amount of times, and foreach loops execute a block of statements for each item in a collection. Normally a block of statements will execute from beginning to end. However, the normal flow of a loop can be changed with the break and continue statements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-7123812511361253258?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/7123812511361253258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=7123812511361253258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/7123812511361253258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/7123812511361253258'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-3control-statements-selection.html' title='Tutorial 3:Control Statements - Selection'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1EZkGmmHBwc/SxTEFzmiXpI/AAAAAAAABLY/1wPpCxiQPB4/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-7532676747593405939</id><published>2009-12-01T12:15:00.006+05:30</published><updated>2009-12-01T12:42:41.615+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 2:Operators, Types, and Variables</title><content type='html'>&lt;strong&gt;Variables and Types:&lt;/strong&gt;&lt;br /&gt;"Variables" are simply storage locations for data. You can place data into them and retrieve their contents as part of a C# expression. The interpretation of the data in a variable is controlled through "Types". &lt;br /&gt;&lt;strong&gt;Integral Types&lt;/strong&gt;&lt;br /&gt;In C#, an integral is a category of types. For anyone confused because the word Integral sounds like a mathematical term, from the perspective of C# programming, these are actually defined as Integral types in the C# programming language specification. They are whole numbers, either signed or unsigned, and the char type. The char type is a Unicode character, as defined by the Unicode Standard. &lt;br /&gt;The Size and Range of C# Integral Types-&lt;br /&gt;&lt;br /&gt;Type  Size (in bits)  Range &lt;br /&gt;sbyte  8  -128 to 127 &lt;br /&gt;byte  8  0 to 255 &lt;br /&gt;short  16  -32768 to 32767 &lt;br /&gt;ushort  16  0 to 65535 &lt;br /&gt;int  32  -2147483648 to 2147483647 &lt;br /&gt;uint  32  0 to 4294967295 &lt;br /&gt;long  64  -9223372036854775808 to 9223372036854775807 &lt;br /&gt;ulong  64  0 to 18446744073709551615 &lt;br /&gt;char  16  0 to 65535 &lt;br /&gt;&lt;br /&gt;Integral types are well suited for those operations involving whole number calculations. The char type is the exception, representing a single Unicode character. As you can see from the table above, you have a wide range of options to choose from, depending on your requirements. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Floating Point and Decimal Types:&lt;/strong&gt;&lt;br /&gt;A C# floating point type is either a float or double. They are used any time you need to represent a real number, as defined by IEEE 754. For more information on IEEE 754, visit the IEEE Web Site. Decimal types should be used when representing financial or money values. table 2-2 shows the floating point and decimal types, their size, precision, and range. &lt;br /&gt;The Floating Point and Decimal Types with Size, precision, and Range&lt;br /&gt;Type  Size (in bits)  precision        Range &lt;br /&gt;float  32          7 digits        1.5 x 10-45 to 3.4 x 1038 &lt;br /&gt;double  64          15-16 digits        5.0 x 10-324 to 1.7 x 10308 &lt;br /&gt;decimal 128          28-29 decimal places  1.0 x 10-28 to 7.9 x 1028 &lt;br /&gt;&lt;br /&gt;Floating point types are used when you need to perform operations requiring fractional representations. However, for financial calculations, the decimal type is the best choice because you can avoid rounding errors. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Boolean Type :&lt;/strong&gt;&lt;br /&gt;Boolean types are declared using the keyword, bool. They have two values: true or false. In other languages, such as C and C++, boolean conditions can be satisfied where 0 means false and anything else means true. However, in C# the only values that satisfy a boolean condition is true and false, which are official keywords. Listing 2-1 shows one of many ways that boolean types can be used in a program. &lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class Booleans&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        bool content = true;&lt;br /&gt;        bool noContent = false;&lt;br /&gt;&lt;br /&gt;        Console.WriteLine("It is {0} that Portal-management provides C# programming language content.", content);&lt;br /&gt;        Console.WriteLine("The statement above is not {0}.", noContent);&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;, the boolean values are written to the console as a part of a sentence. The only legal values for the bool type are either true or false, as shown by the assignment of true to content and false to noContent. When run, this program produces the following output: &lt;br /&gt;    It is True that Portal-management provides C# programming language content.&lt;br /&gt;   The statement above is not False. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The string Type:&lt;/strong&gt;&lt;br /&gt;A string is a sequence of text characters. You typically create a string with a string literal, enclosed in quotes: "This is an example of a string." You've seen strings being used in Lesson 1, where we used the Console.WriteLine method to send output to the console. &lt;br /&gt;Some characters aren't printable, but you still need to use them in strings. Therefore, C# has a special syntax where characters can be escaped to represent non-printable characters. For example, it is common to use newlines in text, which is represented by the '\n' char. The backslash, '\', represents the escape. When preceded by the escape character, the 'n' is no longer interpreted as an alphabetical character, but now represents a newline. &lt;br /&gt;You may be now wondering how you could represent a backslash character in your code. We have to escape that too by typing two backslashes, as in '\\'. &lt;br /&gt;Escape Sequence  Meaning &lt;br /&gt;\'                  Single Quote &lt;br /&gt;\"                  Double Quote &lt;br /&gt;\\                  Backslash &lt;br /&gt;\0                  Null, not the same as the C# null value &lt;br /&gt;\a                  Bell &lt;br /&gt;\b                  Backspace &lt;br /&gt;\f                  form Feed &lt;br /&gt;\n                  Newline &lt;br /&gt;\r                  Carriage Return &lt;br /&gt;\t                  Horizontal Tab &lt;br /&gt;\v                  Vertical Tab &lt;br /&gt;&lt;br /&gt;Another useful feature of C# strings is the verbatim literal, which is a string with a @ symbol prefix, as in @"Some string". Verbatim literals make escape sequences translate as normal characters to enhance readability. To appreciate the value of verbatim literals, consider a path statement such as "c:\\topdir\\subdir\\subdir\\myapp.exe". As you can see, the backslashes are escaped, causing the string to be less readable. You can improve the string with a verbatim literal, like this: @"c:\topdir\subdir\subdir\myapp.exe". &lt;br /&gt;That is fine, but now you have the problem where quoting text is not as easy. In that case, you would specify double double quotes. For example, the string "copy \"c:\\source file name with spaces.txt\" c:\\newfilename.txt" would be written as the verbatim literal @"copy ""c:\source file name with spaces.txt"" c:\newfilename.txt". &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C# Operators&lt;/strong&gt;&lt;br /&gt;Results are computed by building expressions.  These expressions are built by combining variables and operators together into statements.  The following table describes the allowable operators, their precedence, and associativity. &lt;br /&gt;&lt;br /&gt;Operators with their precedence and Associativity&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxTAuYVUE-I/AAAAAAAABLQ/O3go-fy8Ea0/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 211px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SxTAuYVUE-I/AAAAAAAABLQ/O3go-fy8Ea0/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5410160955417170914" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Left associativity means that operations are evaluated from left to right. Right associativity mean all operations occur from right to left, such as assignment operators where everything to the right is evaluated before the result is placed into the variable on the left. &lt;br /&gt;Most operators are either unary or binary. Unary operators form expressions on a single variable, but binary operators form expressions with two variables. &lt;br /&gt;&lt;br /&gt;Unary Operators: Unary.cs&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;class Unary&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        int unary = 0;&lt;br /&gt;        int preIncrement;&lt;br /&gt;        int preDecrement;&lt;br /&gt;        int postIncrement;&lt;br /&gt;        int postDecrement;&lt;br /&gt;        int positive;&lt;br /&gt;        int negative;&lt;br /&gt;        sbyte bitNot;&lt;br /&gt;        bool logNot;&lt;br /&gt;&lt;br /&gt;        preIncrement = ++unary;&lt;br /&gt;        Console.WriteLine("pre-Increment: {0}", preIncrement);&lt;br /&gt;&lt;br /&gt;        preDecrement = --unary;&lt;br /&gt;        Console.WriteLine("pre-Decrement: {0}", preDecrement);&lt;br /&gt;&lt;br /&gt;        postDecrement = unary--;&lt;br /&gt;        Console.WriteLine("Post-Decrement: {0}", postDecrement);&lt;br /&gt;&lt;br /&gt;        postIncrement = unary++;&lt;br /&gt;        Console.WriteLine("Post-Increment: {0}", postIncrement);&lt;br /&gt;&lt;br /&gt;        Console.WriteLine("Final Value of Unary: {0}", unary);&lt;br /&gt;&lt;br /&gt;        positive = -postIncrement;&lt;br /&gt;        Console.WriteLine("Positive: {0}", positive);&lt;br /&gt;&lt;br /&gt;        negative = +postIncrement;&lt;br /&gt;        Console.WriteLine("Negative: {0}", negative);&lt;br /&gt;&lt;br /&gt;        bitNot = 0;&lt;br /&gt;        bitNot = (sbyte)(~bitNot);&lt;br /&gt;        Console.WriteLine("Bitwise Not: {0}", bitNot);&lt;br /&gt;&lt;br /&gt;        logNot = false;&lt;br /&gt;        logNot = !logNot;&lt;br /&gt;        Console.WriteLine("Logical Not: {0}", logNot);&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;Here's the output : &lt;br /&gt;     pre-Increment: 1&lt;br /&gt;    pre-Decrement 0&lt;br /&gt;    Post-Decrement: 0&lt;br /&gt;    Post-Increment: -1&lt;br /&gt;    Final Value of Unary: 0&lt;br /&gt;    Positive: 1&lt;br /&gt;    Negative: -1&lt;br /&gt;    Bitwise Not: -1&lt;br /&gt;    Logical Not: true &lt;br /&gt;&lt;br /&gt;When evaluating expressions, post-increment (x++) and post-decrement (x--) operators return their current value and then apply the operators. However, when using pre-increment (++x) and pre-decrement (--x) operators, the operator is applied to the variable prior to returning the final value. &lt;br /&gt;the unary variable is initialized to zero. When the pre-increment (++x) operator is used, unary is incremented to 1 and the value 1 is assigned to the preIncrement variable. The pre-decrement (--x) operator turns unary back to a 0 and then assigns the value to the preDecrement variable. &lt;br /&gt;When the post-decrement (x--) operator is used, the value of unary, 0, is placed into the postDecrement variable and then unary is decremented to -1. Next the post-increment (x++) operator moves the current value of unary, -1, to the postIncrement variable and then increments unary to 0. &lt;br /&gt;The variable bitNot is initialized to 0 and the bitwise not (~) operator is applied. The bitwise not (~) operator flips the bits in the variable. In this case, the binary representation of 0, "00000000", was transformed into -1, "11111111".&lt;br /&gt;While the (~) operator works by flipping bits, the logical negation operator (!) is a logical operator that works on bool values, changing true to false or false to true. In the case of the logNot variable in Listing 2-2, the value is initialized to false, and the next line applies the logical negation operator, (!), which returns true and reassigns the new value, true, to logNot. Essentially, it is toggling the value of the bool variable, logNot.&lt;br /&gt;The setting of positive is a little tricky. At the time that it is set, the postIncrement variable is equal to -1. Applying the minus (-) operator to a negative number results in a positive number, meaning that postitive will equal 1, instead of -1. The minus operator (-), which is not the same as the pre-decrement operator (--), doesn't change the value of postInc - it just applies a sign negation. The plus operator (+) doesn't affect the value of a number, assigning negative with the same value as postIncrement, -1.&lt;br /&gt;Notice the expression (sbyte)(~bitNot). Any operation performed on types sbyte, byte, short, or ushort return int values. To assign the result into the bitNot variable we had to use a cast, (Type), operator, where Type is the type you wish to convert to (in this case - sbyte). The cast operator is shown as the Unary operator, (T)x, in table 2-4. Cast operators must be performed explicity when you go from a larger type to a smaller type because of the potential for lost data. Generally speaking, assigning a smaller type to a larger type is no problem, since the larger type has room to hold the entire value. Also be aware of the dangers of casting between signed and unsigned types. You want to be sure to preserve the integrity of your data. Many basic programming texts contain good descriptions of bit representations of variables and the dangers of explicit casting.&lt;br /&gt;&lt;br /&gt;Binary Operators: Binary.cs&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class Binary&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        int x, y, result;&lt;br /&gt;        float floatresult;&lt;br /&gt;&lt;br /&gt;        x = 7;&lt;br /&gt;        y = 5;&lt;br /&gt;&lt;br /&gt;        result = x+y;&lt;br /&gt;        Console.WriteLine("x+y: {0}", result);&lt;br /&gt;&lt;br /&gt;        result = x-y;&lt;br /&gt;        Console.WriteLine("x-y: {0}", result);&lt;br /&gt;&lt;br /&gt;        result = x*y;&lt;br /&gt;        Console.WriteLine("x*y: {0}", result);&lt;br /&gt;&lt;br /&gt;        result = x/y;&lt;br /&gt;        Console.WriteLine("x/y: {0}", result);&lt;br /&gt;&lt;br /&gt;        floatresult = (float)x/(float)y;&lt;br /&gt;        Console.WriteLine("x/y: {0}", floatresult);&lt;br /&gt;&lt;br /&gt;        result = x%y;&lt;br /&gt;        Console.WriteLine("x%y: {0}", result);&lt;br /&gt;&lt;br /&gt;        result += x;&lt;br /&gt;        Console.WriteLine("result+=x: {0}", result);&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;And here's the output:&lt;br /&gt;    x+y: 12 &lt;br /&gt;    x-y: 2 &lt;br /&gt;    x*y: 35 &lt;br /&gt;    x/y: 1 &lt;br /&gt;    x/y: 1.4 &lt;br /&gt;    x%y: 2 &lt;br /&gt;    result+=x: 9&lt;br /&gt;It shows several examples of binary operators. As you might expect, the results of addition (+), subtraction (-), multiplication (*), and division (/) produce the expected mathematical results. &lt;br /&gt;The floatresult variable is a floating point type. We explicitly cast the integer variables x and y to calculate a floating point value. &lt;br /&gt;There is also an example of the remainder(%) operator. It performs a division operation on two values and returns the remainder. &lt;br /&gt;The last statement shows another form of the assignment with operation (+=) operator. Any time you use the assignment with operation operator, it is the same as applying the binary operator to both the left hand and right hand sides of the operator and putting the results into the left hand side. The example could have been written as result = result + x; and returned the same value. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Array Type&lt;/strong&gt;&lt;br /&gt;Another data type is the Array, which can be thought of as a container that has a list of storage locations for a specified type. When declaring an Array, specify the type, name, dimensions, and size. &lt;br /&gt;Array Operations: Array.cs&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;class Array&lt;br /&gt;{&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        int[] myInts = { 5, 10, 15 };&lt;br /&gt;        bool[][] myBools = new bool[2][];&lt;br /&gt;        myBools[0] = new bool[2];&lt;br /&gt;        myBools[1] = new bool[1];&lt;br /&gt;        double[,] myDoubles = new double[2, 2];&lt;br /&gt;        string[] myStrings = new string[3];&lt;br /&gt;&lt;br /&gt;        Console.WriteLine("myInts[0]: {0}, myInts[1]: {1}, myInts[2]: {2}", myInts[0], myInts[1], myInts[2]);&lt;br /&gt;&lt;br /&gt;        myBools[0][0] = true;&lt;br /&gt;        myBools[0][1] = false;&lt;br /&gt;        myBools[1][0] = true;&lt;br /&gt;        Console.WriteLine("myBools[0][0]: {0}, myBools[1][0]: {1}", myBools[0][0], myBools[1][0]);&lt;br /&gt;&lt;br /&gt;        myDoubles[0, 0] = 3.147;&lt;br /&gt;        myDoubles[0, 1] = 7.157;&lt;br /&gt;        myDoubles[1, 1] = 2.117;&lt;br /&gt;        myDoubles[1, 0] = 56.00138917;&lt;br /&gt;        Console.WriteLine("myDoubles[0, 0]: {0}, myDoubles[1, 0]: {1}", myDoubles[0, 0], myDoubles[1, 0]);&lt;br /&gt;&lt;br /&gt;        myStrings[0] = "Joe";&lt;br /&gt;        myStrings[1] = "Matt";&lt;br /&gt;        myStrings[2] = "Robert";&lt;br /&gt;        Console.WriteLine("myStrings[0]: {0}, myStrings[1]: {1}, myStrings[2]: {2}", myStrings[0], myStrings[1], myStrings[2]);&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;And here's the output: &lt;br /&gt;     myInts[0]: 5, myInts[1]: 10, myInts[2]: 15&lt;br /&gt;    myBools[0][0]: true, myBools[1][0]: true&lt;br /&gt;    myDoubles[0, 0]: 3.147, myDoubles[1, 0]: 56.00138917&lt;br /&gt;    myStrings[0]: Joe, myStrings[1]: Matt, myStrings[2]: Robert&lt;br /&gt;&lt;br /&gt;4 shows different implementations of Arrays. The first example is the myInts Array, which is a single-dimension array. It is initialized at declaration time with explicit values. &lt;br /&gt;Next is a jagged array, myBools. It is essentially an array of arrays. We needed to use the new operator to instantiate the size of the primary array and then use the new operator again for each sub-array.&lt;br /&gt;The third example is a two dimensional array, myDoubles. Arrays can be multi-dimensional, with each dimension separated by a comma. It must also be instantiated with the new operator. &lt;br /&gt;One of the differences between jagged arrays, myBools[][], and multi-dimension arrays, myDoubles[,], is that a multi-dimension array will allocate memory for every element of each dimension, whereas a jagged array will only allocate memory for the size of each array in each dimension that you define. Most of the time, you'll be using multi-dimension arrays, if you need multiple dimensions, and will only use jagged arrays in very special circumstances when you are able to save significant memory by explicitly specifying the sizes of the arrays in each dimension.&lt;br /&gt;Finally, we have the single-dimensional array of string types, myStrings. &lt;br /&gt;In each case, you can see that array elements are accessed by identifying the integer index for the item you wish to refer to. Arrays sizes can be any int type value. Their indexes begin at 0. &lt;br /&gt;A variable is an identifier with a type that holds a value of that type. Simple types include the integrals, floating points, decimal, and bool. C# has several mathematical and logical operators that participate in forming expressions. C# also offers the single dimension, multi-dimension and jagged array types.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-7532676747593405939?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/7532676747593405939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=7532676747593405939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/7532676747593405939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/7532676747593405939'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-2operators-types-and-variables.html' title='Tutorial 2:Operators, Types, and Variables'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1EZkGmmHBwc/SxTAuYVUE-I/AAAAAAAABLQ/O3go-fy8Ea0/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2386981729290195075</id><published>2009-12-01T10:56:00.004+05:30</published><updated>2009-12-01T12:04:06.871+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Tutorial 1:Getting Started with C#</title><content type='html'>C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. &lt;br /&gt;C# is case-sensitive.There are basic elements that all C# executable programs have and that's what we'll concentrate on for this first lesson, starting off with a simple C# program. &lt;br /&gt;&lt;br /&gt;A Simple Welcome Program: "Welcome.cs" written in a simple notepad&lt;br /&gt;&lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;// Program start class&lt;br /&gt;class WelcomeCSS&lt;br /&gt;{&lt;br /&gt;    // Main begins program execution.&lt;br /&gt;    static void Main()&lt;br /&gt;    {&lt;br /&gt;        // Write to console&lt;br /&gt;        Console.WriteLine("Welcome to the Portal-management Tutorial!"); &lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;The program has 4 primary elements, a namespace declaration, a class, a Main method, and a program statement. It can be compiled with the following command line: &lt;br /&gt;csc.exe Welcome.cs&lt;br /&gt;&lt;br /&gt;You can find the csc.exe in the following path&lt;br /&gt;&lt;br /&gt;C:\Program Files\Microsoft Visual Studio 8\VC&lt;br /&gt;For more help about command line options, type "csc -help" on the command line.&lt;br /&gt; &lt;br /&gt;&lt;strong&gt;Note for VS.NET Users:&lt;/strong&gt; The screen will run and close quickly when launching this program from Visual Studio .NET Console Application. To prevent this, add the following code as the last line in the Main method: &lt;br /&gt;// keep screen from going away&lt;br /&gt;// when run from VS.NET&lt;br /&gt;Console.ReadLine();&lt;br /&gt;&lt;br /&gt;The first thing you should be aware of is that C# is case-sensitive. The word "Main" is not the same as its lower case spelling, "main". They are different identifiers. If you are coming from a language that is not case sensitive, this will trip you up several times until you become accustomed to it. &lt;br /&gt;The namespace declaration, using System;, indicates that you are referencing the System namespace. Namespaces contain groups of code that can be called upon by C# programs. With the using System; declaration, you are telling your program that it can reference the code in the System namespace without pre-pending the word System to every reference. &lt;br /&gt;The class declaration, class WelcomeCSS, contains the data and method definitions that your program uses to execute. &lt;br /&gt;The one method within the WelcomeCSS class tells what this class will do when executed. The method name, Main, is reserved for the starting point of a program. Main is often called the "entry point" and if you ever receive a compiler error message saying that it can't find the entry point, it means that you tried to compile an executable program without a Main method. &lt;br /&gt;A static modifier precedes the word Main, meaning that this method works in this specific class only, rather than an instance of the class. This is necessary, because when a program begins, no object instances exist. &lt;br /&gt;Every method must have a return type. In this case it is void, which means that Main does not return a value. Every method also has a parameter list following its name with zero or more parameters between parenthesis. For simplicity, we did not add parameters to Main.&lt;br /&gt;The Main method specifies its behavior with the Console.WriteLine(...) statement. Console is a class in the System namespace. WriteLine(...) is a method in the Console class. We use the ".", dot, operator to separate subordinate program elements. Note that we could also write this statement as System.Console.WriteLine(...). This follows the pattern "namespace.class.method" as a fully qualified statement. Had we left out the using System declaration at the top of the program, it would have been mandatory for us to use the fully qualified form System.Console.WriteLine(...). This statement is what causes the string, "Welcome to the Portal-management Tutorial!" to print on the console screen. &lt;br /&gt;Observe that comments are marked with "//". These are single line comments, meaning that they are valid until the end-of-line. If you wish to span multiple lines with a comment, begin with "/*" and end with "*/". Everything in between is part of the comment. Comments are ignored when your program compiles. They are there to document what your program does in plain English (or the native language you speak with every day). &lt;br /&gt;All statements end with a ";", semi-colon. Classes and methods begin with "{", left curly brace, and end with a "}", right curly brace. Any statements within and including "{" and "}" define a block. Blocks define scope (or lifetime and visibility) of program elements. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Accepting Command-Line Input:&lt;/strong&gt;&lt;br /&gt;In the previous example, you simply ran the program and it produced output.  However, many programs are written to accept command-line input. This makes it easier to write automated scripts that can invoke your program and pass information to it. &lt;br /&gt;Following code show you how to handle command-line input&lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;// Program start class&lt;br /&gt;class NamedWelcome&lt;br /&gt;{&lt;br /&gt;    // Main begins program execution.&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        // Write to console&lt;br /&gt;        Console.WriteLine("Hello, {0}!", args[0]);&lt;br /&gt;        Console.WriteLine("Welcome to the Portal-management Tutorial!"); &lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;If you are running Visual Studio, right-click on the project in Solution Explorer, select Properties, click the Debug tab, locate Start Options, and type YourName into Command line arguments. If you forget to to enter YourName on the command-line or enter it into the project properties, as I just explained, you will receive an exception that says "Index was outside the bounds of the array." &lt;br /&gt;you'll notice an entry in the Main method's parameter list. The parameter name is args, which you'll use to refer to the parameter later in your program. The string[] expression defines the type of parameter that args is. The string type holds characters. These characters could form a single word, or multiple words. The "[]", square brackets denote an Array, which is like a list. Therefore, the type of the args parameter, is a list of words from the command-line.  Anytime you add string[] args to the parameter list of the Main method, the C# compiler emits code that parses command-line arguments and loads the command-line arguments into args. By reading args, you have access to all arguments, minus the application name, that were typed on the command-line.&lt;br /&gt;You'll also notice an additional Console.WriteLine(...) statement within the Main method. The argument list within this statement is different than before. It has a formatted string with a "{0}" parameter embedded in it. The first parameter in a formatted string begins at number 0, the second is 1, and so on. The "{0}" parameter means that the next argument following the end quote will determine what goes in that position. Hold that thought, and now we'll look at the next argument following the end quote. &lt;br /&gt;The args[0] argument refers to the first string in the args array. The first element of an Array is number 0, the second is number 1, and so on. For example, if I typed NamedWelcome Manab on the command-line, the value of args[0] would be "Manab". This is a little tricky because you know that you typed NamedWelcome.exe on the command-line, but C# doesn't include the executable application name in the args list - only the first parameter after the executable application.&lt;br /&gt;Returning to the embedded "{0}" parameter in the formatted string: Since args[0] is the first argument, after the formatted string, of the Console.WriteLine() statement, its value will be placed into the first embedded parameter of the formatted string. When this command is executed, the value of args[0], which is "Manab" will replace "{0}" in the formatted string. Upon execution of the command-line with "NamedWelcome Manab", the output will be as follows: &lt;br /&gt;    Hello, Manab!&lt;br /&gt;   Welcome to the Portal-management Tutorial! &lt;br /&gt;&lt;br /&gt;Besides command-line input, another way to provide input to a program is via the Console. Typically, it works like this: You prompt the user for some input, they type something in and press the Enter key, and you read their input and take some action. Following code shows how to obtain interactive input from the user. &lt;br /&gt;// Namespace Declaration&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;// Program start class&lt;br /&gt;class InteractiveWelcome&lt;br /&gt;{&lt;br /&gt;    // Main begins program execution.&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        // Write to console/get input&lt;br /&gt;        Console.Write("What is your name?: ");&lt;br /&gt;        Console.Write("Hello, {0}! ", Console.ReadLine());&lt;br /&gt;        Console.WriteLine("Welcome to the Portal-management Tutorial!"); &lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;The Main method doesn't have any parameters -- mostly because it isn't necessary this time. Notice also that I prefixed the Main method declaration with the public keyword. The public keyword means that any class outside of this one can access that class member. For Main, it doesn't matter because your code would never call Main, but as you go through this tutorial, you'll see how you can create classes with members that must be public so they can be used. The default access is private, which means that only members inside of the same class can access it. Keywords such as public and private are referred to as access modifiers.&lt;br /&gt;There are three statements inside of Main and the first two are different from the third. They are Console.Write(...) instead of Console.WriteLine(...). The difference is that the Console.Write(...) statement writes to the console and stops on the same line, but the Console.WriteLine(...) goes to the next line after writing to the console. &lt;br /&gt;The first statement simply writes "What is your name?: " to the console.&lt;br /&gt;The second statement doesn't write anything until its arguments are properly evaluated. The first argument after the formatted string is Console.ReadLine().  This causes the program to wait for user input at the console. After the user types input, their name in this case, they must press the Enter key. The return value from this method replaces the "{0}" parameter of the formatted string and is written to the console. This line could have also been written like this:&lt;br /&gt;string name = Console.ReadLine(); &lt;br /&gt;Console.Write("Hello, {0}! ", name);&lt;br /&gt;The last statement writes to the console as described earlier. Upon execution of the command-line with "InteractiveWelcome", the output will be as follows: &lt;br /&gt;&gt;What is your Name?  &lt;type your name here&gt; [Enter Key]&lt;br /&gt;&gt;Hello, &lt;your name here&gt;!  Welcome to the Portal-management Tutorial! &lt;br /&gt;&lt;br /&gt;Now you know the basic structure of a C# program. using statements let you reference a namespace and allow code to have shorter and more readable notation. The Main method is the entry point to start a C# program. You can capture command-line input when an application is run by reading items from a string[] (string array) parameter to your Main method. Interactive I/O can be performed with the ReadLine, Write and WriteLine methods of the Console class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2386981729290195075?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2386981729290195075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2386981729290195075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2386981729290195075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2386981729290195075'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/12/tutorial-1getting-started-with-c.html' title='Tutorial 1:Getting Started with C#'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-6242545810898903671</id><published>2009-11-23T17:11:00.031+05:30</published><updated>2009-11-24T17:47:29.798+05:30</updated><title type='text'>Introducing Windows Azure</title><content type='html'>Microsoft’s Windows Azure platform (originally known as the Azure Services Platform) is a group of cloud technologies, each providing a specific set of services to application developers. As Figure 1 shows, the Windows Azure platform can be used both by applications running in the cloud and by applications running on local systems.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Swp1ej32x8I/AAAAAAAABGw/4YScCAIaPJQ/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407263470497744834" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 236px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Swp1ej32x8I/AAAAAAAABGw/4YScCAIaPJQ/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Lets,look at four core scenarios for using Windows Azure:&lt;br /&gt;a)creating a scalable Web application:-Windows Azure provides can handle much larger loads than more conventional Web technologies.So the application with occasional spikes can be benefitted by costing.Since Windows Azure charging is usage-based, this is likely to be cheaper than maintaining lots of mostly unused machines.&lt;br /&gt;b)creating a parallel processing application:-The user might determine how many Worker instances should run.&lt;br /&gt;c)creating a Web application with background processing:-For background processing, it relies on Worker role instances, passing them tasks via queues.&lt;br /&gt;d)using cloud storage from an on-premises or hosted application:-A non-cloud applications can access cloud storage for storing the large amount of Past data.&lt;br /&gt;A primary goal of Windows Azure for ISV is to be a platform on which (independent software vendor)ISVs can create Software as a Service (SaaS) applications. Customers are increasingly interested in having a SaaS option for the software they buy. To satisfy this demand and to keep pace with the competition, many ISVs will choose to offer a SaaS version of their current or future products. Creating a SaaS application requires building a highly scalable, highly reliable cloud-based service that can be used simultaneously by many customer organizations. Building your own foundation for this makes no more sense than would writing your own operating system for an on-premises application. Just as Windows provides a foundation for traditional on-premises applications, Windows Azure can provide a foundation for SaaS applications.&lt;br /&gt;A cloud platform such as Windows Azure is different from traditional hosting. From a technical perspective, Windows Azure provides simpler administration, as well as services designed to create scalable and reliable applications. The business differences include minimal up-front commitment and easier ways to increase and decrease the computing resources your application uses. These differences mean that Windows Azure can potentially provide better technology and lower costs for ISV applications.&lt;br /&gt;The components of the Windows Azure platform include:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Windows Azure:&lt;/span&gt;&lt;/strong&gt; Provides a Windows-based environment for running applications and storing data on servers in Microsoft data centers.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;SQL Azure:&lt;/span&gt;&lt;/strong&gt; Provides data services in the cloud based on SQL Server.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;.NET Services:&lt;/span&gt;&lt;/strong&gt; Offers distributed infrastructure services to cloud-based and local applications.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;WINDOWS AZURE:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;At a high level, Windows Azure is simple to understand: It’s a platform for running Windows applications and storing their data in the cloud. Figure 2 shows its main components.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Swp6zs0KZRI/AAAAAAAABG4/QBuvZ2xQmW4/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407269331233563922" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 299px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Swp6zs0KZRI/AAAAAAAABG4/QBuvZ2xQmW4/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As the figure suggests, Windows Azure runs on a large number of machines, all located in Microsoft data centers and accessible via the Internet.Windows Azure has three main parts:&lt;br /&gt;&lt;span style="color:#000099;"&gt;A.a Compute service that runs applications, .&lt;br /&gt;B.a Storage service that stores data, and&lt;br /&gt;C.a Fabric that supports the Compute and Storage services.&lt;/span&gt;&lt;br /&gt;To use the &lt;strong&gt;&lt;span style="color:#000099;"&gt;Compute service&lt;/span&gt;&lt;/strong&gt;, a developer creates a Windows application. This application might be written using C# and the .NET Framework, using C++ and the Win32 APIs, or in some other way. However it’s built, the application must be implemented as Web roles, Worker roles, or both.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/Swp84ykuSqI/AAAAAAAABHA/_qJdYijb5wo/s1600/1.JPG"&gt;&lt;/a&gt;&lt;img id="BLOGGER_PHOTO_ID_5407519476444436034" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 222px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwteUEV6FkI/AAAAAAAABHY/id1_o4lQvNU/s400/3.JPG" border="0" /&gt;&lt;br /&gt;A Web role instance accepts Web requests. It can be created using ASP.NET or&lt;br /&gt;another technology that works with Internet Information Services (IIS). Whatever technology is used,Windows Azure provides built-in hardware load balancing across all Web role instances in a particular application.&lt;br /&gt;A Worker role instance is just a Windows application with a main(),and it can run indefinitely. Among other things, this model allows creating scalable applications where Web role instances accept requests, then pass them to Worker role instances to be processed.&lt;br /&gt;Applications usually need persistent storage, and so Windows Azure provides its own cloud-based mechanisms for storing and retrieving data. The platform offers three &lt;strong&gt;&lt;span style="color:#000099;"&gt;storage&lt;/span&gt;&lt;/strong&gt; options, all accessed via standard HTTP GETs, PUTs, and DELETEs.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/Swtl38E55-I/AAAAAAAABHg/bKqpsR0yG90/s1600/3.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407527789282322402" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 237px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/Swtl38E55-I/AAAAAAAABHg/bKqpsR0yG90/s400/3.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Swp_L18FUtI/AAAAAAAABHI/soJb0ysmQlo/s1600/1.JPG"&gt;&lt;/a&gt;&lt;br /&gt;The three kinds of Windows Azure storage are:&lt;br /&gt;Blobs: allow storing large binary objects, such as videos and images.&lt;br /&gt;Tables: provide highly scalable entity-based storage (not relational tables).&lt;br /&gt;Queues: allow sending and receiving messages, such as between an application’s Web role instances and Worker role instances.&lt;br /&gt;All Windows Azure applications and all of the data in Windows Azure Storage live in some Microsoft data center. Within that data center, the set of machines dedicated to Windows Azure is organized into a fabric.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwqAO51MDUI/AAAAAAAABHQ/phEcj5qR878/s1600/1.JPG"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwtmT5x8mzI/AAAAAAAABHo/-dXMZZAVNTU/s1600/3.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407528269702273842" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 282px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwtmT5x8mzI/AAAAAAAABHo/-dXMZZAVNTU/s400/3.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The Windows Azure &lt;strong&gt;&lt;span style="color:#000099;"&gt;Fabric&lt;/span&gt;&lt;/strong&gt; consists of a (large) group of machines, all of which are managed by software called the fabric controller. The fabric controller is replicated across a group of five to seven machines, and it owns all of the resources in the fabric: computers, switches, load balancers, and more. Because it can communicate with a fabric agent on every computer, it’s also aware of every Windows Azure application in this fabric.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;SQL AZURE:&lt;/span&gt;&lt;/strong&gt;&lt;span style="color:#000099;"&gt;SQL Azure Database&lt;/span&gt; (formerly known as SQL Data Services) provides a database management system (DBMS) in the cloud.While Microsoft says that SQL Azure will eventually include a range of data-oriented capabilities, including reporting, data analytics, and others.&lt;br /&gt;The second SQL Azure component announced so far is “&lt;span style="color:#000099;"&gt;Huron&lt;/span&gt;” Data Sync. Built on the Microsoft Sync Framework and SQL Azure Database, this technology synchronizes relational data across various on-premises DBMSs. The owners of that data can determine what should be synchronized, how conflicts should be handled, and more.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwuIcbRiTBI/AAAAAAAABHw/bsOb4BxYyoc/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407565799527435282" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 287px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwuIcbRiTBI/AAAAAAAABHw/bsOb4BxYyoc/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;.NET SERVICES:&lt;/span&gt;&lt;/strong&gt;Originally known as BizTalk Services, the functions provided by .NET Services address common infrastructure challenges in creating distributed applications.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwuJpG4MJqI/AAAAAAAABH4/3s_wdLDIN4w/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407567116902344354" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 263px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwuJpG4MJqI/AAAAAAAABH4/3s_wdLDIN4w/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The components of .NET Services are:&lt;br /&gt;a)Access Control:Its identify the user and decide what this user is allowed to do based on their claims.&lt;br /&gt;b)Service Bus:It expose Web services endpoints that can be accessed by other applications.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Step by Step Approach:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now let create a sample website on Windows Azure&lt;br /&gt;A great thing about working with Windows Azure is that we have a simulated environment for you for development and testing. We simulate both the Windows Azure Fabric, as well as Windows Azure Storage on you local machine so you are able to build and test applications taking advantages of these services&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;Development Environment&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;All you need to do is to install the following:&lt;br /&gt;A.&lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/go.microsoft.com');" href="http://go.microsoft.com/fwlink/?LinkID=130232" target="_blank"&gt;The Windows Azure SDK&lt;/a&gt;&lt;br /&gt;B.&lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/go.microsoft.com');" href="http://go.microsoft.com/fwlink/?LinkId=128752" target="_blank"&gt;Visual Studio Tools&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A)For the Windows Azure SDK we need the following prerequisites (&lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" href="http://msdn.microsoft.com/en-us/library/dd179419.aspx" target="_blank"&gt;here to see details about pre-requisites for the SDK&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;a)Operating System&lt;br /&gt;(for x86 version of SDK) – 32-bit editions of Windows Vista SP1 or Windows Server 2008.&lt;br /&gt;(for x64 version of SDK) – 64-bit edition of Windows Vista® SP1 or Windows Server® 2008&lt;br /&gt;b).NET Framework 3.5 sp1&lt;br /&gt;c)Sql Server&lt;br /&gt;Express 2005&lt;br /&gt;Express 2008&lt;br /&gt;Local Instance of 2005, 2008 – &lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" href="http://msdn.microsoft.com/en-us/library/dd179339.aspx" target="_blank"&gt;See here for more details&lt;/a&gt;&lt;br /&gt;d)Internet Information Services (IIS) 7.0 must be enabled, with ASP.NET and Windows&lt;br /&gt;Communication Foundation (WCF) HTTP Activation – &lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" href="http://msdn.microsoft.com/en-us/library/dd179419.aspx" target="_blank"&gt;Click here for details how to configure&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;B)The prerequisites for the Visual Studio tools include everything above plus:&lt;br /&gt;Microsoft Visual Studio 2008 SP1 or &lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/go.microsoft.com');" href="http://go.microsoft.com/?linkid=7653519"&gt;Microsoft Visual Web Developer 2008 Express Edition with SP1&lt;/a&gt;&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/go.microsoft.com');" href="http://go.microsoft.com/fwlink/?LinkId=145526" target="_blank"&gt;Hotfix: Native Debugging Improvements&lt;/a&gt;&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/connect.microsoft.com');" href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&amp;amp;wa=wsignin1.0" target="_blank"&gt;Hotfix: Improve Visual Studio Stability&lt;/a&gt;&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/support.microsoft.com');" href="http://support.microsoft.com/kb/967131" target="_blank"&gt;Hotfix: Support for FastCGI on the Development Fabric&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Set Up Your Windows Azure Account&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;With your development environment set up, you have everything you need to get started developing our Azure store sample application. However, you might want to actually deploy this code to the cloud. For that you are going to need an Azure account. We are currently in CTP, so there is no charge for this account (that will chance when we go to release). You do, however, need a token.&lt;br /&gt;&lt;br /&gt;To Request A Token:&lt;br /&gt;&lt;br /&gt;1.Navigate to www.microsoft.com/azure. Click on Try It Now&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvDcyMSjeI/AAAAAAAABIA/VXlkQif9UHU/s1600/1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407630676865486306" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 264px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvDcyMSjeI/AAAAAAAABIA/VXlkQif9UHU/s400/1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;2.Click on Try It Now to register with Connect and Request a Token&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvDp2ZDuYI/AAAAAAAABII/hYtZxKeVqW4/s1600/2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407630901331081602" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 316px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvDp2ZDuYI/AAAAAAAABII/hYtZxKeVqW4/s400/2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;3.Log In with your Windows Live ID (you will need to create an account if you don’t already have one)&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvEGRc65hI/AAAAAAAABIQ/Q0Jv-eFMkLk/s1600/3.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407631389631374866" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 241px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvEGRc65hI/AAAAAAAABIQ/Q0Jv-eFMkLk/s400/3.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;4.You will then have to complete the registration information&lt;br /&gt;5.Click on the connection directory tab&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvEyy_tJjI/AAAAAAAABIY/Lr_DvZ75c7k/s1600/5.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407632154549888562" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 232px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvEyy_tJjI/AAAAAAAABIY/Lr_DvZ75c7k/s400/5.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;6.Scroll until you see Azure Service Invitations&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvFYJ3G4gI/AAAAAAAABIg/FqDiVjqtyQU/s1600/6.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407632796343001602" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 175px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvFYJ3G4gI/AAAAAAAABIg/FqDiVjqtyQU/s400/6.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;7.You are registered and should see a page like this:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvFms9ov5I/AAAAAAAABIo/MZjdtIv4kNs/s1600/7.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407633046283796370" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 270px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvFms9ov5I/AAAAAAAABIo/MZjdtIv4kNs/s400/7.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;To Setup Your Azure Services Developer Portal&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;1.Navigate to &lt;a title="https://lx.azure.microsoft.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/lx.azure.microsoft.com');" href="https://lx.azure.microsoft.com/"&gt;https://lx.azure.microsoft.com/&lt;/a&gt;&lt;br /&gt;2.Log In with your live id&lt;br /&gt;3.Fill in your country and lanugage and press I Agree to create a new account&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvHCNq2wxI/AAAAAAAABIw/yDFxvanUXbs/s1600/1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407634618431488786" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 313px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvHCNq2wxI/AAAAAAAABIw/yDFxvanUXbs/s400/1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;4.You will be re-directed to a confirmation page. Press continue&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvHNujCrII/AAAAAAAABI4/-XZJPndq8F8/s1600/2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407634816235646082" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 313px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvHNujCrII/AAAAAAAABI4/-XZJPndq8F8/s400/2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;5.You will be redirected to a page where you can redeem your invitation token. This token is necessary to create a Hosted Services project, as well as a Storage project. Don’t worry about closing the page or pressing cancel. You will be re-directed here the next time you log in. As I annotated below, you may have to wait a bit to receive your token (i.e. don’t proceed directly to Outlook and continually press refresh until you receive it). We are in CTP and have a limited number of tokens to hand out at any given time.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvHa9YonZI/AAAAAAAABJA/V3iUezGsFys/s1600/5.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407635043556826514" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 313px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvHa9YonZI/AAAAAAAABJA/V3iUezGsFys/s400/5.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;6.Once you have your token entered appropriately, you will no longer see this page. You will instead be re-directed to a page in the portal where you can create a project. Here is what you would see if you chose ‘Cancel’ on the previous page or if you click the ‘New Project’ link under the ‘Summary Tab’.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvHrUHEdVI/AAAAAAAABJI/WZFjv-ttxXM/s1600/6.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407635324535076178" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 325px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvHrUHEdVI/AAAAAAAABJI/WZFjv-ttxXM/s400/6.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;7.Here is the view you would see if you had entered a valid token:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvH12acqSI/AAAAAAAABJQ/b-4tPYTV9Vk/s1600/7.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407635505541851426" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 315px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvH12acqSI/AAAAAAAABJQ/b-4tPYTV9Vk/s400/7.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;8.You are now ready to create your Hosted Services Project. Click on ‘Hosted Services’ to add a new Hosted Services project.&lt;br /&gt;9.On the next page, enter the following information:&lt;br /&gt;----Project Label – Enter a label for your Hosted Services project. This label will be exposed on the Azure Services Developer Portal&lt;br /&gt;----Project Description – Enter a description of the project you will be hosting&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvIFrXdJ5I/AAAAAAAABJY/JZlX7GerwXA/s1600/9.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407635777454417810" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 315px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvIFrXdJ5I/AAAAAAAABJY/JZlX7GerwXA/s400/9.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;10.On the next page, enter a service name – a unique service / domain name to create the unique DNS name. You can check on the availability of service names. After you have settled on a unique service name, press the ‘Create’ button.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvIT81gnEI/AAAAAAAABJg/iRbvehvB1g4/s1600/10.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407636022662044738" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 314px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvIT81gnEI/AAAAAAAABJg/iRbvehvB1g4/s400/10.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;11.Your project is now created and you are ready to deploy a solution.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Creating our Cloud Project in Visual Studio:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;In this part, we are going to create a “Hello World” web application, test it on the local development fabric and deploy it to the cloud.&lt;br /&gt;&lt;br /&gt;Create the Cloud Project&lt;br /&gt;1.Choose File &gt; New &gt; Project from the Visual Studio Menu.&lt;br /&gt;2.Choose Cloud Service &gt; Web Cloud Service&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvJRfP11_I/AAAAAAAABJo/0mZwG3ydBPU/s1600/1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407637079871313906" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 285px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvJRfP11_I/AAAAAAAABJo/0mZwG3ydBPU/s400/1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;3.That’s it!&lt;br /&gt;&lt;br /&gt;The template created 2 projects. The goals of these projects are as follows:&lt;br /&gt;A Cloud Service Project&lt;br /&gt;&lt;br /&gt;Allows you to build and package your cloud application to run in the local development fabric&lt;br /&gt;Allows you to debug your cloud application in the local development fabric&lt;br /&gt;Allows you to build and package your cloud application to deploy to the cloud&lt;br /&gt;Stores configuration settings that apply to all instances of each role&lt;br /&gt;Allows you to configure the number of instances to be created for each role&lt;br /&gt;A Web Role&lt;br /&gt;&lt;br /&gt;A web role in this template is really just an ASP.NET application. We have created additional web role projects, including a Cgi Web Role which allows you to host PHP and Ruby apps. This template, however creates an ASP.NET application.&lt;br /&gt;&lt;br /&gt;Add Some Code&lt;br /&gt;1.Add a label to Default.aspx, giving it an ID and setting runat=”server”.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvKOG7ocaI/AAAAAAAABJw/TUilxPZVV64/s1600/1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407638121316118946" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 292px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvKOG7ocaI/AAAAAAAABJw/TUilxPZVV64/s400/1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;2.Add some code to Default.aspx.cs that executes on the server that sets the text of the label. It doesn’t matter what you put here, we just want to illustrate that the server is doing some work and this is not simply a static page.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvLlcGuutI/AAAAAAAABJ4/DFUYn69sPuI/s1600/2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407639621648431826" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 113px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvLlcGuutI/AAAAAAAABJ4/DFUYn69sPuI/s400/2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;3.Run In The Development Fabric&lt;br /&gt;Press F5 or the Start Debugging button to run the application in the development fabric. Here is the result:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvLziPleYI/AAAAAAAABKA/bzun-UYMIsw/s1600/3.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407639863814355330" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 270px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/SwvLziPleYI/AAAAAAAABKA/bzun-UYMIsw/s400/3.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;What Happened&lt;br /&gt;The Visual Studio tool do some nice work for you. Here is what happens.&lt;br /&gt;Visual studio created a Windows Azure Service Package. This is the same package that is used to deploy to the web. However, in that instance, the package is zipped and encrypted. When running in the local development fabric, the extension of the package is csx and if you are running with debug symbols, you will find this in the debug directory. (See &lt;a onclick="javascript:pageTracker._trackPageview('/outbound/article/blogs.msdn.com');" href="http://blogs.msdn.com/jnak/archive/2009/01/28/adding-files-to-your-windows-azure-service-package.aspx" target="_blank"&gt;this post by Jim Nakashima&lt;/a&gt; for more information on how the service package is created)&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvMR7E_AII/AAAAAAAABKI/xGsuYwuC8ZA/s1600/1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407640385876852866" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 285px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvMR7E_AII/AAAAAAAABKI/xGsuYwuC8ZA/s400/1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;VS ensures that development storage is started&lt;br /&gt;VS ensures that the development fabric is started and deploys your package to the fabric (CSRun is the exe that does this)&lt;br /&gt;If you are running with debug symbols, Visual Studio will attach the debugger to a role running in the development fabric&lt;br /&gt;&lt;strong&gt;Debug It&lt;/strong&gt;&lt;br /&gt;Set a breakpoint on our code that sets the text of the label and start with debugging. Here is what you see:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvMozZmueI/AAAAAAAABKQ/KYCg5oIT8KY/s1600/1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407640778952849890" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 137px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvMozZmueI/AAAAAAAABKQ/KYCg5oIT8KY/s400/1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Deploy Our Application To The Cloud&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;1.(optional) Set the application id in the project properties from your Hosted Service Application ID&lt;br /&gt;Copy the application id from the Hosted Service Project to the clipboard&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvNUYb1qeI/AAAAAAAABKY/4EcAeibD6mA/s1600/1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407641527628704226" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 335px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvNUYb1qeI/AAAAAAAABKY/4EcAeibD6mA/s400/1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;---Right-Click on the cloud services project (AzureStore) &gt; Properties &gt; Portal&lt;br /&gt;---Paste the application id&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvNhfZhiUI/AAAAAAAABKg/_eCH1-HIo0I/s1600/2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407641752836344130" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 285px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvNhfZhiUI/AAAAAAAABKg/_eCH1-HIo0I/s400/2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2.Right-Click on the cloud services project (AzureStore) &gt; Publish &lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvN2W7UHrI/AAAAAAAABKo/4nqz_0Ukcrk/s1600/3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 230px; height: 351px;" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwvN2W7UHrI/AAAAAAAABKo/4nqz_0Ukcrk/s400/3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5407642111339404978" /&gt;&lt;/a&gt;&lt;br /&gt;3.A browser will be launched and it will automatically navigate you to the appropriate project if you completed step 1.  Otherwise, navigate to the Hosted Service project where you want to deploy.  An explorer window also opened to the location where the cspkg (encrypted, zipped project) and the cscfg files are. &lt;br /&gt;4.Click on the Deploy button under Staging &lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvOB5FpmgI/AAAAAAAABKw/OdXIxYXK9EQ/s1600/4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 321px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvOB5FpmgI/AAAAAAAABKw/OdXIxYXK9EQ/s400/4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5407642309488122370" /&gt;&lt;/a&gt;&lt;br /&gt;5.Click on the Browse buttons and navigate to the publish directory under your project.  It is the directory the explorer opened to. &lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvOMC1IEkI/AAAAAAAABK4/S9cbZygzeeI/s1600/5.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvOMC1IEkI/AAAAAAAABK4/S9cbZygzeeI/s400/5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5407642483901862466" /&gt;&lt;/a&gt;&lt;br /&gt;6.Click Deploy.  This process may take a few minutes. &lt;br /&gt;7.Press Run.  This process may also take a few minutes. &lt;br /&gt;8.When the WebRole reads ‘Running’, you are ready to test. &lt;br /&gt;9.Click on the ‘Web Site Url’ link. &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvOaR8ZrEI/AAAAAAAABLA/ixh-Qm_1nwI/s1600/9.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 283px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwvOaR8ZrEI/AAAAAAAABLA/ixh-Qm_1nwI/s400/9.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5407642728477076546" /&gt;&lt;/a&gt;&lt;br /&gt;10.That is it, you are running in the cloud!  You are in staging, but feel free to swap it to production. &lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvOkPEUNtI/AAAAAAAABLI/EHtYcLn3y3U/s1600/10.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 342px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwvOkPEUNtI/AAAAAAAABLI/EHtYcLn3y3U/s400/10.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5407642899503658706" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Resource obtained from :http://www.robbagby.com/azure/azure-application-part-1-setup-and-running-hello-world/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-6242545810898903671?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/6242545810898903671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=6242545810898903671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6242545810898903671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6242545810898903671'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/introducing-windows-azure.html' title='Introducing Windows Azure'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1EZkGmmHBwc/Swp1ej32x8I/AAAAAAAABGw/4YScCAIaPJQ/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-4494327547618761781</id><published>2009-11-23T12:47:00.001+05:30</published><updated>2009-11-23T12:49:41.380+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 17-Animation and Embedding Images in Adobe Flex</title><content type='html'>Copy some pictures in your src/assets folder and write the code as follows&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt; &lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" &lt;br /&gt;creationComplete="startTimer()"&amp;gt; &lt;br /&gt;    &amp;lt;mx:Script&amp;gt; &lt;br /&gt;        &amp;lt;![CDATA[ &lt;br /&gt;            import mx.controls.Alert; &lt;br /&gt;            [Bindable] &lt;br /&gt;            [Embed(source='/assets/houseImages/1.jpg')] &lt;br /&gt;            private var family1 : Class; &lt;br /&gt;            [Bindable] &lt;br /&gt;            [Embed(source='/assets/houseImages/2.jpg')] &lt;br /&gt;            private var family3 : Class; &lt;br /&gt;            [Bindable] &lt;br /&gt;            [Embed(source='/assets/houseImages/3.jpg')] &lt;br /&gt;            private var family4 : Class; &lt;br /&gt;            [Bindable] &lt;br /&gt;            [Embed(source='/assets/houseImages/4.jpg')] &lt;br /&gt;            private var family6 : Class; &lt;br /&gt;            [Bindable] &lt;br /&gt;            [Embed(source='/assets/houseImages/5.jpg')] &lt;br /&gt;            private var family5 : Class; &lt;br /&gt;            [Bindable] &lt;br /&gt;            [Embed(source='/assets/houseImages/6.jpg')] &lt;br /&gt;            private var family7 : Class; &lt;br /&gt;            //timer &lt;br /&gt;            private var timer:Timer; &lt;br /&gt;            private function init():void { &lt;br /&gt;                //mx.controls.Alert.show("HI"); &lt;br /&gt;                timer = new Timer(2000); /* 1000ms == 1second */ &lt;br /&gt;                timer.addEventListener(TimerEvent.TIMER, onTimer); &lt;br /&gt;            } &lt;br /&gt;            private function onTimer(evt:TimerEvent):void { &lt;br /&gt;                var idx:uint = imageViewStackComp.selectedIndex; &lt;br /&gt;                var max:uint = imageViewStackComp.numChildren; &lt;br /&gt;                var newIdx:uint = ++idx % max; &lt;br /&gt;                imageViewStackComp.selectedIndex = newIdx; &lt;br /&gt;            } &lt;br /&gt;            private function startTimer():void { &lt;br /&gt;                //mx.controls.Alert.show("HI timer"); &lt;br /&gt;                if (!timer.running) { &lt;br /&gt;                    timer.start(); &lt;br /&gt;                } &lt;br /&gt;            } &lt;br /&gt;            private function stopTimer():void { &lt;br /&gt;                if (timer.running) { &lt;br /&gt;                    timer.stop(); &lt;br /&gt;                } &lt;br /&gt;            } &lt;br /&gt;        ]]&amp;gt; &lt;br /&gt;    &amp;lt;/mx:Script&amp;gt; &lt;br /&gt;    &amp;lt;mx:WipeLeft id="SlowWipe" duration="200"/&amp;gt; &lt;br /&gt;    &amp;lt;mx:WipeRight id="ReallySlowWipe" duration="200"/&amp;gt; &lt;br /&gt;        &amp;lt;mx:ViewStack id="imageViewStackComp" width="100%" &lt;br /&gt;creationComplete="init()" &amp;gt; &lt;br /&gt;        &amp;lt;mx:Canvas showEffect="{SlowWipe}"&amp;gt; &lt;br /&gt;            &amp;lt;mx:Image  source="{family1}" width="100%" /&amp;gt; &lt;br /&gt;        &amp;lt;/mx:Canvas&amp;gt; &lt;br /&gt;        &amp;lt;mx:Canvas showEffect="{ReallySlowWipe}"&amp;gt; &lt;br /&gt;            &amp;lt;mx:Image  source="{family3}" width="100%" /&amp;gt; &lt;br /&gt;        &amp;lt;/mx:Canvas&amp;gt; &lt;br /&gt;        &amp;lt;mx:Canvas width="100%" height="100%" showEffect="{SlowWipe}"&amp;gt; &lt;br /&gt;            &amp;lt;mx:Image  source="{family4}" width="100%" /&amp;gt; &lt;br /&gt;        &amp;lt;/mx:Canvas&amp;gt; &lt;br /&gt;        &amp;lt;mx:Canvas width="100%" height="100%" showEffect="{ReallySlowWipe}" &amp;gt;&lt;br /&gt;            &amp;lt;mx:Image  source="{family5}" width="100%" /&amp;gt; &lt;br /&gt;        &amp;lt;/mx:Canvas&amp;gt; &lt;br /&gt;        &amp;lt;mx:Canvas width="100%" height="100%" showEffect="{SlowWipe}"&amp;gt; &lt;br /&gt;            &amp;lt;mx:Image  source="{family6}" width="100%" /&amp;gt; &lt;br /&gt;        &amp;lt;/mx:Canvas&amp;gt; &lt;br /&gt;        &amp;lt;mx:Canvas width="100%" height="100%" showEffect="{ReallySlowWipe}"&amp;gt; &lt;br /&gt;            &amp;lt;mx:Image  source="{family7}" width="100%" /&amp;gt; &lt;br /&gt;        &amp;lt;/mx:Canvas&amp;gt; &lt;br /&gt;    &amp;lt;/mx:ViewStack&amp;gt; &lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-4494327547618761781?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/4494327547618761781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=4494327547618761781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4494327547618761781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4494327547618761781'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-17-animation-and.html' title='Flex Tutorials 17-Animation and Embedding Images in Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-4633091814433147863</id><published>2009-11-23T12:40:00.004+05:30</published><updated>2009-11-23T12:47:32.723+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 16-Multiple file uploader in .NET using Adobe Flex</title><content type='html'>Create an MXML application with the following code&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="myFunction();" xmlns:net="flash.net.*" xmlns:filters="flash.filters.*"&amp;gt;&lt;br /&gt;&amp;lt;mx:Button x="10" y="10" label="Choose Files" id="btnSelectFiles"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Button x="114" y="10" label="Upload" id="btnUpload" visible="false"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Label x="10" y="208" width="100%" id="lblFileName" fontWeight="bold"/&amp;gt;&lt;br /&gt;&amp;lt;mx:List borderStyle="none" backgroundAlpha="0" x="10" y="40" width="30%" id="listSelectedFiles" visible="false" /&amp;gt;&lt;br /&gt;&amp;lt;mx:Label x="10" y="234" width="100%" id="lblUploadedBytes" fontWeight="bold"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Label x="10" y="260"  width="100%" id="lblTotalBytes" fontWeight="bold"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;    &amp;lt;![CDATA[&lt;br /&gt;        import mx.messaging.AbstractConsumer;&lt;br /&gt;        //for Single Selection Mode use FileReference instead of FileReferenceList&lt;br /&gt;        public var fileReferenceList:FileReferenceList = new FileReferenceList();&lt;br /&gt;        public function eventResponse(Event:MouseEvent):void&lt;br /&gt;        {&lt;br /&gt;            // Set the file filters in the open dialog box&lt;br /&gt;            var typeFiler:FileFilter = new FileFilter("All","*.*");&lt;br /&gt;            // show the dialog box&lt;br /&gt;            fileReferenceList.browse([typeFiler]);&lt;br /&gt;        }&lt;br /&gt;        public function selectResponse(event:Event):void&lt;br /&gt;        {&lt;br /&gt;            // Create an array with the size of the selected files.&lt;br /&gt;            var filesSelected:Array = new Array(fileReferenceList.fileList.length);&lt;br /&gt;            // Loop through all the selected files and add their names to the List control &lt;br /&gt;            for(var i:int=0;i&amp;lt;fileReferenceList.fileList.length;i++)&lt;br /&gt;            {&lt;br /&gt;                var fileReference:FileReference = fileReferenceList.fileList[ i ];&lt;br /&gt;                filesSelected[ i ] = fileReference.name;&lt;br /&gt;            }&lt;br /&gt;            listSelectedFiles.dataProvider = filesSelected;&lt;br /&gt;            listSelectedFiles.visible = true;&lt;br /&gt;            btnUpload.visible = true;&lt;br /&gt;        }&lt;br /&gt;        public function myFunction(): void&lt;br /&gt;        {&lt;br /&gt;            // This function is called on creationComplete event of this application&lt;br /&gt;            // Add event handler for the mouse click on the selectFiles button&lt;br /&gt;            btnSelectFiles.addEventListener(MouseEvent.CLICK, eventResponse);&lt;br /&gt;            // Add event handler for the mouse click on the upload button&lt;br /&gt;            btnUpload.addEventListener(MouseEvent.CLICK, btnUploadResponse);&lt;br /&gt;            // Add event handler for the select action in the open file dialog box&lt;br /&gt;            fileReferenceList.addEventListener(Event.SELECT,selectResponse);&lt;br /&gt;        }&lt;br /&gt;        public function UploadFiles():void    &lt;br /&gt;        {&lt;br /&gt;            // If the user selected 1 or multiple files&lt;br /&gt;            if(fileReferenceList.fileList.length &amp;gt; 0)&lt;br /&gt;            {&lt;br /&gt;                // For each file selected&lt;br /&gt;                for(var i:int=0;i&amp;lt;fileReferenceList.fileList.length;i++)&lt;br /&gt;                {&lt;br /&gt;                    // Create a FileReference instance of each file&lt;br /&gt;                    var fileReference:FileReference = fileReferenceList.fileList[ i ];&lt;br /&gt;                    // Create a new URLRequest class: The parameter is the aspx handler page&lt;br /&gt;                    var request:URLRequest = new URLRequest("http://localhost:1283/FlexUploadFles/UploadHandler.aspx");&lt;br /&gt;                    // Add event handler for the progress &lt;br /&gt;                    fileReference.addEventListener(ProgressEvent.PROGRESS, progressStatus);&lt;br /&gt;                    // Set the content type&lt;br /&gt;                       request.contentType = "application/octet-stream";&lt;br /&gt;                      // Set the method of the request&lt;br /&gt;                    request.method = "POST";&lt;br /&gt;                    // Upload the file&lt;br /&gt;                    fileReference.upload(request,fileReference.name,false);&lt;br /&gt;                }&lt;br /&gt;            }    &lt;br /&gt;        }&lt;br /&gt;        public function btnUploadResponse(event:Event):void&lt;br /&gt;        {&lt;br /&gt;            // Disable the Select files button, upload button, and call the UploadFiles function&lt;br /&gt;            btnSelectFiles.enabled = false;&lt;br /&gt;            btnUpload.enabled = false;&lt;br /&gt;            UploadFiles();&lt;br /&gt;        }&lt;br /&gt;        public function progressStatus(event:ProgressEvent):void&lt;br /&gt;        {&lt;br /&gt;            var file:FileReference = FileReference(event.target);&lt;br /&gt;            // Set the name of the currently being uploaded file&lt;br /&gt;            lblFileName.text = "Uploading File: " + file.name;&lt;br /&gt;            // Set the number of bytes being uploaded&lt;br /&gt;            lblUploadedBytes.text = "Bytes Uploaded: " + event.bytesLoaded;&lt;br /&gt;            // Set the total number of bytes&lt;br /&gt;            lblTotalBytes.text = "Total Size: " + event.bytesTotal + " bytes";&lt;br /&gt;        }&lt;br /&gt;    ]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;In .NET side write the following code to Pass the values after embeding the SWF File in ASPX page&lt;br /&gt;&lt;br /&gt;CS Code:&lt;br /&gt;using System;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;public partial class UploadHandler : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        for (int i = 0; i &amp;lt; Request.Files.Count; i++)&lt;br /&gt;        {&lt;br /&gt;            string fileName = System.IO.Path.GetFileName(Request.Files[i].FileName);&lt;br /&gt;            Request.Files[i].SaveAs(Server.MapPath("~/UploadedFiles/") + fileName);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;If you want to use filter option in your File Uploader Control write the following MXML Code&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt; layout="absolute"&lt;br /&gt; creationComplete="{init()}"&lt;br /&gt; &amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import mx.controls.Alert;&lt;br /&gt;   private var imageFilter:FileFilter;&lt;br /&gt;   private var htmlFilter:FileFilter;&lt;br /&gt;   private var fileReference:FileReference;&lt;br /&gt;&lt;br /&gt;   private function init():void{&lt;br /&gt;&lt;br /&gt;    imageFilter=new FileFilter("Image Files","*.jpg;*.gif;*.png")&lt;br /&gt;    htmlFilter=new FileFilter("HTML Files","*.html")&lt;br /&gt;    fileReference=new FileReference();&lt;br /&gt;    fileReference.addEventListener(Event.SELECT, fileSelectedHandler);&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private function fileSelectedHandler(e:Event):void{&lt;br /&gt;    if( e.target.type.toString()!='.jpg'&amp;&amp;&lt;br /&gt;     e.target.type.toString()!='.png'&amp;&amp;&lt;br /&gt;     e.target.type.toString()!='.gif'&amp;&amp;&lt;br /&gt;     e.target.type.toString()!='.html'){&lt;br /&gt;&lt;br /&gt;     Alert.show("Unexpected File Format","Error"); &lt;br /&gt;&lt;br /&gt;    }else{&lt;br /&gt;&lt;br /&gt;     Alert.show( "Name : "+e.target.name.toString()+"\n"+&lt;br /&gt;      "Type : "+e.target.type.toString()+"\n"+&lt;br /&gt;      "CreationDate : "+e.target.creationDate.toString()+"\n"+&lt;br /&gt;      "Size : "+e.target.size.toString()+"bites \n",&lt;br /&gt;      "File Informations");&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   private function browse(filter:FileFilter):void{&lt;br /&gt;&lt;br /&gt;    fileReference.browse([filter]);&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &amp;lt;mx:Button label="Browse Images Files" click="browse(imageFilter)"  x="10" y="60" width="150"/&amp;gt;&lt;br /&gt; &amp;lt;mx:Button label="Browse Html Files" click="browse(htmlFilter)"  y="30" x="10" width="150"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-4633091814433147863?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/4633091814433147863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=4633091814433147863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4633091814433147863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4633091814433147863'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-16-multiple-file.html' title='Flex Tutorials 16-Multiple file uploader in .NET using Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-2969666883120914420</id><published>2009-11-23T12:32:00.006+05:30</published><updated>2009-11-23T12:40:41.184+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 15-How to Call WebService in Adobe Flex</title><content type='html'>&lt;strong&gt;&lt;span style="color:#000099;"&gt;Simple Call&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;layout="vertical"&amp;gt;&lt;br /&gt;&amp;lt;mx:WebService id="wsData" wsdl="http://localhost:8700/flex/services/SimpleService?wsdl" load="wsData.arrayOutMethod()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGrid dataProvider="{wsData.arrayOutMethod.lastResult}"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Label text="{wsData.arrayOutMethod.lastResult.getItemAt(0).dessert}"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;Another Sample call&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;layout="vertical"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.collections.ArrayCollection;&lt;br /&gt;import mx.rpc.events.ResultEvent;&lt;br /&gt;[Bindable]&lt;br /&gt;private var sandwiches:ArrayCollection;&lt;br /&gt;private function sanDataHandler(event:ResultEvent):void{&lt;br /&gt;sandwiches = event.result as ArrayCollection;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:WebService id="sanData"&lt;br /&gt;wsdl="http://localhost:8500/SimpleWS.cfc?wsdl" load="sanData.getSandwichList()" result="sanDataHandler(event)"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:DataGrid dataProvider="{sandwiches}"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Label text="{sandwiches.getItemAt(0).sandwichName}"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Fault Handling in Web Service&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;layout="vertical"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.collections.ArrayCollection;&lt;br /&gt;import mx.rpc.events.ResultEvent;&lt;br /&gt;&lt;br /&gt;[Bindable]&lt;br /&gt;private var sandwiches:ArrayCollection;&lt;br /&gt;&lt;br /&gt;private function sanDataHandler(event:ResultEvent):void&lt;br /&gt;{&lt;br /&gt;sandwiches=event.result as ArrayCollection;&lt;br /&gt;}&lt;br /&gt;private function faultHandler(event:mx.rpc.events.FaultEvent):void{&lt;br /&gt;mx.controls.Alert.show(event.fault.faultCode);&lt;br /&gt;mx.controls.Alert.show(event.fault.faultString);&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:WebService id="sanData"&lt;br /&gt;wsdl="http://localhost:8500/SimpleWS.cfc?wsdl"&lt;br /&gt;load="sanData.getSandwichLists()"&lt;br /&gt;result="sanDataHandler(event)"&lt;br /&gt;fault="faultHandler(event)"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:DataGrid dataProvider="{sandwiches}"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Label text="{sandwiches.getItemAt(1).sandwichName}"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Call multiple Method in Web Service&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;layout="vertical"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.rpc.events.ResultEvent;&lt;br /&gt;import mx.collections.ArrayCollection;&lt;br /&gt;&lt;br /&gt;[Bindable]&lt;br /&gt;private var wordBack:String;&lt;br /&gt;[Bindable]&lt;br /&gt;private var dataBack:ArrayCollection;&lt;br /&gt;&lt;br /&gt;private function wordHandler(event:ResultEvent):void&lt;br /&gt;{&lt;br /&gt;wordBack=String(event.result);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function arrayHandler(event:ResultEvent):void&lt;br /&gt;{&lt;br /&gt;dataBack=event.result as ArrayCollection;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function faultHandler(event:mx.rpc.events.FaultEvent):void&lt;br /&gt;{&lt;br /&gt;mx.controls.Alert.show(event.fault.faultCode);&lt;br /&gt;mx.controls.Alert.show(event.fault.faultString);&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:WebService id="wsData"&lt;br /&gt;wsdl="http://localhost:8500/SimpleWS.cfc?wsdl" load="wsData.outMethod();wsData.arrayOutMethod()" fault="faultHandler(event)"&amp;gt;&lt;br /&gt;&amp;lt;mx:operation name="outMethod" result="wordHandler(event)"/&amp;gt;&lt;br /&gt;&amp;lt;mx:operation name="arrayOutMethod" result="arrayHandler(event)"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:WebService&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Label text="{wordBack}" fontSize="40"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:DataGrid dataProvider="{dataBack}"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Pass parameter to Webservice&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;layout="vertical"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.rpc.events.ResultEvent;&lt;br /&gt;&lt;br /&gt;[Bindable]&lt;br /&gt;private var wordBack:String;&lt;br /&gt;&lt;br /&gt;private function wsHandler(event:ResultEvent):void&lt;br /&gt;{&lt;br /&gt;wordBack=String(event.result);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function faultHandler(event:mx.rpc.events.FaultEvent):void&lt;br /&gt;{&lt;br /&gt;mx.controls.Alert.show(event.fault.faultCode);&lt;br /&gt;mx.controls.Alert.show(event.fault.faultString);&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:WebService id="wsData"&lt;br /&gt;wsdl="http://localhost:8500/SimpleWS.cfc?wsdl"&lt;br /&gt;result="wsHandler(event)"&lt;br /&gt;fault="faultHandler(event)"&amp;gt;&lt;br /&gt;&amp;lt;mx:operation name="multArgsMethod"&amp;gt;&lt;br /&gt;&amp;lt;mx:request xmlns=""&amp;gt;&lt;br /&gt;&amp;lt;oneArg&amp;gt;&lt;br /&gt;{word1.text}&lt;br /&gt;&amp;lt;/oneArg&amp;gt;&lt;br /&gt;&amp;lt;twoArg&amp;gt;&lt;br /&gt;{word2.text}&lt;br /&gt;&amp;lt;/twoArg&amp;gt;&lt;br /&gt;&amp;lt;/mx:request&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:operation&amp;gt;&lt;br /&gt;&amp;lt;/mx:WebService&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Label text="{wordBack}"&lt;br /&gt;fontSize="40"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:TextInput id="word1"/&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="word2"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="send data" click="wsData.multArgsMethod.send()"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/Swo0209OPaI/AAAAAAAABGo/cutmUnwBcCY/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407192419144711586" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 303px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/Swo0209OPaI/AAAAAAAABGo/cutmUnwBcCY/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-2969666883120914420?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/2969666883120914420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=2969666883120914420' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2969666883120914420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/2969666883120914420'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-15-how-to-call-websrive.html' title='Flex Tutorials 15-How to Call WebService in Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/Swo0209OPaI/AAAAAAAABGo/cutmUnwBcCY/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-6463565352945346403</id><published>2009-11-23T12:31:00.000+05:30</published><updated>2009-11-23T12:32:38.824+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 14-Currency Formatter in Adobe Flex</title><content type='html'>&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&amp;gt;&lt;br /&gt;&amp;lt;mx:Style&amp;gt;&lt;br /&gt;global {&lt;br /&gt;fontSize:12;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/mx:Style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;private function calculate():void {&lt;br /&gt;var result:Number = Number(amountInput.text) * (Number(percentInput.text) / 100);&lt;br /&gt;resultLabel.text = formatter.format(result.toString());&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&amp;lt;mx:CurrencyFormatter id="formatter" currencySymbol="kr" decimalSeparatorTo="," thousandsSeparatorTo="." precision="2"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:NumberValidator id="amountV"&lt;br /&gt;source="{amountInput}" property="text"&lt;br /&gt;trigger="{submitButton}" triggerEvent="click"&lt;br /&gt;minValue="1"&lt;br /&gt;requiredFieldError="Amount is required"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:NumberValidator id="percentV"&lt;br /&gt;source="{percentInput}" property="text"&lt;br /&gt;trigger="{submitButton}" triggerEvent="click"&lt;br /&gt;requiredFieldError="Enter a percentage"&lt;br /&gt;maxValue="100" exceedsMaxError="Percentage can't exceed 100%"&lt;br /&gt;domain="int" integerError="Enter percent as a whole number"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Panel title="Tip Calculator"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Form&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Bill amount:"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="amountInput" width="60"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Percent tip:"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="percentInput" width="60"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;/mx:Form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:ControlBar&amp;gt;&lt;br /&gt;&amp;lt;mx:Image source="@Embed('assets/calculator.gif')" width="30" height="30" /&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:Button id="submitButton"&lt;br /&gt;label="Calculate"&lt;br /&gt;click="calculate()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Label id="resultLabel"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:ControlBar&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Panel&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-6463565352945346403?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/6463565352945346403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=6463565352945346403' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6463565352945346403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/6463565352945346403'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-14-currency-formatter-in.html' title='Flex Tutorials 14-Currency Formatter in Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-5818252318659705693</id><published>2009-11-23T12:29:00.002+05:30</published><updated>2009-11-23T12:31:05.957+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 13-Regular Expression in Adobe Flex</title><content type='html'>&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   private function validateAddress():void{&lt;br /&gt;    var pattern:RegExp = new RegExp("\\d+\\x20[a-z]+", "i");&lt;br /&gt;    var result:int=billingAddress.text.search(pattern);&lt;br /&gt;    if (result == -1){&lt;br /&gt;     billingAddress.errorString = "Please enter a valid US address";&lt;br /&gt;    }else{&lt;br /&gt;     billingAddress.errorString="";&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:Form&amp;gt;&lt;br /&gt;  &amp;lt;mx:FormHeading label="Restaurant Delivery Information"/&amp;gt;&lt;br /&gt;  &amp;lt;mx:FormItem label="Name"&amp;gt;&lt;br /&gt;   &amp;lt;mx:TextInput id="billingName"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;  &amp;lt;mx:FormItem label="Address"&amp;gt; &lt;br /&gt;   &amp;lt;mx:TextArea id="billingAddress" width="160"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;  &amp;lt;mx:FormItem label="City"&amp;gt;&lt;br /&gt;   &amp;lt;mx:TextInput id="billingCity"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;  &amp;lt;mx:FormItem label="State"&amp;gt;&lt;br /&gt;   &amp;lt;mx:TextInput id="billingState" maxChars="2"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;  &amp;lt;mx:FormItem label="Zip"&amp;gt;&lt;br /&gt;   &amp;lt;mx:TextInput id="billingZip"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;  &amp;lt;mx:FormItem&amp;gt;&lt;br /&gt;   &amp;lt;mx:Button label="Continue" click="validateAddress()"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt; &amp;lt;/mx:Form&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwozHqrL42I/AAAAAAAABGg/X6PzP8TBWUc/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 225px;" src="http://2.bp.blogspot.com/_1EZkGmmHBwc/SwozHqrL42I/AAAAAAAABGg/X6PzP8TBWUc/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5407190509419225954" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-5818252318659705693?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/5818252318659705693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=5818252318659705693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5818252318659705693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/5818252318659705693'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-13-regular-expression-in.html' title='Flex Tutorials 13-Regular Expression in Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1EZkGmmHBwc/SwozHqrL42I/AAAAAAAABGg/X6PzP8TBWUc/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-4514332216607374863</id><published>2009-11-23T12:27:00.001+05:30</published><updated>2009-11-23T12:29:07.218+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 12-Valiation Control in Adobe Flex</title><content type='html'>&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&amp;gt;&lt;br /&gt; &amp;lt;mx:Style&amp;gt;&lt;br /&gt;  global {&lt;br /&gt;   fontSize:12;&lt;br /&gt;  }&lt;br /&gt;  .valid{&lt;br /&gt;   color:#000000;&lt;br /&gt;  }&lt;br /&gt;  .invalid{&lt;br /&gt;   color:#FF0000;&lt;br /&gt;  }&lt;br /&gt; &amp;lt;/mx:Style&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import mx.events.ValidationResultEvent;&lt;br /&gt;   private function calculate():void {&lt;br /&gt;    var evValidAmt:ValidationResultEvent = amountV.validate();&lt;br /&gt;    var evValidPct:ValidationResultEvent = percentV.validate();&lt;br /&gt;    if (evValidAmt.type == ValidationResultEvent.VALID &amp;&amp; evValidPct.type == ValidationResultEvent.VALID){&lt;br /&gt;     var result:Number = Number(amountInput.text) * (Number(percentInput.text) / 100);&lt;br /&gt;     resultLabel.text = result.toString();&lt;br /&gt;     resultLabel.setStyle("styleName","valid");&lt;br /&gt;    }else{&lt;br /&gt;     resultLabel.text="There are Form errors";&lt;br /&gt;     resultLabel.setStyle("styleName", "invalid");&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:NumberValidator id="amountV"&lt;br /&gt;  source="{amountInput}" property="text"&lt;br /&gt;  triggerEvent=""&lt;br /&gt;  minValue="1"&lt;br /&gt;  requiredFieldError="Amount is required"/&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;mx:NumberValidator id="percentV"&lt;br /&gt;  source="{percentInput}" property="text"&lt;br /&gt;  triggerEvent=""&lt;br /&gt;  requiredFieldError="Enter a percentage"&lt;br /&gt;  maxValue="100" exceedsMaxError="Percentage can't exceed 100%"&lt;br /&gt;  domain="int" integerError="Enter percent as a whole number"/&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;mx:Panel title="Tip Calculator"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;mx:Form&amp;gt;&lt;br /&gt;   &amp;lt;mx:FormItem label="Bill amount:"&amp;gt;&lt;br /&gt;    &amp;lt;mx:TextInput id="amountInput" width="60"/&amp;gt;&lt;br /&gt;   &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;   &amp;lt;mx:FormItem label="Percent tip:"&amp;gt;&lt;br /&gt;    &amp;lt;mx:TextInput id="percentInput" width="60"/&amp;gt;&lt;br /&gt;   &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;  &amp;lt;/mx:Form&amp;gt;  &lt;br /&gt;  &lt;br /&gt;  &amp;lt;mx:ControlBar&amp;gt;&lt;br /&gt;   &amp;lt;mx:Image source="@Embed('assets/calculator.gif')" width="30" height="30" /&amp;gt;&lt;br /&gt;   &amp;lt;mx:VBox&amp;gt;&lt;br /&gt;    &amp;lt;mx:Button id="submitButton" &lt;br /&gt;     label="Calculate"&lt;br /&gt;     click="calculate()"/&amp;gt;&lt;br /&gt;    &amp;lt;mx:Label id="resultLabel"/&amp;gt;&lt;br /&gt;   &amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;  &amp;lt;/mx:ControlBar&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;/mx:Panel&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;Output :&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/Swoyozk000I/AAAAAAAABGY/YsVAeAMB-rA/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 222px; height: 203px;" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/Swoyozk000I/AAAAAAAABGY/YsVAeAMB-rA/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5407189979232523074" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-4514332216607374863?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/4514332216607374863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=4514332216607374863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4514332216607374863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4514332216607374863'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-12-valiation-control-in.html' title='Flex Tutorials 12-Valiation Control in Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1EZkGmmHBwc/Swoyozk000I/AAAAAAAABGY/YsVAeAMB-rA/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-4855833300708370033</id><published>2009-11-23T12:23:00.002+05:30</published><updated>2009-11-23T12:27:02.715+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 11-Sort Function and ICursur in Adobe Flex</title><content type='html'>&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application&lt;br /&gt;xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;creationComplete="simpletestFood.send();" &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.collections.SortField;&lt;br /&gt;import mx.collections.Sort;&lt;br /&gt;import mx.collections.ArrayCollection;&lt;br /&gt;&lt;br /&gt;[Bindable]&lt;br /&gt;public var foodList:ArrayCollection;&lt;br /&gt;&lt;br /&gt;private function sortItems():void{&lt;br /&gt;var foodSort:Sort = new Sort();&lt;br /&gt;foodSort.fields = [new SortField("product_name")];&lt;br /&gt;foodList.sort = foodSort;&lt;br /&gt;foodList.refresh();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:HTTPService id="simpletestFood"&lt;br /&gt;url="assets\foodlist.xml" result="foodList = simpletestFood.lastResult.list.food"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Button id="myButton"&lt;br /&gt;label="Sort Items" click="sortItems()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:List id="cartDg"&lt;br /&gt;dataProvider="{foodList}"&lt;br /&gt;labelField="product_name"&lt;br /&gt;width="20%"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwoxqumJCUI/AAAAAAAABGI/bQlRU6RDFnw/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407188912743975234" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 194px; CURSOR: hand; HEIGHT: 147px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_1EZkGmmHBwc/SwoxqumJCUI/AAAAAAAABGI/bQlRU6RDFnw/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Using ICursur:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application &lt;br /&gt; xmlns:mx="http://www.adobe.com/2006/mxml" &lt;br /&gt; creationComplete="simpletestCat.send();simpletestFood.send()" &amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import mx.collections.IViewCursor;&lt;br /&gt;   import mx.controls.dataGridClasses.DataGridColumn;&lt;br /&gt;   import mx.collections.ArrayCollection;&lt;br /&gt;   import mx.collections.SortField;&lt;br /&gt;   import mx.collections.Sort;&lt;br /&gt;   import mx.collections.ArrayCollection;&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;   [Bindable]&lt;br /&gt;   public var categoryList:ArrayCollection;&lt;br /&gt;   [Bindable]&lt;br /&gt;   public var foodList:ArrayCollection;&lt;br /&gt;   [Bindable]&lt;br /&gt;   public var aItems:ArrayCollection = new ArrayCollection();&lt;br /&gt;   private var cursor:IViewCursor;&lt;br /&gt; &lt;br /&gt;   public function filterByCategory():void &lt;br /&gt;   {&lt;br /&gt; &lt;br /&gt;    foodList.filterFunction = catFilter;&lt;br /&gt;    foodList.refresh();&lt;br /&gt;   }&lt;br /&gt;   public function catFilter(item:Object):Boolean&lt;br /&gt;   {&lt;br /&gt;    if(categorySelect.selectedItem == "All") &lt;br /&gt;    {&lt;br /&gt;     return true;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;     return item.category_name == categorySelect.selectedItem.category_name;&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   private function sortItems():void &lt;br /&gt;   {&lt;br /&gt;    var sortA:Sort = new Sort();&lt;br /&gt;    sortA.fields=[new SortField("food_id", false)];&lt;br /&gt;    aItems.sort=sortA;&lt;br /&gt;    aItems.refresh();&lt;br /&gt;   }&lt;br /&gt;   private function manageAddItem(item:Object):void{&lt;br /&gt;    var temp:Object = getItemInCart(item);&lt;br /&gt;    if (temp !=null){&lt;br /&gt;     temp.quantity += 1;&lt;br /&gt;    }else{&lt;br /&gt;     item.quantity = 1;&lt;br /&gt;     aItems.addItem(item);&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function getItemInCart(item:Object):Object{&lt;br /&gt;    cursor = aItems.createCursor();&lt;br /&gt;    sortItems();&lt;br /&gt;    var found:Boolean = cursor.findAny(item);&lt;br /&gt;    if (found==true){&lt;br /&gt;     return cursor.current;&lt;br /&gt;    }else{&lt;br /&gt;     return null;&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt;  &lt;br /&gt; &amp;lt;mx:HTTPService id="simpletestCat" &lt;br /&gt;  url="assets\categorylist.xml" &lt;br /&gt;  result="categoryList=simpletestCat.lastResult.list.category;categoryList.addItemAt('All', 0);categorySelect.selectedIndex=0"/&amp;gt;&lt;br /&gt; &amp;lt;mx:HTTPService id="simpletestFood" &lt;br /&gt;  url="assets\foodlist.xml" &lt;br /&gt;  result="foodList=simpletestFood.lastResult.list.food"/&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:ComboBox id="categorySelect" &lt;br /&gt;  dataProvider="{categoryList}" &lt;br /&gt;  labelField="category_name" &lt;br /&gt;  change="filterByCategory()"/&amp;gt;&lt;br /&gt; &amp;lt;mx:List id="foodListBox" &lt;br /&gt;  dataProvider="{foodList}" &lt;br /&gt;  labelField="product_name" &lt;br /&gt;  width="200"/&amp;gt;&lt;br /&gt; &amp;lt;mx:Button id="myButton" &lt;br /&gt;  label="Add to Cart" click="manageAddItem(foodListBox.selectedItem)"/&amp;gt;&lt;br /&gt; &amp;lt;mx:Label text="Shopping Cart"/&amp;gt;&lt;br /&gt; &amp;lt;mx:DataGrid id="cartDg" &lt;br /&gt;  dataProvider="{aItems}" &lt;br /&gt;  width="50%"&amp;gt;&lt;br /&gt;  &amp;lt;mx:columns&amp;gt;&lt;br /&gt;   &amp;lt;mx:DataGridColumn dataField="product_name" headerText="Product"/&amp;gt;&lt;br /&gt;   &amp;lt;mx:DataGridColumn dataField="product_price" headerText="Price"/&amp;gt;&lt;br /&gt;   &amp;lt;mx:DataGridColumn dataField="quantity" headerText="Quantity"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:columns&amp;gt;&lt;br /&gt; &amp;lt;/mx:DataGrid&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwoyFv543ZI/AAAAAAAABGQ/53GJ8Qs2_x8/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 256px;" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwoyFv543ZI/AAAAAAAABGQ/53GJ8Qs2_x8/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5407189376951704978" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-4855833300708370033?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/4855833300708370033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=4855833300708370033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4855833300708370033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/4855833300708370033'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-11-sort-function-in.html' title='Flex Tutorials 11-Sort Function and ICursur in Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1EZkGmmHBwc/SwoxqumJCUI/AAAAAAAABGI/bQlRU6RDFnw/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-3530950751039794455</id><published>2009-11-23T12:19:00.002+05:30</published><updated>2009-11-23T12:22:54.169+05:30</updated><title type='text'>Flex Tutorials 10-Filter Function in Adobe Flex</title><content type='html'>Create foodlist.xml in Src\assets\categorylist.xml folder&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;list&amp;gt;&lt;br /&gt;&amp;lt;food&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;food_id&amp;gt;1&amp;lt;/food_id&amp;gt;&lt;br /&gt;&amp;lt;category_name&amp;gt;Korean&amp;lt;/category_name&amp;gt;&lt;br /&gt;&amp;lt;product_name&amp;gt;Kim Chi&amp;lt;/product_name&amp;gt;&lt;br /&gt;&amp;lt;product_price&amp;gt;.99&amp;lt;/product_price&amp;gt;&lt;br /&gt;&amp;lt;quantity&amp;gt;0&amp;lt;/quantity&amp;gt;&lt;br /&gt;&amp;lt;/food&amp;gt;&lt;br /&gt;&amp;lt;food&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;food_id&amp;gt;11&amp;lt;/food_id&amp;gt;&lt;br /&gt;&amp;lt;category_name&amp;gt;Indian&amp;lt;/category_name&amp;gt;&lt;br /&gt;&amp;lt;product_name&amp;gt;Daal&amp;lt;/product_name&amp;gt;&lt;br /&gt;&amp;lt;product_price&amp;gt;.99&amp;lt;/product_price&amp;gt;&lt;br /&gt;&amp;lt;quantity&amp;gt;0&amp;lt;/quantity&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/food&amp;gt;&lt;br /&gt;&amp;lt;food&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;food_id&amp;gt;2&amp;lt;/food_id&amp;gt;&lt;br /&gt;&amp;lt;category_name&amp;gt;Indian&amp;lt;/category_name&amp;gt;&lt;br /&gt;&amp;lt;product_name&amp;gt;Aloo Gobi&amp;lt;/product_name&amp;gt;&lt;br /&gt;&amp;lt;product_price&amp;gt;1.99&amp;lt;/product_price&amp;gt;&lt;br /&gt;&amp;lt;quantity&amp;gt;0&amp;lt;/quantity&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/food&amp;gt;&lt;br /&gt;&amp;lt;food&amp;gt;&lt;br /&gt;&amp;lt;food_id&amp;gt;3&amp;lt;/food_id&amp;gt;&lt;br /&gt;&amp;lt;category_name&amp;gt;Thai&amp;lt;/category_name&amp;gt;&lt;br /&gt;&amp;lt;product_name&amp;gt;Pad Thai&amp;lt;/product_name&amp;gt;&lt;br /&gt;&amp;lt;product_price&amp;gt;3.99&amp;lt;/product_price&amp;gt;&lt;br /&gt;&amp;lt;quantity&amp;gt;0&amp;lt;/quantity&amp;gt;&lt;br /&gt;&amp;lt;/food&amp;gt;&lt;br /&gt;&amp;lt;food&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;food_id&amp;gt;4&amp;lt;/food_id&amp;gt;&lt;br /&gt;&amp;lt;category_name&amp;gt;Japanese&amp;lt;/category_name&amp;gt;&lt;br /&gt;&amp;lt;product_name&amp;gt;Tempura&amp;lt;/product_name&amp;gt;&lt;br /&gt;&amp;lt;product_price&amp;gt;2.99&amp;lt;/product_price&amp;gt;&lt;br /&gt;&amp;lt;quantity&amp;gt;0&amp;lt;/quantity&amp;gt;&lt;br /&gt;&amp;lt;/food&amp;gt;&lt;br /&gt;&amp;lt;food&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;food_id&amp;gt;5&amp;lt;/food_id&amp;gt;&lt;br /&gt;&amp;lt;category_name&amp;gt;Ethiopian&amp;lt;/category_name&amp;gt;&lt;br /&gt;&amp;lt;product_name&amp;gt;Flat Bread&amp;lt;/product_name&amp;gt;&lt;br /&gt;&amp;lt;product_price&amp;gt;.99&amp;lt;/product_price&amp;gt;&lt;br /&gt;&amp;lt;quantity&amp;gt;0&amp;lt;/quantity&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/food&amp;gt;&lt;br /&gt;&amp;lt;food&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;food_id&amp;gt;7&amp;lt;/food_id&amp;gt;&lt;br /&gt;&amp;lt;category_name&amp;gt;Japanese&amp;lt;/category_name&amp;gt;&lt;br /&gt;&amp;lt;product_name&amp;gt;Sashimi&amp;lt;/product_name&amp;gt;&lt;br /&gt;&amp;lt;product_price&amp;gt;5.99&amp;lt;/product_price&amp;gt;&lt;br /&gt;&amp;lt;quantity&amp;gt;0&amp;lt;/quantity&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/food&amp;gt;&lt;br /&gt;&amp;lt;/list&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Mxmlcode:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application&lt;br /&gt;xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;creationComplete="simpletestCat.send();simpletestFood.send()" &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.controls.dataGridClasses.DataGridColumn;&lt;br /&gt;import mx.collections.ArrayCollection;&lt;br /&gt;[Bindable]&lt;br /&gt;public var categoryList:ArrayCollection;&lt;br /&gt;[Bindable]&lt;br /&gt;public var foodList:ArrayCollection;&lt;br /&gt;private function filterByCategory():void{&lt;br /&gt;foodList.filterFunction = catFilter;&lt;br /&gt;foodList.refresh();&lt;br /&gt;}&lt;br /&gt;private function catFilter(item:Object):Boolean{&lt;br /&gt;if(categorySelect.selectedItem == "All") {&lt;br /&gt;return true;&lt;br /&gt;}else{&lt;br /&gt;return item.category_name == categorySelect.selectedItem.category_name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:HTTPService id="simpletestCat"&lt;br /&gt;url="assets\categorylist.xml"&lt;br /&gt;result="categoryList = simpletestCat.lastResult.list.category;categoryList.addItemAt('All', 0);categorySelect.selectedIndex=0"/&amp;gt;&lt;br /&gt;&amp;lt;mx:HTTPService id="simpletestFood"&lt;br /&gt;url="assets\foodlist.xml"&lt;br /&gt;result="foodList = simpletestFood.lastResult.list.food"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:ComboBox id="categorySelect"&lt;br /&gt;dataProvider="{categoryList}"&lt;br /&gt;labelField="category_name"&lt;br /&gt;change="filterByCategory()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:List id="foodListBox"&lt;br /&gt;dataProvider="{foodList}"&lt;br /&gt;labelField="product_name"&lt;br /&gt;width="200"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Output:&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;a href="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwoxJ3anPeI/AAAAAAAABGA/Na6BUeSnnG8/s1600/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5407188348175859170" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 212px; CURSOR: hand; HEIGHT: 199px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_1EZkGmmHBwc/SwoxJ3anPeI/AAAAAAAABGA/Na6BUeSnnG8/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5019357135976515718-3530950751039794455?l=portal-management.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://portal-management.blogspot.com/feeds/3530950751039794455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5019357135976515718&amp;postID=3530950751039794455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3530950751039794455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5019357135976515718/posts/default/3530950751039794455'/><link rel='alternate' type='text/html' href='http://portal-management.blogspot.com/2009/11/flex-tutorials-10-filter-function-in.html' title='Flex Tutorials 10-Filter Function in Adobe Flex'/><author><name>Manab Ranjan Basu</name><uri>http://www.blogger.com/profile/07661833217989277946</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_1EZkGmmHBwc/Sg2w4JsZZuI/AAAAAAAAAq8/Houau8F274A/S220/IMG_1716_2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1EZkGmmHBwc/SwoxJ3anPeI/AAAAAAAABGA/Na6BUeSnnG8/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5019357135976515718.post-5312680230182232196</id><published>2009-11-23T12:15:00.003+05:30</published><updated>2009-11-23T12:18:36.588+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Flex'/><title type='text'>Flex Tutorials 9-Manipulating XML in Adobe Flex</title><content type='html'>put dishes.xml under src/xml&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &lt;br /&gt;&amp;lt;menu&amp;gt;&lt;br /&gt; &amp;lt;type aname="From the Grill"&amp;gt;&lt;br /&gt;  &amp;lt;category aname="Fish dishes"&amp;gt;&lt;br /&gt;   &amp;lt;dish id="1" aname="Cajun Seafood Bouillabaisse" description="With crawfish, scallops, catfish, crab, and mussels. Served with Southern-style cornbread and honey butter." price="17.50" image="image2.jpg"/&amp;gt;&lt;br /&gt;   &amp;lt;dish id="2" aname="Grilled Rockfish Fillet" description="Lemon-Chive Risotto Cake, Balsamic Glaze" price="24.95" image="image2.jpg"/&amp;gt;&lt;br /&gt;  &amp;lt;/category&amp;gt;&lt;br /&gt;  &amp;lt;category aname="Meat dishes"&amp;gt;&lt;br /&gt;   &amp;lt;dish id="3" aname="Sage-rubbed Double-cut Pork Chop" description="Topped with a ragout of mushrooms and chunky pancetta. Served with griddle corn cakes." price="14.95" image="image4.jpg"/&amp;gt;&lt;br /&gt;   &amp;lt;dish id="4" aname="The Burger" description="Brioche Bun and your choice of Mushrooms, Bacon, Cheddar, Gruyere, Blue" price="18.75" image="image4.jpg"/&amp;gt;&lt;br /&gt;  &amp;lt;/category&amp;gt;&lt;br /&gt; &amp;lt;/type&amp;gt;&lt;br /&gt; &amp;lt;type aname="Healthy, Light and Vegetarian"&amp;gt;&lt;br /&gt;  &amp;lt;category aname="Vegetarian dishes"&amp;gt;&lt;br /&gt;   &amp;lt;dish id="5" aname="Cavatappi Pasta with Chickpea Sauce" description="Tossed with grilled eggplant, green olives, and sun dried tomatoes. Topped with Mediterranean feta." price="17.45" image="image0.jpg"/&amp;gt;&lt;br /&gt;   &amp;lt;dish id="6" aname="Roasted Tomato Soup" description="Served with goat cheese croutons and basil puree" price="9.95" image="image0.jpg"/&amp;gt;&lt;br /&gt;  &amp;lt;/category&amp;gt;&lt;br /&gt;  &amp;lt;category aname="Light dishes"&amp;gt;&lt;br /&gt;   &amp;lt;dish id="7" aname="Summer Salad" description="Gorgonzola, tossed with raspberry vinaigrette" price="13.25" image="image1.jpg"/&amp;gt;&lt;br /&gt;   &amp;lt;dish id="8" aname="Pancetta-wrapped Sea Scallops" description="Drizzled with tarragon puree. Served with baked cauliflower au gratin in a tangy Gruyere sauce" price="16.45" image="image1.jpg"/&amp;gt;&lt;br /&gt;  &amp;lt;/category&amp;gt;&lt;br /&gt; &amp;lt;/type&amp;gt;&lt;br /&gt;&amp;lt;/menu&amp;gt;&lt;br /&gt;&lt;br /&gt;Now we need the output as follows&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1EZkGmmHBwc/Swov8ChMVAI/AAAAAAAABF4/K2I0HZ-hP40/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 176px;" src="http://1.bp.blogspot.com/_1EZkGmmHBwc/Swov8ChMVAI/AAAAAAAABF4/K2I0HZ-hP40/s400/1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5407187011126449154" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Mxml Code:&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" &lt;br /&gt; xmlns="*" layout="horizontal" creationComplete="dishesXML.send();"&amp;gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import mx.rpc.events.ResultEvent;&lt;br /&gt;   import mx.collections.XMLListCollection;&lt;br /&gt;   [Bindable]&lt;br /&gt;   private var dishesDP:XMLList;&lt;br /&gt;   [Bindable]&lt;br /&gt;   private var shoppingCartXML:XML = new XML(&amp;lt;products&amp;gt;&amp;lt;/products&amp;gt;);&lt;br /&gt;   [Bindable]&lt;br /&gt;   private var shoppingCartData:XMLListCollection;&lt;br /&gt;   private function dishesXMLHandler(event:ResultEvent):void&lt;br /&gt;   {&lt;br /&gt;    dishesDP = event.result..category;&lt;br /&gt;   }&lt;br /&gt;   private function addToShoppingCart():void&lt;br /&gt;   {&lt;br /&gt;    var itemToUpdate:XMLList = shoppingCartXML.product.(@id == dishesTree.selectedNode.@id);&lt;br /&gt;    if(itemToUpdate.qty &amp;gt; 0)&lt;br /&gt;    {&lt;br /&gt;     itemToUpdate.qty=Number(itemToUpdate.qty)+1;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;     var newItem:XML =&lt;br /&gt;     &amp;lt;product id={dishesTree.selectedNode.@id}&amp;gt;&lt;br /&gt;      &amp;lt;aname&amp;gt;&lt;br /&gt;       {dishesTree.selectedItem.@aname}&lt;br /&gt;      &amp;lt;/aname&amp;gt;&lt;br /&gt;      &amp;lt;price&amp;gt;&lt;br /&gt;       {dishesTree.selectedItem.@price}&lt;br /&gt;      &amp;lt;/price&amp;gt;&lt;br /&gt;      &amp;lt;qty&amp;gt;&lt;br /&gt;       1&lt;br /&gt;      &amp;lt;/qty&amp;gt;&lt;br /&gt;     &amp;lt;/product&amp;gt;;&lt;br /&gt;     shoppingCartXML.appendChild(newItem);&lt;br /&gt;    }&lt;br /&gt;    shoppingCartData = new XMLListCollection (shoppingCartXML.children());&lt;br /&gt;   }&lt;br /&gt;   private function removeFromShoppingCart():void&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;   private function clearCart():void&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;   private function populateForm(event:Event):void&lt;br /&gt;   {&lt;br /&gt;    var node:XML=event.target.selectedItem;&lt;br /&gt;    if(node.@price != undefined)&lt;br /&gt;    {&lt;br /&gt;     prodName.text = node.@aname;&lt;br /&gt;     listPrice.text = node.@price;&lt;br /&gt;     description.text = node.@description;&lt;br /&gt;     theImage.source = "assets/"+node.@image;&lt;br /&gt;     theForm.visible = true;&lt;br /&gt;    } &lt;br /&gt;    else &lt;br /&gt;    {&lt;br /&gt;     theForm.visible = false;&lt;br /&gt;     prodName.text = "";&lt;br /&gt;     listPrice.text = "";&lt;br /&gt;     description.text = "";&lt;br /&gt;     theImage.source = "";&lt;br /&gt;    }    &lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:HTTPService id="dishesXML" url="assets/xml/dishes.xml" showBusyCursor="true"&lt;br /&gt;   result="dishesXMLHandler(event)" resultFormat="e4x"/&amp;gt;&lt;br /&gt;  &lt;br /&gt; &amp;lt;mx:ApplicationControlBar width="100%" height="110"&amp;gt;&lt;br /&gt;  &amp;lt;mx:HBox&amp;gt;&lt;br /&gt;   &amp;lt;mx:Image source="assets/header.jpg" /&amp;gt;&lt;br /&gt;   &amp;lt;mx:Label text="Delivery Service" fontSize="20"/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:HBox&amp;gt;&lt;br /&gt; &amp;lt;/mx:ApplicationControlBar&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:Panel id="leftPanel" title="Our Fine Foods" width="100%" height="{centerPanel.height}"&amp;gt; &lt;br /&gt;  &amp;lt;mx:Tree id="dishesTree"&lt;br /&gt;   dataProvider="{dishesDP}"&lt;br /&gt;   labelField="@aname"&lt;br /&gt;   width="100%"&lt;br /&gt;   height="100%"&lt;br /&g
