<?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'><id>tag:blogger.com,1999:blog-6171124407563382566</id><updated>2009-10-12T19:36:38.151-07:00</updated><title type='text'>DOTNET WORLD</title><subtitle type='html'>Dot net is designed from the scratch to support programming language independent application development</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-1175377529501746706</id><published>2008-05-09T22:23:00.000-07:00</published><updated>2008-05-09T22:25:33.816-07:00</updated><title type='text'>ASP.NET Authentication</title><content type='html'>ASP.NET Authentication&lt;br /&gt;&lt;br /&gt;Authentication is the process of obtaining identification credentials from a user ( such as name and password ), and validating those credentials against some authority. &lt;br /&gt;&lt;br /&gt;If the credentials are valid, the entity that submitted the credentials is considered an authenticated identity. Once an identity has been authenticated, the authorization process determines whether that identity has access to a given resource. &lt;br /&gt;&lt;br /&gt;ASP.NET implements authentication through authentication providers, the modules that contain the code to authenticate the requestor's credentials. This section describes the authentication providers built into ASP.NET. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Windows Authentication Provider &lt;br /&gt;Describes how to use the Windows Authentication provider The Passport Authentication Provider &lt;br /&gt;Describes how to use the Passport Authentication provider. &lt;br /&gt;The Forms Authentication Provider &lt;br /&gt;Describes how to use the Forms Authentication provider.  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Windows Authentication Provider&lt;br /&gt;&lt;br /&gt;The WindowsAuthenticationModule provider relies on IIS to provide authenticated users, using any of the mechanisms IIS supports. The provider module constructs a WindowsIdentity object. The default implementation constructs a WindowsPrincipal object and attaches it to the application context. The WindowsPrincipal object maps identities to Windows groups. &lt;br /&gt;&lt;br /&gt;If you use IIS authentication, the provider module uses the authenticated identity passed in from IIS. IIS authenticates the identity using basic, digest, or Windows authentication, or some combination of them. You can use impersonation and you can use NTFS ACL permissions to restrict or allow access to protected resources. This is the provider configuration you should use if you want to implement site security with a minimum of ASP.NET coding. &lt;br /&gt;&lt;br /&gt;An important reason to use the Windows Authentication provider is to implement an impersonation scheme that can use any of the authentication methods that might have already been performed by IIS before passing the request to the ASP.NET application. To do this, set the authentication mode to Windows, and confirm that the impersonate element is set to true, as shown in the following example: &lt;br /&gt;&lt;br /&gt;&lt;authentication mode = "Windows"&gt;&lt;/authentication&gt;&lt;br /&gt;&lt;identity impersonate = "true" /&gt;&lt;br /&gt;Please note that configuring an ASP.NET application has no effect on the IIS Directory Security settings. The systems are completely independent and are applied in sequence. In addition to selecting an authentication mode for an ASP.NET application, it is also important to configure IIS authentication appropriately. &lt;br /&gt;&lt;br /&gt;Next you must set the NTFS ACLs to allow access only to the proper identities. If you want to enable impersonation for only a short time during request processing, you can do it by using an impersonation context and WindowsIdentity.Impersonate. &lt;br /&gt;&lt;br /&gt; NOTE: A Windows identity for an anonymous user cannot be impersonated because it causes an exception. &lt;br /&gt;&lt;br /&gt;First, set the impersonate element to false, then set up a context using the WindowsIdentity.Impersonate method, as follows: &lt;br /&gt;&lt;br /&gt;WindowsImpersonationContext context = &lt;br /&gt;   WindowsIdentity.Impersonate ( impersonateToken );&lt;br /&gt;// do whatever.&lt;br /&gt;context.Undo ( );&lt;br /&gt;&lt;br /&gt;Dim context As WindowsImpersonationContext = _&lt;br /&gt;   WindowsIdentity.Impersonate ( impersonateToken )&lt;br /&gt;' do whatever.&lt;br /&gt;context.Undo ( )&lt;br /&gt; &lt;br /&gt;  C# VB &lt;br /&gt;&lt;br /&gt;Notice that you can use context.Undo for identity reversion. &lt;br /&gt;&lt;br /&gt;As mentioned earlier, you can implement a custom Windows authorization scheme by using a WindowsAuthenticate_OnAuthenticate event handler to create a WindowsPrincipal or a GenericPrincipal object from a WindowsIdentity object. You can then use one of the new objects to implement your own custom authentication scheme. The WindowsPrincipal object maps identities to Windows groups. The default implementation constructs a WindowsPrincipal object and attaches it to the application context. &lt;br /&gt;&lt;br /&gt;See Also&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-1175377529501746706?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/1175377529501746706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=1175377529501746706' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/1175377529501746706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/1175377529501746706'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/aspnet-authentication.html' title='ASP.NET Authentication'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-3418221998978637746</id><published>2008-05-08T03:18:00.000-07:00</published><updated>2008-05-08T03:19:42.985-07:00</updated><title type='text'>How ASP.NET Security Works</title><content type='html'>How ASP.NET Security Works&lt;br /&gt;Essentially, securing an ASP.NET Web application entails controlling access to its resources. &lt;br /&gt;&lt;br /&gt;The ASP.NET security framework accomplishes this by working in conjunction with the various security subsystems present in the machine where ASP.NET is installed. This includes security provided by the operating system ( NTFS file access permissions ) as well as security provided by IIS ( host or IP address authorization ). &lt;br /&gt;&lt;br /&gt;And since ASP.NET is built on the Microsoft .NET Framework, the ASP.NET application developer also has access to all of the built-in security features of the .NET Framework, such as code access security and role-based user-access security. &lt;br /&gt;&lt;br /&gt;It is imperative to understand how the various security subsystems interact, to be able to secure your ASP.NET application effectively. &lt;br /&gt;&lt;br /&gt;Basically, to enable security for an ASP.NET application, you need to configure the application to implement, at the very least, the two fundamental functionalities described in the following table. &lt;br /&gt;&lt;br /&gt;Security function---Authentication&lt;br /&gt; Description ---- The process of obtaining identification credentials from a user ( such as name and password ), and validating those credentials against some authority. &lt;br /&gt;&lt;br /&gt;Security function---Authorization&lt;br /&gt;  Description ---- The process of controlling access to resources based on the authenticated identification credentials ( such as role ). &lt;br /&gt;&lt;br /&gt;ASP.NET implements authentication through authentication providers, the modules that contain the code to authenticate user credentials. ASP.NET includes the following authentication providers. &lt;br /&gt;&lt;br /&gt;ASP.NET Authentication Provider  &lt;br /&gt;&lt;strong&gt;Windows Authentication&lt;/strong&gt;&lt;br /&gt;Description--- Provider ASP.NET uses Windows authentication in conjunction with IIS authentication. Authentication is performed by IIS in one of three ways: basic, digest, or Integrated Windows Authentication. When IIS authentication is complete, ASP.NET uses the authenticated identity to authorize access. &lt;br /&gt;&lt;br /&gt;ASP.NET Authentication Provider&lt;br /&gt;&lt;strong&gt;Forms Authentication&lt;/strong&gt; &lt;br /&gt;Description----Provider A system by which unauthenticated requests are redirected to an HTML form using HTTP client-side redirection. The user provides credentials and submits the form. If the application authenticates the request, the system issues a form that contains the credentials or a key for reacquiring the identity. Subsequent requests are issued with the form in the request headers; they are authenticated and authorized by an ASP.NET handler using whatever validation method the application developer specifies. &lt;br /&gt;&lt;br /&gt;ASP.NET Authentication Provider &lt;br /&gt;&lt;strong&gt;Passport Authentication &lt;/strong&gt;&lt;br /&gt;Description----Provider Centralized authentication service provided by Microsoft that offers a single logon and core profile services for member sites. &lt;br /&gt;&lt;br /&gt;To enable authentication for an ASP.NET application, you need to create an authentication section entry in the application root configuration file. The general syntax for the authentication section is as follows: &lt;br /&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;   &lt;system.web&gt;&lt;br /&gt;      &lt;authentication &lt;br /&gt;         mode = " [ Windows | Forms | Passport | None ] "&gt;&lt;br /&gt;      &lt;/authentication&gt;&lt;br /&gt;   &lt;/system.web&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;The mode is set to one of the authentication methods: Windows, Forms, Passport, or None. The default is Windows. &lt;br /&gt;&lt;br /&gt;The authentication mode cannot be set at a level below the application root directory. Like all other configuration settings, all subdirectories within the application boundary inherit the authentication mode, unless explicitly overriden in a child configuration file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-3418221998978637746?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/3418221998978637746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=3418221998978637746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/3418221998978637746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/3418221998978637746'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/how-aspnet-security-works.html' title='How ASP.NET Security Works'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-4398138526440060245</id><published>2008-05-07T03:41:00.000-07:00</published><updated>2008-05-07T03:43:43.686-07:00</updated><title type='text'>ASP.NET Security</title><content type='html'>ASP.NET Security&lt;br /&gt;Lately at SCS I have been assigned to build up the security module and related tasks in the Real Estate Management System we are building. So I decided to share what I have learned in this past period and of course to hear from the community to find optimal solutions for the scenarios I worked with, all what I write here might be repeated but I will share it anyway. &lt;br /&gt;&lt;br /&gt;In this part, I will show some important basic points that should be clear to everyone before implementing asp.net security tasks. &lt;br /&gt;&lt;br /&gt;Looking at any web application, the security is a matter of users/passwords/roles/groups... etc. While ASP.NET provides more mechanisms for authentication and authorization that work with the Operating system,IIS and .NET framework classes. So the ASP.NET application runs through these 3 levels. &lt;br /&gt;&lt;br /&gt;IIS Level &lt;br /&gt;ASP.NET worker process level &lt;br /&gt;ASP.NET pipeline level &lt;br /&gt;So, the Big Question, What is the Identity that runs my application ? &lt;br /&gt;&lt;br /&gt;First, When an IIS web server machine receives an ASP.NET request, the IIS assigns it to one of the threads pooled in it, IIS runs under the SYSTEM account which has all the powers in a Microsoft Windows operating system. You can read extra information in the ASP.NET Application Life Cycle Overview article on the msdn. &lt;br /&gt;&lt;br /&gt;Next, the 3 security levels run on the request one after the other. &lt;br /&gt;&lt;br /&gt;1- The IIS thread context : the identity of this thread is determined according to the settings of the website in the IIS which has one of the following settings: &lt;br /&gt;&lt;br /&gt;Basic authentication prompts the user for a user name and a password, also called credentials, which are sent unencrypted over the network. &lt;br /&gt;Integrated Windows authentication uses hashing technology to scramble user names and password before sending them over the network. &lt;br /&gt;Digest authentication operates much like Basic authentication, except that passwords are sent across the network as a hash value. Digest authentication is only available on domains with domain controllers running Windows Server operating systems. &lt;br /&gt;Anonymous authentication allows everyone access to the public areas of the Web sites, without asking for a user name or password. When this is set, the identity impersonates the identity set in the textboxes, with the default user name IUSR_MACHINENAME. Like shown in the figure down below. &lt;br /&gt;&lt;a href="http://bp2.blogger.com/_gN9B-Swt0ew/SCGHre6mG7I/AAAAAAAAAWI/4SCMtjV9tRk/s1600-h/image.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_gN9B-Swt0ew/SCGHre6mG7I/AAAAAAAAAWI/4SCMtjV9tRk/s320/image.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5197584626065218482" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-4398138526440060245?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/4398138526440060245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=4398138526440060245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4398138526440060245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4398138526440060245'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/aspnet-security.html' title='ASP.NET Security'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_gN9B-Swt0ew/SCGHre6mG7I/AAAAAAAAAWI/4SCMtjV9tRk/s72-c/image.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-5823596489111355990</id><published>2008-05-06T00:37:00.000-07:00</published><updated>2008-05-06T00:38:02.335-07:00</updated><title type='text'>Microsoft .NET Framework</title><content type='html'>&lt;strong&gt;Introducing the Microsoft .NET Framework&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;.NET (dot-net) is the name Microsoft gives to its general vision of the future of computing, the view being of a world in which many applications run in a distributed manner across the Internet. We can identify a number of different motivations driving this vision.&lt;br /&gt;&lt;br /&gt;Firstly, distributed computing is rather like object oriented programming, in that it encourages specialised code to be collected in one place, rather than copied redundantly in lots of places. There are thus potential efficiency gains to be made in moving to the distributed model.&lt;br /&gt;&lt;br /&gt;Secondly, by collecting specialised code in one place and opening up a generally accessible interface to it, different types of machines (phones, handhelds, desktops, etc.) can all be supported with the same code. Hence Microsoft's 'run-anywhere' aspiration.&lt;br /&gt;&lt;br /&gt;Thirdly, by controlling real-time access to some of the distributed nodes (especially those concerning authentication), companies like Microsoft can control more easily the running of its applications. It moves applications further into the area of 'services provided' rather than 'objects owned'.&lt;br /&gt;&lt;br /&gt;Interestingly, in taking on the .NET vision, Microsoft seems to have given up some of its proprietary tendencies (whereby all the technology it touched was warped towards its Windows operating system). Because it sees its future as providing software services in distributed applications, the .NET framework has been written so that applications on other platforms will be able to access these services. For example, .NET has been built upon open standard technologies like XML and SOAP.&lt;br /&gt;&lt;br /&gt;At the development end of the .NET vision is the .NET Framework. This contains the Common Language Runtime, the .NET Framework Classes, and higher-level features like ASP.NET (the next generation of Active Server Pages technologies) and WinForms (for developing desktop applications).&lt;br /&gt;&lt;br /&gt;The Common Language Runtime (CLR) manages the execution of code compiled for the .NET platform. The CLR has two interesting features. Firstly, its specification has been opened up so that it can be ported to non-Windows platforms. Secondly, any number of different languages can be used to manipulate the .NET framework classes, and the CLR will support them. This has led one commentator to claim that under .NET the language one uses is a 'lifestyle choice'.&lt;br /&gt;&lt;br /&gt;Not all of the supported languages fit entirely neatly into the .NET framework, however (in some cases the fit has been somewhat Procrustean). But the one language that is guaranteed to fit in perfectly is C#. This new language, a successor to C++, has been released in conjunction with the .NET framework, and is likely to be the language of choice for many developers working on .NET applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-5823596489111355990?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/5823596489111355990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=5823596489111355990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/5823596489111355990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/5823596489111355990'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/microsoft-net-framework.html' title='Microsoft .NET Framework'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-4014819358130295528</id><published>2008-05-05T03:40:00.000-07:00</published><updated>2008-05-05T03:41:29.010-07:00</updated><title type='text'>State Management Techniques in ASP.NET-2</title><content type='html'>Control State:&lt;br /&gt;Control State is new mechanism in ASP.NET 2.0 which addresses some of the shortcomings of View State. Control state can be used to store critical, private information across post backs. Control state is another type of state container reserved for controls to maintain their core behavioral functionality whereas View State only contains state to maintain control's contents (UI). Control State shares same memory data structures with View State. Control State can be propagated even though the View State for the control is disabled. For example, new control Grid View in ASP.NET 2.0 makes effective use of control state to maintain the state needed for its core behavior across post backs. Grid View is in no way affected when we disable View State for the Grid View or entire page&lt;br /&gt;Server Side State management:&lt;br /&gt;As name implies, state information will be maintained on the server. Application, Session, Cache and Database are different mechanisms for storing state on the server. &lt;br /&gt;Care must be taken to conserve server resources. For a high traffic web site with large number of concurrent users, usage&lt;br /&gt;of sessions object for state management can create load on server causing performance degradation&lt;br /&gt;Application object:&lt;br /&gt;Application object is used to store data which is visible across entire application and shared across multiple user sessions. Data which needs to be persisted for entire life of application should be stored in application object.&lt;br /&gt;In classic ASP, application object is used to store connection strings. It's a great place to store data which changes infrequently. We should write to application variable only in application_Onstart event (global.asax) or application.lock event to avoid data conflicts. Below code sample gives idea&lt;br /&gt;Application.Lock();&lt;br /&gt;Application["mydata"]="mydata";&lt;br /&gt;Application.UnLock(); &lt;br /&gt;Session object:&lt;br /&gt;Session object is used to store state specific information per client basis. It is specific to particular user. Session data persists for the duration of user session you can store session's data on web server in different ways. Session state can be configured using the &lt;session State&gt; section in the application's web.config file.  &lt;br /&gt;Configuration information:&lt;br /&gt;&lt;br /&gt;sessionState mode = &lt;"inproc" | "sqlserver" | "stateserver"&gt;&lt;br /&gt; cookieless = &lt;"true" | "false"&gt; &lt;br /&gt; timeout = &lt;positive integer indicating the session timeout in minutes&gt;&lt;br /&gt; sqlconnectionstring = &lt;SQL connection string that is only used in the SQLServer mode&gt;&lt;br /&gt; server = &lt;The server name that is only required when the mode is State Server&gt;&lt;br /&gt; port = &lt;The port number that is only required when the mode is State Server&gt;      &lt;br /&gt;Mode:&lt;br /&gt;&lt;br /&gt;This setting supports three options. They are InProc, SQLServer, and State Server&lt;br /&gt;&lt;br /&gt;Cookie less:&lt;br /&gt;This setting takes a Boolean value of either true or false to indicate whether the Session is a cookie less one.&lt;br /&gt;Timeout:&lt;br /&gt;This indicates the Session timeout vale in minutes.  This is the duration for which a user's session is active.  Note that the session timeout is a sliding value; Default session timeout value is 20 minutes&lt;br /&gt;&lt;br /&gt;SqlConnectionString:&lt;br /&gt;This identifies the database connection string that names the database used for mode SQLServer. &lt;br /&gt;&lt;br /&gt;Server:&lt;br /&gt;In the out-of-process mode State Server, it names the server that is running the required Windows NT service: aspnet_state.&lt;br /&gt; &lt;br /&gt;Port:&lt;br /&gt;&lt;br /&gt;This identifies the port number that corresponds to the server setting for mode State Server.  Note that a port is an unsigned integer that uniquely identifies a process running over a network.&lt;br /&gt;You can disable session for a page using EnableSessionState attribute. You can set off session for entire application by setting mode=off in web.config file to reduce overhead for the entire application.&lt;br /&gt;Session state in ASP.NET can be configured in different ways based on various parameters including scalability, maintainability and availability&lt;br /&gt;• In process mode (in-memory)- State information is stored in memory of web server &lt;br /&gt;• Out-of-process mode- session state is held in a process called aspnet_state.exe that runs as a windows service. &lt;br /&gt;• Database mode â€“ session state is maintained on a SQL Server database.&lt;br /&gt;In process mode:&lt;br /&gt;&lt;br /&gt;This mode is useful for small applications which can be hosted on a single server. This model is most common and default method to store session specific information. Session data is stored in memory of local web server&lt;br /&gt;Configuration information:&lt;br /&gt;&lt;sessionState mode="Inproc"&lt;br /&gt; sqlConnectionString="data source=server;user id=freelance;password=freelance"&lt;br /&gt; cookieless="false" timeout="20" /&gt;&lt;br /&gt;Advantages:&lt;br /&gt;• Fastest mode  &lt;br /&gt;• Simple configuration&lt;br /&gt;Disadvantages:&lt;br /&gt;• Session data will be lost if the worker process or application domain recycles &lt;br /&gt;• Not ideal for web gardens and web farms&lt;br /&gt;Out-of-process Session mode (state server mode):&lt;br /&gt;&lt;br /&gt;This mode is ideal for scalable and highly available applications. Session state is held in a process called aspnet_state.exe that runs as a windows service which listens on TCP port 42424 by default. You can invoke state service using services MMC snap-in or by running following net command from command line. &lt;br /&gt;Net start aspnet_state&lt;br /&gt;Configuration information:&lt;br /&gt;&lt;br /&gt;&lt;sessionState mode="StateServer"&lt;br /&gt; StateConnectionString="tcpip=127.0.0.1:42424"&lt;br /&gt; sqlConnectionString="data source=127.0.0.1;user id=freelance; password=freelance"&lt;br /&gt; cookieless="false" timeout="20"/&gt;                                                            &lt;br /&gt;Advantages:&lt;br /&gt;• Supports web farm and web garden configuration &lt;br /&gt;• Session data is persisted across application domain recycles. This is achieved by using separate worker process for maintaining state&lt;br /&gt;Disadvantages:&lt;br /&gt;• Out-of-process mode provides slower access compared to In process &lt;br /&gt;• Requires serializing data  &lt;br /&gt;SQL-Backed Session state:&lt;br /&gt;ASP.NET sessions can also be stored in a SQL Server database. Storing sessions in SQL Server offers resilience that can serve sessions to a large web farm that persists across IIS restarts.&lt;br /&gt;&lt;br /&gt;SQL based Session state is configured with aspnet_regsql.exe. This utility is located in .NET Framework's installed directory&lt;br /&gt; C:\&lt;windows&gt;\microsoft.net\framework\&lt;version&gt;. Running this utility will create a database which will manage the session state. &lt;br /&gt;Configuration Information:&lt;br /&gt;&lt;sessionState mode="SQLServer"&lt;br /&gt;  sqlConnectionString="data source=server;user id=freelance;password=freelance"&lt;br /&gt;  cookieless="false" timeout="20" /&gt;&lt;br /&gt;Advantages:&lt;br /&gt;• Supports web farm and web garden configuration &lt;br /&gt;• Session state is persisted across application domain recycles and even IIS restarts    when session is maintained on different server.&lt;br /&gt;Disadvantages:&lt;br /&gt;• Requires serialization of objects&lt;br /&gt;Choosing between client side and Server side management techniques is driven by various factors including available server resources, scalability and performance. We have to leverage both client side and server side state management options to build scalable applications. &lt;br /&gt;When leveraging client side state options, ensure that little amount of insignificant information is exchanged between page requests. &lt;br /&gt;Various parameters should be evaluated when leveraging server side state options including size of application, reliability and robustness. Smaller the application, In process is the better choice. We should account in the overheads involved in serializing and deserializing objects when using State Server and Database based session state. Application state should be used religiously.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-4014819358130295528?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/4014819358130295528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=4014819358130295528' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4014819358130295528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4014819358130295528'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/state-management-techniques-in-aspnet-2.html' title='State Management Techniques in ASP.NET-2'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-5551562708173112061</id><published>2008-05-05T03:39:00.000-07:00</published><updated>2008-05-05T03:42:42.750-07:00</updated><title type='text'>State Management Techniques in ASP.NET-1</title><content type='html'>This article discusses various options for state management for web applications developed using ASP.NET. Generally, web applications are based on stateless HTTP protocol which does not retain any information about user requests. In typical client and server communication using HTTP protocol, page is created each time the page is requested.&lt;br /&gt;&lt;br /&gt;Developer is forced to implement various state management techniques when developing applications which provide customized content and which "remembers" the user.&lt;br /&gt;Here we are here with various options for ASP.NET developer to implement state management techniques in their applications. Broadly, we can classify state management techniques as client side state management or server side state management. Each technique has its own pros and cons. Let's start with exploring client side state management options.&lt;br /&gt;Client side State management Options:&lt;br /&gt;&lt;br /&gt;ASP.NET provides various client side state management options like Cookies, QueryStrings (URL), Hidden fields, View State and Control state (ASP.NET 2.0). Let's discuss each of client side state management options.&lt;br /&gt;Bandwidth should be considered while implementing client side state management options because they involve in each roundtrip to server. Example: Cookies are exchanged between client and server for each page request. &lt;br /&gt;Cookie: &lt;br /&gt;&lt;br /&gt;A cookie is a small piece of text stored on user's computer. Usually, information is stored as name-value pairs. Cookies are used by websites to keep track of visitors. Every time a user visits a website, cookies are retrieved from user machine and help identify the user. &lt;br /&gt;&lt;br /&gt;Let's see an example which makes use of cookies to customize web page.&lt;br /&gt;&lt;br /&gt;if (Request.Cookies["UserId"] != null)&lt;br /&gt;    lbMessage.text = "Dear" + Request.Cookies["UserId"].Value + ", Welcome to our website!";&lt;br /&gt;else&lt;br /&gt;    lbMessage.text = "Guest,welcome to our website!";&lt;br /&gt;If you want to store client's information use the below code&lt;br /&gt;Response.Cookies["UserId"].Value=username;&lt;br /&gt;Advantages:&lt;br /&gt;• Simplicity&lt;br /&gt;Disadvantages:&lt;br /&gt;• Cookies can be disabled on user browsers &lt;br /&gt;• Cookies are transmitted for each HTTP request/response causing overhead on bandwidth &lt;br /&gt;• Inappropriate for sensitive data&lt;br /&gt;Hidden fields:&lt;br /&gt;&lt;br /&gt;Hidden fields are used to store data at the page level. As its name says, these fields are not rendered by the browser. It's just like a standard control for which you can set its properties. Whenever a page is submitted to server, hidden fields values are also posted to server along with other controls on the page. Now that all the asp.net web controls have built in state management in the form of view state and new feature in asp.net 2.0 control state, hidden fields functionality seems to be redundant. We can still use it to store insignificant data. We can use hidden fields in ASP.NET pages using following syntax&lt;br /&gt;protected System.Web.UI.HtmlControls.HtmlInputHidden Hidden1;&lt;br /&gt;&lt;br /&gt;//to assign a value to Hidden field&lt;br /&gt;Hidden1.Value="Create hidden fields";&lt;br /&gt;//to retrieve a value &lt;br /&gt;string str=Hidden1.Value;&lt;br /&gt;Advantages:&lt;br /&gt;• Simple to implement for a page specific data &lt;br /&gt;• Can store small amount of data so they take less size.&lt;br /&gt;Disadvantages:&lt;br /&gt;• Inappropriate for sensitive data &lt;br /&gt;• Hidden field values can be intercepted(clearly visible) when passed over a network&lt;br /&gt;View State:&lt;br /&gt;&lt;br /&gt;View State can be used to store state information for a single user. View State is a built in feature in web controls to persist data between page post backs. You can set View State on/off for each control using EnableViewState property. By default, EnableViewState property will be set to true. View state mechanism poses performance overhead. View state information of all the controls on the page will be submitted to server on each post back. To reduce performance penalty, disable View State for all the controls for which you don't need state. (Data grid usually doesn't need to maintain state). You can also disable View State for the entire page by adding EnableViewState=false to @page directive. View state data is encoded as binary Base64 - encoded which add approximately 30% overhead. Care must be taken to ensure view state for a page is smaller in size. View State can be used using following syntax in an ASP.NET web page.&lt;br /&gt;// Add item to ViewState&lt;br /&gt;ViewState["myviewstate"]  = myValue;&lt;br /&gt;&lt;br /&gt;//Reading items from ViewState&lt;br /&gt;Response.Write(ViewState["myviewstate"]);&lt;br /&gt;&lt;br /&gt;Advantages:&lt;br /&gt;• Simple for page level data &lt;br /&gt;• Encrypted  &lt;br /&gt;• Can be set at the control level&lt;br /&gt;Disadvantages:&lt;br /&gt;• Overhead in encoding View State values &lt;br /&gt;• Makes a page heavy&lt;br /&gt;Query strings:&lt;br /&gt;Query strings are usually used to send information from one page to another page. They are passed along with URL in clear text. Now that cross page posting feature is back in asp.net 2.0, Query strings seem to be redundant. Most browsers impose a limit of 255 characters on URL length. We can only pass smaller amounts of data using query strings. Since Query strings are sent in clear text, we can also encrypt query values. Also, keep in mind that characters that are not valid in a URL must be encoded using Server.UrlEncode.&lt;br /&gt;Let's assume that we have a Data Grid with a list of products, and a hyperlink in the grid that goes to a product detail page, it would be an ideal use of the Query String to include the product ID in the Query String of the link to the product details page (for example, productdetails.aspx?productid=4).&lt;br /&gt;When product details page is being requested, the product information can be obtained by using the following codes:&lt;br /&gt;string productid;&lt;br /&gt;productid=Request.Params["productid"];             &lt;br /&gt;Advantages:&lt;br /&gt;• Simple to Implement&lt;br /&gt;Disadvantages:&lt;br /&gt;• Human Readable  &lt;br /&gt;• Client browser limit on URL length &lt;br /&gt;• Cross paging functionality makes it redundant  &lt;br /&gt;• Easily modified by end user&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetlearn.blogspot.com/2008/05/state-management-techniques-in-aspnet-2.html"&gt;NEXT&gt;&gt;&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-5551562708173112061?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/5551562708173112061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=5551562708173112061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/5551562708173112061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/5551562708173112061'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/state-management-techniques-in-aspnet-1.html' title='State Management Techniques in ASP.NET-1'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-7137473200375220275</id><published>2008-05-03T00:14:00.000-07:00</published><updated>2008-05-03T00:15:05.525-07:00</updated><title type='text'>Interfaces and Abstract classes</title><content type='html'>Interfaces and Abstract classes &lt;br /&gt;&lt;br /&gt;Introduction&lt;br /&gt;The choice of whether to use an interface or an abstract can sometimes be a difficult one. This article shows you the differences between these two and also tells you when and where to use them. &lt;br /&gt;Interfaces&lt;br /&gt;Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. An interface represents a contract, and a class that implements an interface must implement every aspect of that interface exactly as it is defined.&lt;br /&gt;You declare an interface by using the interface keyword &lt;br /&gt;Example&lt;br /&gt;interface IPerson&lt;br /&gt;{&lt;br /&gt; void Eat();&lt;br /&gt; &lt;br /&gt; void Sleep();&lt;br /&gt; &lt;br /&gt; int Weight&lt;br /&gt;  {&lt;br /&gt;   set;&lt;br /&gt;   get;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;In order to use this interface, you must declare your class in the same way that you declare a class inheriting from any other object. &lt;br /&gt;Example&lt;br /&gt;public class Man:IPerson&lt;br /&gt;{&lt;br /&gt; int iWeight;&lt;br /&gt; &lt;br /&gt; public Man()&lt;br /&gt;  {&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; public void Eat()&lt;br /&gt;  {&lt;br /&gt;   MessageBox.Show("Man:Eat"); &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; public void Sleep()&lt;br /&gt;  {&lt;br /&gt;   MessageBox.Show("Man:Sleep"); &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; public int Weight&lt;br /&gt;  {&lt;br /&gt;   set&lt;br /&gt;   {&lt;br /&gt;    iWeight = value;&lt;br /&gt;   }&lt;br /&gt;   get&lt;br /&gt;   {&lt;br /&gt;    return iWeight;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt; static void Main()&lt;br /&gt; {&lt;br /&gt;   Man i = new Man();&lt;br /&gt;   i.Eat(); &lt;br /&gt;   i.Sleep();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You get the following result when you run the above code.&lt;br /&gt;Man:Eat&lt;br /&gt;Man:Sleep &lt;br /&gt;&lt;br /&gt;It is important to note here that an interface is very different from a base class. An interface is implemented, not extended. &lt;br /&gt;1.A class can implement multiple interfaces.&lt;br /&gt;2.An interface cannot contain data declarations but you can declare properties.&lt;br /&gt;3.All method declarations in an interface are public.&lt;br /&gt;4.There can be no implementation in an interface.&lt;br /&gt;5.The class implementing the interface must provide implementation code.&lt;br /&gt;6.An interface can be derived from another interface&lt;br /&gt;Abstract Classes&lt;br /&gt;An abstract class is a class that cannot be instantiated, but must be inherited from. An abstract class may be fully implemented, but is more usually partially implemented or not implemented at all, thereby encapsulating common functionality for inherited classes. &lt;br /&gt;&lt;br /&gt;When you have a class that contains methods that have no implementation (i.e. abstract methods), the class is said to be abstract as well. An abstract method is simply a shell or place-marker for a method that will be defined later in a derived class. The intention of abstract methods is to force every derivation of the class to implement those methods. If a derived class does not implement an abstract method, then that class must also be declared as abstract. &lt;br /&gt;&lt;br /&gt;You declare an interface by using the interface keyword &lt;br /&gt;abstract public class Person&lt;br /&gt;{&lt;br /&gt; abstract public void Eat();&lt;br /&gt; &lt;br /&gt; public void Sleep()&lt;br /&gt;  {&lt;br /&gt;   MessageBox.Show("Person:Sleep");&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  abstract public int Weight&lt;br /&gt;   {&lt;br /&gt;    set;&lt;br /&gt;    get;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;You can inherit the abstract class just like any other class. &lt;br /&gt;public class Man:Person&lt;br /&gt;{&lt;br /&gt; int iWeight;&lt;br /&gt;&lt;br /&gt; public Man()&lt;br /&gt;  {&lt;br /&gt;  }&lt;br /&gt; override public void Eat()&lt;br /&gt;  {&lt;br /&gt;   MessageBox.Show("Man:Eat"); &lt;br /&gt;  }&lt;br /&gt; override public int Weight&lt;br /&gt;  {&lt;br /&gt;   set&lt;br /&gt;    {&lt;br /&gt;     iWeight = value;&lt;br /&gt;    }&lt;br /&gt;   get&lt;br /&gt;    {&lt;br /&gt;     return iWeight;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void Main()&lt;br /&gt; {&lt;br /&gt;  Man i = new Man();&lt;br /&gt;  i.Eat(); &lt;br /&gt;  i.Sleep();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You get the following result when you execute the above code.&lt;br /&gt;Man:Eat&lt;br /&gt;Person:Sleep &lt;br /&gt;&lt;br /&gt;So why would you declare a class abstract? It’s actually a very powerful class hierarchy design tool since you can provide the structure for something that is not very specific —just like our Person class. You will never create an Person object; but you will create Man and Woman objects. The other advantage is that you are moving the code to where it actually belongs. This helps you locate program logic problems. &lt;br /&gt;&lt;br /&gt;A class that is derived from an abstract class may still implement interfaces. &lt;br /&gt;&lt;br /&gt;Abstract classes are useful when creating components because they allow you specify an invariant level of functionality in some methods, but leave the implementation of other methods until a specific implementation of that class is needed. If additional functionality is needed in derived classes, it can be added to the base class without breaking code. &lt;br /&gt;&lt;br /&gt;In the above example, an abstract class is declared with one implemented method, one unimplemented method and one unimplemented property. A class inheriting from this class would have to implement the Eat method and Weight property &lt;br /&gt;&lt;br /&gt;When implementing an abstract class, you must implement each abstract method in that class, and each implemented method must receive the same number and type of arguments, and have the same return value, as the method specified in the abstract class. &lt;br /&gt;Recommendations on using Abstract Classes and Interfaces&lt;br /&gt;1. If you anticipate creating multiple versions of your component, create an abstract class. Abstract classes provide a simple and easy way to version your components. By updating the base class, all inheriting classes are automatically updated with the change. Interfaces, on the other hand, cannot be changed once created. If a new version of an interface is required, you must create a whole new interface. &lt;br /&gt;2. If the functionality you are creating will be useful across a wide range of disparate objects, use an interface. Abstract classes should be used primarily for objects that are closely related, whereas interfaces are best suited for providing common functionality to unrelated classes. &lt;br /&gt;3. If you are designing small, concise bits of functionality, use interfaces. If you are designing large functional units, use an abstract class. &lt;br /&gt;4. If you want to provide common, implemented functionality among all implementations of your component, use an abstract class. Abstract classes allow you to partially implement your class, whereas interfaces contain no implementation for any members.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-7137473200375220275?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/7137473200375220275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=7137473200375220275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/7137473200375220275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/7137473200375220275'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/interfaces-and-abstract-classes.html' title='Interfaces and Abstract classes'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-8393335071760318830</id><published>2008-05-02T00:30:00.000-07:00</published><updated>2008-05-02T00:31:27.126-07:00</updated><title type='text'>Storing Session information</title><content type='html'>Storing Session information&lt;br /&gt;&lt;br /&gt;HTML (which is what gets displayed in your browser) is great for displaying web pages, but is a stateless protocol. So each page is dealt with as an isolated (request and response) transaction and there is no management of which browser a request came from.&lt;br /&gt;ASP.NET has the concept of a "session", which starts when a client first requests a page and ends after a definable period of inactivity. ASP.NET sends a unique cookie to the browser with each page which the browser then sends back for each subsequent page request which enables the server to associate each request with a session.&lt;br /&gt;As well as the information ASP.NET stores in the session, applications can also store information in the session through the session object.&lt;br /&gt;ASP.NET provides three methods to store session information:&lt;br /&gt;• In Process (InProc) &lt;br /&gt;• State Server &lt;br /&gt;• SQL Server &lt;br /&gt;InProc is the default method, but which is best for your application? The following is provided as a summary of the strengths and weaknesses of each:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; In Process:::&lt;br /&gt;&lt;br /&gt;Advantages:1. Default. &lt;br /&gt;2. Fastest. &lt;br /&gt;3. Simplest&lt;br /&gt;&lt;br /&gt;Disadvantages&lt;br /&gt;1. Session information lost if the worker process (either aspnet_wp.exe or w3wp.exe) is restarted (for a developer this includes a rebuild on the development machine). &lt;br /&gt;2. Not suitable for web-farms&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;State Server:::&lt;br /&gt;Advantages:&lt;br /&gt;1. Tolerant of worker process crashes. &lt;br /&gt;2. Suitable for web-farms. &lt;br /&gt;&lt;br /&gt;Disadvantages:&lt;br /&gt;1. Slower than In-Process. &lt;br /&gt;2. State is maintained on a single server, and thus a single point of failure (only an issue if site up-time and fault tolerance is an issue) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL Server:::&lt;br /&gt;&lt;br /&gt;Advantages:&lt;br /&gt;1. Tolerant of worker process crashes. &lt;br /&gt;2. Suitable for web-farms. &lt;br /&gt;3. Supports failover clusters&lt;br /&gt;&lt;br /&gt;Disadvantages:&lt;br /&gt;1. Requires SQL Server. &lt;br /&gt;2. Slowest method. &lt;br /&gt;3. Most complex to set up. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In Process&lt;br /&gt;Storing session information "In Process" (also sometimes referred to as "InProc") means that all session information is stored in the worker process "aspnet_wp.exe". It has the following advantages:&lt;br /&gt;• It is the default method - so its simple because no configuration is required on the part of the developer. &lt;br /&gt;• Is is the fastest method. &lt;br /&gt;It also has the following disadvantages:&lt;br /&gt;• All session information is lost if the aspnet_wp.exe process is restarted. This also means that session information will be lost after a recompile of the application, but there are numerous other times when the aspnet_wp.exe process will be recycled. &lt;br /&gt;• It is not suitable for use on a web-farm, i.e. where there is more than one computer that could respond to a request. This is simply because if a subsequent request is handled by a different server then that server will not have access to the session information (because the session information is stored on a different server). &lt;br /&gt;The following is the entry in the web.config file to configure session information to be stored InProc:&lt;br /&gt;&lt;sessionState&lt;br /&gt;  mode="InProc"&lt;br /&gt;  cookieless="false"&lt;br /&gt;  timeout="20" /&gt;&lt;br /&gt;The default configuration installed will also contain entries for "stateConnectionString" and "sqlConnectionString". These are default entries that are only used if the "mode" is changed and can be ignored if storing "InProc".&lt;br /&gt;State Server&lt;br /&gt;With the "State Server" model session information is stored in a separate "state server" process. The worker process (aspnet_wp.exe) will communicate with the State Server (aspnet_state.exe) to store and retrieve session information.&lt;br /&gt;If you are working in an environment where there is more than one web server then another key difference from the in-process model is that all the servers should be configured to talk to the same state server process. This is a configuration issue and it would be easy to (wrongly) configure a web farm to use separate state server process on each server.&lt;br /&gt;Storing session information in the state server has the following advantages:&lt;br /&gt;• It is tolerant of the worker process being recycled. For developers this has the advantage (or disadvantage!) that session information is maintained across compiles of the application. &lt;br /&gt;• It is suitable for use on web-farms. &lt;br /&gt;and the following disadvantages:&lt;br /&gt;• It is slightly slower and more resource demanding than the in-process model, because there is an extra level of communication required between processes. &lt;br /&gt;• State information is stored on a single server - this is not an issue normally but might be if you need to avoid a single point of failure (in which case SQL Server is the route to go because it supports failover servers). &lt;br /&gt;To configure to use the state server model requires the sessionState parameter in the web.config file to be updated:&lt;br /&gt;&lt;sessionState&lt;br /&gt;  mode="StateServer"&lt;br /&gt;  stateConnectionString="tcpip=server1:42424"&lt;br /&gt;  cookieless="false"&lt;br /&gt;  timeout="20" /&gt;&lt;br /&gt;The default entry for stateConnectionString is "stateConnectionString="tcpip=127.0.0.1:42424", this is reasonable if the state server is on the same server (The IP address 127.0.0.1 is by definition the local machine). If however you are running in a web-server environment then it is vitally important that you set the server name, so substitute the name of a server for "server1" in the above example. Otherwise each server will communicate with the state server process running locally and session information will not be shared between servers.&lt;br /&gt;You also need to ensure that the state server is running on the chosen server. Do this by looking at the services on the server and ensure that "ASP.NET State Service" is started and set to "Automatic" start-up.&lt;br /&gt;SQL Server&lt;br /&gt;In "SQL Server" mode session information is stored in an SQL Server database. The worker process (aspnet_wp.exe) will communicate with the SQL Server database to store and retrieve session information.&lt;br /&gt;SQL Mode has the following advantages:&lt;br /&gt;• Tolerant of worker process crashes. &lt;br /&gt;• Suitable for web-farms. &lt;br /&gt;• Can be configured to work in a failover cluster. Basically the session information is stored on more than one server so if a database fails then the session information is not lost. This is ideally suited to environments where high availability is required (but doesn't come cheap!). &lt;br /&gt;and the following disadvantages:&lt;br /&gt;• It requires SQL Server &lt;br /&gt;• It is the slower than both In-Proc and State-Server methods. &lt;br /&gt;• Is the most complex to set up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-8393335071760318830?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/8393335071760318830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=8393335071760318830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8393335071760318830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8393335071760318830'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/storing-session-information.html' title='Storing Session information'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-8230356829618860712</id><published>2008-05-01T00:10:00.000-07:00</published><updated>2008-05-01T00:12:20.265-07:00</updated><title type='text'>SDLC Model in Software Development</title><content type='html'>SDLC Model in Software Development&lt;br /&gt;Basic models used by  software development firms are &lt;br /&gt;a) System Development Life Cycle (SDLC) Model &lt;br /&gt;b) Prototyping Model &lt;br /&gt;c) Rapid Application Development Model &lt;br /&gt;d) Component Assembly Model &lt;br /&gt;we study the basic &lt;br /&gt;System Development Life Cycle Model (SDLC Model) &lt;br /&gt;This is also known as Classic Life Cycle Model (or) Linear Sequential Model (or) Waterfall Method. This has the following activities. &lt;br /&gt;1. System/Information Engineering and Modeling&lt;br /&gt;2. Software Requirements Analysis&lt;br /&gt;3. Systems Analysis and Design&lt;br /&gt;4. Code Generation&lt;br /&gt;5. Testing&lt;br /&gt;6. Maintenance&lt;br /&gt;&lt;br /&gt;System/Information Engineering and Modeling&lt;br /&gt;This system view is essential when software must interface with other elements such as hardware, people and other resources. System is the basic and very critical requirement for the existence of software in any entity. So if the system is not in place, the system should be engineered and put in place. In some cases, to extract the maximum output, the system should be re-engineered and spruced up. Once the ideal system is engineered or tuned, the development team studies the software requirement for the system.&lt;br /&gt;&lt;br /&gt;Software Requirement Analysis&lt;br /&gt;This is also known as feasibility study. In this phase, the development team visits the customer and studies their system. They investigate the need for possible software automation in the given system. By the end of the feasibility study, the team furnishes a document that holds the different specific recommendations for the candidate system. It also includes the personnel assignments, costs, project schedule, and target dates&lt;br /&gt;&lt;br /&gt;System Analysis and Design&lt;br /&gt;In this phase, the software development process, the software's overall structures are defined, the number of tiers needed for the package architecture, the database design, the data structure design etc are all defined in this phase. A software development model is created. The logical system of the product is developed in this phase.&lt;br /&gt;&lt;br /&gt;Code Generation&lt;br /&gt;The design must be translated into a machine-readable form. The code generation step performs this task. If the design is performed in a detailed manner, code generation can be accomplished without much complication. Programming tools like Compilers, Interpreters and Debuggers are used to generate the code. Different high level programming languages like C, C++, Pascal, and Java are used for coding. With respect to the type of application, the right programming language is chosen. &lt;br /&gt;&lt;br /&gt;Testing&lt;br /&gt;Once the code is generated, the software program testing begins. Different testing methodologies are available to unravel the bugs that were committed during the previous phases. Different testing tools and methodologies are already available.&lt;br /&gt;&lt;br /&gt;Maintenance&lt;br /&gt;Software will definitely undergo change once it is delivered to the customer. There are many reasons for the change. Change could happen because of some unexpected input values into the system. In addition, the changes in the system could directly affect the software operations. The software should be developed to accommodate changes that could happen during the post implementation period&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-8230356829618860712?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/8230356829618860712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=8230356829618860712' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8230356829618860712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8230356829618860712'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/05/sdlc-model-in-software-development.html' title='SDLC Model in Software Development'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-4182610744115303554</id><published>2008-04-30T03:24:00.000-07:00</published><updated>2008-04-30T03:26:19.392-07:00</updated><title type='text'>Partial Classes-2</title><content type='html'>The first example shows an easy solution todefining nested types.  With the power ofpartial classes, nested types can be completely isolated to their ownfiles.  DataAccessLayer is defined as partial sothat the nested type DataSourceCollection can be defined in a separatepart.  The second example is probably more of atelling of the dangers of partial types when used for no good reason.  Here we see that both the containing typeDataAccessLayer and the contained type DataSourceCollection are defined aspartial.  Hence the the definitions can bebroken into multiple parts.  Please practicecaution when using partial types, particularly with regard to nested types.  You will find that in a complex program it will bealmost impossible to determine what the full definition of any one type is onceit is defined as partial.&lt;br /&gt; &lt;br /&gt;Partialtype attributes&lt;br /&gt;Attributes on partial types are combined in anunspecified order so that the appear to all be defined on the given type.  In the preceding section we defined a typeDataAccessLayer as follows.&lt;br /&gt; &lt;br /&gt;public partial class DataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;            }    &lt;br /&gt;           &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Attributes can be added to each part of the typedefinition as follows.&lt;br /&gt; &lt;br /&gt;//Dal.cs&lt;br /&gt;[Docking]&lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;            }          &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     //dal.datasourcecollection.cs&lt;br /&gt;     [Serializable]&lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;In the above example, an different attribute hasbeen added to each part of the definition of DataAccessLayer.  To the part defined in dal.cs, the attributeDockingAttribute has been attached.  To the partdefined in dal.datasourcecollection.cs, the SerializableAttribute has beenattached.  This activity is equivalent tospecifying both attributes  on the type asfollows.&lt;br /&gt; &lt;br /&gt;[Serializable, Docking ]&lt;br /&gt; &lt;br /&gt;Inheritanceand Interface Implementation&lt;br /&gt;Now that we are done having all this fun it’s timeto lay down some rules regarding what you can and cant do with partialtypes.  To help with the discussion, it isimportant that we visualize what the end result of a partial type is.  The previous section defined a partial typeDataAccessLayer as follows.&lt;br /&gt; &lt;br /&gt;//Dal.cs&lt;br /&gt;[Docking]&lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;            }          &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     //dal.datasourcecollection.cs&lt;br /&gt;     [Serializable]&lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;This definition, once compiled, will be equivalentto the listing below.&lt;br /&gt; &lt;br /&gt;[Docking, Serializable]&lt;br /&gt;      public classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;public class DataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;            }          &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     &lt;br /&gt;The lesson here is that a partial class, no matterhow fragmented, is still on functional unit. Hence, any accessibility specifications applied to a partial type must agreewith all parts of the type that also include the accessibilityspecification.  The concept is illustrated withthe sample below.&lt;br /&gt; &lt;br /&gt;[Docking]&lt;br /&gt;      public partial classDataAccessLayer : GenericDAL&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;            }          &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     &lt;br /&gt;      internal partialclass DataAccessLayer : GenericDAL&lt;br /&gt;     {&lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;Notice that in this definition of DataAccessLayer,the two parts inherit from a base type GenericDAL.  Also notice that while one part defines the class aspublic, the other uses the internal modifier. Attempting to compile this listing will fail with the followingmessage.&lt;br /&gt; &lt;br /&gt;Error1     Partial declarations of'PartialTypes2.DataAccessLayer' have conflicting accessibilitymodifiers&lt;br /&gt; &lt;br /&gt;The reason is evident from our first demonstrationin this section.  Although DataAccessLayer isfragmented, it is still type and a type cannot be both internal and public atthe same time.&lt;br /&gt; &lt;br /&gt;The next issue is that of base classes, andis not as easy to ascertain. Examine the listing below. &lt;br /&gt; &lt;br /&gt;[Docking]&lt;br /&gt;      public partial classDataAccessLayer : GenericDAL&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;            }          &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     &lt;br /&gt;      partial classDataAccessLayer : DataSource&lt;br /&gt;     {&lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;           }&lt;br /&gt;      } &lt;br /&gt; &lt;br /&gt;Although the modifier incompatibility has beenremoved from the type, a problem persists during compilation of the abovesource.  The difference here is that the secondpart of DataAccessLayer is now attempting to inherit from a different base typeDataSource, than the first part which inherits from GenericDAL.  This might not seem intuitive because it contradictsthe combining behavior of partial type attributes; however, returning to ourinitial demonstration on the singularity of partial types, DataAccessLayer is atype; consequently, it can only inherit from one base class.  The formal rule dictates that when a partial classdeclaration includes a base class specification it must agree with all otherparts that include a base class specification. Attempting to compile the listing above would produce the following errormessage.&lt;br /&gt; &lt;br /&gt;Error1     Partial declarations of'PartialTypes2.DataAccessLayer' must not specify different base classes &lt;br /&gt; &lt;br /&gt;Now in the world of interfaces, where multipleinheritance is the game, the compining behavior returns.  Examine the example below.&lt;br /&gt; &lt;br /&gt;public partial class DataAccessLayer : GenericDAL &lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt;                       &lt;br /&gt;      }    &lt;br /&gt; &lt;br /&gt;     &lt;br /&gt;      partial classDataAccessLayer : IDataSourceManager &lt;br /&gt;     {&lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;           }&lt;br /&gt;      }&lt;br /&gt;Similar to the example in the last section, thesecond part of DataAccessLayer defines a different base than the first.  Unlike the sample in the previous section; however,IDataSourceManager is an interface and not a class.  The formal rule state that the set of baseinterfaces for a type declared in multiple parts is the union of the baseinterfaces specified on each part.  Furthermore,a particular base interface may only be named once on each part, but it ispermitted for multiple parts to name the same base interface(s).&lt;br /&gt; &lt;br /&gt;This means that the first part in the listingabove could have been defined to include the IDataSourceManager interface aswell.  The listing below illustrates.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;public partial class DataAccessLayer : GenericDAL,IDataSourceManager  &lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt;                       &lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetlearn.blogspot.com/2008/04/partial-classes.html"&gt;&lt;&lt;&lt;&lt;&lt;/a&gt;Previous&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-4182610744115303554?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/4182610744115303554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=4182610744115303554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4182610744115303554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4182610744115303554'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/partial-classes-2.html' title='Partial Classes-2'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-4118683410135670647</id><published>2008-04-30T00:16:00.000-07:00</published><updated>2008-04-30T03:27:59.681-07:00</updated><title type='text'>Partial Classes-1</title><content type='html'>Partial classes&lt;br /&gt;&lt;br /&gt;Introduction&lt;br /&gt; &lt;br /&gt;Examine the examaple below:&lt;br /&gt;&lt;br /&gt;//definition for BinaryTree.h&lt;br /&gt;class BinaryTree&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt; BinaryTree(void);&lt;br /&gt;~BinaryTree(void);&lt;br /&gt; int seed;&lt;br /&gt; char*name;&lt;br /&gt; void Load(char*name);&lt;br /&gt; char* Find();&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;In C++ the class definitions can be separated fromthe implementations.  The above snippet is takenfrom a file BinaryTree.h which contains all definitions associated with theBinaryTree class but no implementation code. Continuing with the example, the implementation file BinaryTree.cpp would bedefined as follows.&lt;br /&gt; &lt;br /&gt;#include ".\binarytree.h"&lt;br /&gt; &lt;br /&gt;BinaryTree::BinaryTree(void)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;BinaryTree::~BinaryTree(void)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;void BinaryTree::Load(char* str){&lt;br /&gt;      this-&gt;name =str;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;char* BinaryTree::Find(){&lt;br /&gt;      returnthis-&gt;name;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;As you can see from the sample, the first line ofBinaryTree.cpp explicitly declares the inclusion of the class definition foundin binarytree.h.  Consequently; this completelyseparate file can use members defined in the later as though they were definedthere. The sample is of course nonsensical but the concept neverthelessprevails; the ability to create types across multiple files.&lt;br /&gt; &lt;br /&gt;It is important to note that the idea of havingmultiple public types in one file was so revolting to the devout object orientedprogrammer at one time that entire languages, Java for instance, excludedit.  However, you will find that while it isgood programming practice to maintain all source code for a type in a singlefile, sometimes a type becomes large enough that this is an impracticalconstraint.&lt;br /&gt; &lt;br /&gt;Partials&lt;br /&gt;C# 2.0 introduces the concept of partial typedefinitions for classes, structs, and interfaces, as a means to break types in aprogram into multiple pieces to be stored in different source files for easiermaintenance and development.  This approach isparticularly useful when the need arises to use nested types or provideinterface implementation.&lt;br /&gt; &lt;br /&gt;Unlike c/C++ where an #include keyword was used toexplicitly bind the contents of a header file to the implementation file, C#2.0partial type links are inferred through the type names given.  Also, these are no interface definitions necessaryin c#2.0. A sample of a partial type is given below.&lt;br /&gt; &lt;br /&gt;//Binarytree_header.cs&lt;br /&gt;public partial class BinaryTree&lt;br /&gt;     {&lt;br /&gt;            intseed;&lt;br /&gt;            stringname;&lt;br /&gt;            publicBinaryTree()&lt;br /&gt;           {&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;The above example attempts to recreate theBinaryTree sample we saw earlier in the chapter using C#; notice that no includestatements are needed nor are any function prototypes defined. Furtherimplementation of this class may now be defined in other files, for instance aBinaryTree_Load.cs file may be created which produces more BinaryTreefunctionality.&lt;br /&gt; &lt;br /&gt;//BinaryTree_load.cs: Loadfunctionality&lt;br /&gt;      public partial classBinaryTree&lt;br /&gt;     {&lt;br /&gt;            public voidLoad(string name)&lt;br /&gt;           {&lt;br /&gt;                  this.name= name;&lt;br /&gt;           }&lt;br /&gt;           &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;We can also create another file BinaryTree_find.cswhich would have all the functionality associated with finding an element in thetree.&lt;br /&gt; &lt;br /&gt;//BinaryTree_find.cs: findfunctionality&lt;br /&gt;      public partial classBinaryTree&lt;br /&gt;     {&lt;br /&gt;            public stringFind()&lt;br /&gt;           {&lt;br /&gt;                  returnname;&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;As you can see from the above samples, the newtype modifier,partial, isused when defining a type in multiple parts. It indicates that additional partsmay exist elsewhere. I stress the word maybecause each partial type declaration is autonomous.  The example below illustrates this by creating apartial type declaration that includes no other parts.&lt;br /&gt; &lt;br /&gt;public partial class BinaryTree&lt;br /&gt;     {&lt;br /&gt; &lt;br /&gt;            intx;&lt;br /&gt; &lt;br /&gt;           &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;The code above will compile successfully. Addinganother part to the type will not change this successful compilation.&lt;br /&gt; &lt;br /&gt;public partial class BinaryTree&lt;br /&gt;     {&lt;br /&gt;            inty;&lt;br /&gt;      }&lt;br /&gt; &lt;br /&gt;Finally, a constructor can be added to instantiatethe two variables defined in both parts of the type.  A sample showing all three parts is highlightedbelow.&lt;br /&gt; &lt;br /&gt;public partial class BinaryTree&lt;br /&gt;     {&lt;br /&gt;            int x;           &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;      public partial classBinaryTree&lt;br /&gt;     {&lt;br /&gt;            inty;&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;      public partial classBinaryTree&lt;br /&gt;     {&lt;br /&gt;            publicBinaryTree()&lt;br /&gt;           {&lt;br /&gt;                  this.x =100;&lt;br /&gt;                  this.y =100;&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Each partial type declaration must include thepartial modifier and must be declared within the same namespace as the otherparts.&lt;br /&gt; &lt;br /&gt;Compiling the code above will produce thefollowing type definition.&lt;br /&gt; &lt;br /&gt;public partial class BinaryTree&lt;br /&gt;     {&lt;br /&gt;            intx;&lt;br /&gt;            inty;&lt;br /&gt;            publicBinaryTree()&lt;br /&gt;           {&lt;br /&gt;                  this.x =100;&lt;br /&gt;                  this.y =100;&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;If we compiled the BinaryTree sample from thefirst section it would produce a type definition similar to the one depictedbelow.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;public class BinaryTree&lt;br /&gt;     {&lt;br /&gt;            intseed;&lt;br /&gt;            stringname;&lt;br /&gt;            publicBinaryTree()&lt;br /&gt;           {&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            public voidLoad(string name)&lt;br /&gt;           {&lt;br /&gt;                  this.name= name;&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            public stringFind()&lt;br /&gt;           {&lt;br /&gt;                  returnname;&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;It is important to note that partial types DO NOTallow already compiled types to be extended. This is because all parts of a partial type must be compiled together such thatthe parts can be merged at compile-time to produce an actual type; as discussedin the example above.  The partial modifier, ifit appears, must appear immediately before either class, struct, or interfacekeywords, but is not itself a keyword.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;NestedPartials&lt;br /&gt;Examine the three types defined in the samplebelow.&lt;br /&gt; &lt;br /&gt;public struct DataSource&lt;br /&gt;     {&lt;br /&gt;            public stringconnectionString;&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;      public classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;             &lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return (DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;The snippet defines a struct DataSource of whichthe type DataSourceCollection is an aggregate through the items Hashtable.  This type DataSourceCollection also happens to be anested type of the DataAccessLayer type.  Usingpartial types in this scenario, the nested type DataSourceCollection may also bedeclared in multiple parts by using the partial modifier.  Hence DataAccessLayer may also be defined asfollows.&lt;br /&gt; &lt;br /&gt;public class DataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            public partialclass DataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;             &lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;                 &lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            public partialclass DataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;           &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;This would not make to much sense though, sincethe type DataSourceCollection is only qualified through its containerDataAccessLayer there is no way to specify a part outside of theDataSourceCollection type definition.  A moreoptimal approach is to define either the containing type as partial with thecontained type as not.&lt;br /&gt; &lt;br /&gt;public partial class DataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;            }    &lt;br /&gt;           &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;            public classDataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                 }&lt;br /&gt; &lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;Or to define both containing and contained partsas partial.&lt;br /&gt; &lt;br /&gt;public partial class DataAccessLayer&lt;br /&gt;     {&lt;br /&gt;           DataSourceCollection sources;&lt;br /&gt;            publicDataAccessLayer()&lt;br /&gt;           {&lt;br /&gt;                  sources =new DataSourceCollection();&lt;br /&gt;           }&lt;br /&gt; &lt;br /&gt;            publicDataSourceCollection DataSources&lt;br /&gt;           {&lt;br /&gt;                 get&lt;br /&gt;                 {&lt;br /&gt;                       return sources;&lt;br /&gt;                 }&lt;br /&gt;            }          &lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;            public partialclass DataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  Hashtableitems;&lt;br /&gt;                  publicDataSourceCollection()&lt;br /&gt;                 {&lt;br /&gt;                       items = new Hashtable();&lt;br /&gt;                  }                &lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;      public partial classDataAccessLayer&lt;br /&gt;     {&lt;br /&gt;            public partialclass DataSourceCollection&lt;br /&gt;           {&lt;br /&gt;                  publicDataSource this[string dataSourceName]&lt;br /&gt;                 {&lt;br /&gt;                       get&lt;br /&gt;                       {&lt;br /&gt;                              return(DataSource)items[dataSourceName];&lt;br /&gt;                       }&lt;br /&gt;                 }&lt;br /&gt;           }&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetlearn.blogspot.com/2008/04/partial-classes-2.html"&gt;NEXT&gt;&gt;&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-4118683410135670647?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/4118683410135670647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=4118683410135670647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4118683410135670647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4118683410135670647'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/partial-classes.html' title='Partial Classes-1'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-3700811070516678608</id><published>2008-04-30T00:14:00.001-07:00</published><updated>2008-04-30T00:14:57.343-07:00</updated><title type='text'>How to remove duplicate rows from a table in SQL Server</title><content type='html'>This article was previously published under Q139444&lt;br /&gt;SUMMARY&lt;br /&gt;Microsoft SQL Server tables should never contain duplicate rows, nor non-unique primary keys. For brevity, we will sometimes refer to primary keys as "key" or "PK" in this article, but this will always denote "primary key." Duplicate PKs are a violation of entity integrity, and should be disallowed in a relational system. SQL Server has various mechanisms for enforcing entity integrity, including indexes, UNIQUE constraints, PRIMARY KEY constraints, and triggers.&lt;br /&gt;&lt;br /&gt;Despite this, under unusual circumstances duplicate primary keys may occur, and if so they must be eliminated. One way they can occur is if duplicate PKs exist in non-relational data outside SQL Server, and the data is imported while PK uniqueness is not being enforced. Another way they can occur is through a database design error, such as not enforcing entity integrity on each table.&lt;br /&gt;&lt;br /&gt;Often duplicate PKs are noticed when you attempt to create a unique index, which will abort if duplicate keys are found. This message is: &lt;br /&gt;Msg 1505, Level 16, State 1 Create unique index aborted on duplicate key. &lt;br /&gt;If you are using SQL Server 2000 or SQL Server 2005, you may receive the following error message: &lt;br /&gt;Msg 1505, Level 16, State 1 CREATE UNIQUE INDEX terminated because a duplicate key was found for object name '%.*ls' and index name '%.*ls'. The duplicate key value is %ls. &lt;br /&gt;This article discusses how to locate and remove duplicate primary keys from a table. However, you should closely examine the process which allowed the duplicates to happen in order to prevent a recurrence.&lt;br /&gt;MORE INFORMATION&lt;br /&gt;For this example, we will use the following table with duplicate PK values. In this table the primary key is the two columns (col1, col2). We cannot create a unique index or PRIMARY KEY constraint since two rows have duplicate PKs. This procedure illustrates how to identify and remove the duplicates. &lt;br /&gt;create table t1(col1 int, col2 int, col3 char(50)) insert into t1 values (1, 1, 'data value one') insert into t1 values (1, 1, 'data value one') insert into t1 values (1, 2, 'data value two') &lt;br /&gt;The first step is to identify which rows have duplicate primary key values: &lt;br /&gt;SELECT col1, col2, count(*) FROM t1 GROUP BY col1, col2 HAVING count(*) &gt; 1 &lt;br /&gt;This will return one row for each set of duplicate PK values in the table. The last column in this result is the number of duplicates for the particular PK value.&lt;br /&gt;col1 col2 &lt;br /&gt;1 1 2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If there are only a few sets of duplicate PK values, the best procedure is to delete these manually on an individual basis. For example: &lt;br /&gt;set rowcount 1 delete from t1 where col1=1 and col2=1 &lt;br /&gt;The rowcount value should be n-1 the number of duplicates for a given key value. In this example, there are 2 duplicates so rowcount is set to 1. The col1/col2 values are taken from the above GROUP BY query result. If the GROUP BY query returns multiple rows, the "set rowcount" query will have to be run once for each of these rows. Each time it is run, set rowcount to n-1 the number of duplicates of the particular PK value.&lt;br /&gt;&lt;br /&gt;Before deleting the rows, you should verify that the entire row is duplicate. While unlikely, it is possible that the PK values are duplicate, yet the row as a whole is not. An example of this would be a table with Social Security Number as the primary key, and having two different people (or rows) with the same number, each having unique attributes. In such a case whatever malfunction caused the duplicate key may have also caused valid unique data to be placed in the row. This data should copied out and preserved for study and possible reconciliation prior to deleting the data.&lt;br /&gt;&lt;br /&gt;If there are many distinct sets of duplicate PK values in the table, it may be too time-consuming to remove them individually. In this case the following procedure can be used: &lt;br /&gt;1. First, run the above GROUP BY query to determine how many sets of duplicate PK values exist, and the count of duplicates for each set.&lt;br /&gt;2. Select the duplicate key values into a holding table. For example:&lt;br /&gt;SELECT col1, col2, col3=count(*) INTO holdkey FROM t1 GROUP BY col1, col2 HAVING count(*) &gt; 1 &lt;br /&gt;3. Select the duplicate rows into a holding table, eliminating duplicates in the process. For example:&lt;br /&gt;SELECT DISTINCT t1.* INTO holddups FROM t1, holdkey WHERE t1.col1 = holdkey.col1 AND t1.col2 = holdkey.col2 &lt;br /&gt;4. At this point, the holddups table should have unique PKs, however, this will not be the case if t1 had duplicate PKs, yet unique rows (as in the SSN example above). Verify that each key in holddups is unique, and that you do not have duplicate keys, yet unique rows. If so, you must stop here and reconcile which of the rows you wish to keep for a given duplicate key value. For example, the query: &lt;br /&gt;SELECT col1, col2, count(*) FROM holddups GROUP BY col1, col2 &lt;br /&gt;should return a count of 1 for each row. If yes, proceed to step 5 below. If no, you have duplicate keys, yet unique rows, and need to decide which rows to save. This will usually entail either discarding a row, or creating a new unique key value for this row. Take one of these two steps for each such duplicate PK in the holddups table.&lt;br /&gt;5. Delete the duplicate rows from the original table. For example:&lt;br /&gt;DELETE t1 FROM t1, holdkey WHERE t1.col1 = holdkey.col1 AND t1.col2 = holdkey.col2 &lt;br /&gt;6. Put the unique rows back in the original table. For example:&lt;br /&gt;INSERT t1 SELECT * FROM holddups &lt;br /&gt;________________________________________&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-3700811070516678608?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/3700811070516678608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=3700811070516678608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/3700811070516678608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/3700811070516678608'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/how-to-remove-duplicate-rows-from-table.html' title='How to remove duplicate rows from a table in SQL Server'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-5622066159106952465</id><published>2008-04-27T23:35:00.000-07:00</published><updated>2008-04-29T00:22:54.692-07:00</updated><title type='text'>Differences Between  VB.NET&amp; C# .NET-3</title><content type='html'>Programming Difference &lt;br /&gt;Purpose VB.NET C#&lt;br /&gt;&lt;br /&gt;Declaring Variables&lt;br /&gt;VB.NET&gt;&gt;Dim x As Integer&lt;br /&gt;           Public x As Integer = 10&lt;br /&gt;C#.NET&gt;&gt;int x;&lt;br /&gt;             int x = 10;&lt;br /&gt;&lt;br /&gt;Comments&lt;br /&gt;VB.NET&gt;&gt; ' comment&lt;br /&gt;x = 1  ' comment&lt;br /&gt;Rem comment &lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;// comment&lt;br /&gt;/* multiline&lt;br /&gt; comment */&lt;br /&gt;&lt;br /&gt;Assignment Statements&lt;br /&gt; nVal = 7&lt;br /&gt; nVal = 7;&lt;br /&gt;&lt;br /&gt;Conditional Statements&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt;If nCnt &lt;= nMax Then&lt;br /&gt;   ' Same as nTotal = &lt;br /&gt;   ' nTotal + nCnt.&lt;br /&gt;   nTotal += nCnt  &lt;br /&gt;   ' Same as nCnt = nCnt + 1.&lt;br /&gt;   nCnt += 1       &lt;br /&gt;Else&lt;br /&gt;   nTotal += nCnt&lt;br /&gt;   nCnt -= 1       &lt;br /&gt;End If &lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt;if (nCnt &lt;= nMax)&lt;br /&gt;{&lt;br /&gt;   nTotal += nCnt;&lt;br /&gt;   nCnt++;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;   nTotal +=nCnt;&lt;br /&gt;   nCnt--;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Selection Statements&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt; Select Case n&lt;br /&gt;   Case 0&lt;br /&gt;      MsgBox ("Zero")  &lt;br /&gt;     ' Visual Basic .NET exits&lt;br /&gt;     ' the Select at &lt;br /&gt;     ' the end of a Case.&lt;br /&gt;   Case 1&lt;br /&gt;      MsgBox ("One")&lt;br /&gt;   Case 2 &lt;br /&gt;      MsgBox ("Two")&lt;br /&gt;   Case Else&lt;br /&gt;      MsgBox ("Default")&lt;br /&gt;End Select&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt;&lt;br /&gt; switch(n) &lt;br /&gt;{&lt;br /&gt;   case 0:&lt;br /&gt;      Console.WriteLine("Zero");&lt;br /&gt;      break;&lt;br /&gt;   case 1:&lt;br /&gt;      Console.WriteLine("One");&lt;br /&gt;      break;&lt;br /&gt;   case 2:&lt;br /&gt;      Console.WriteLine("Two");&lt;br /&gt;      break;&lt;br /&gt;   default:&lt;br /&gt;      Console.WriteLine("?");&lt;br /&gt;      break;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;FOR Loops&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt;&lt;br /&gt;For n = 1 To 10 &lt;br /&gt;   MsgBox("The number is " &amp; n)&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;For Each prop In obj&lt;br /&gt;    prop = 42&lt;br /&gt;Next prop&lt;br /&gt; &lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt;for (int i = 1; i &lt;= 10; i++) &lt;br /&gt;   Console.WriteLine(&lt;br /&gt;      "The number is {0}", i);&lt;br /&gt;foreach(prop current in obj)&lt;br /&gt;{&lt;br /&gt;   current=42;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Hiding Base Class Members&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt;Public Class BaseCls&lt;br /&gt;   ' The element to be shadowed&lt;br /&gt;   Public Z As Integer = 100   &lt;br /&gt;   public Sub Test()&lt;br /&gt;      System.Console.WriteLine( _&lt;br /&gt;        "Test in BaseCls")&lt;br /&gt;   End Sub&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;Public Class DervCls&lt;br /&gt;   Inherits BaseCls&lt;br /&gt;   ' The shadowing element.&lt;br /&gt;   Public Shadows Z As String = "*"&lt;br /&gt;   public Shadows Sub Test()&lt;br /&gt;      System.Console.WriteLine( _&lt;br /&gt;          "Test in DervCls")&lt;br /&gt;   End Sub&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;Public Class UseClasses&lt;br /&gt;  ' DervCls widens to BaseCls. &lt;br /&gt;  Dim BObj As BaseCls = &lt;br /&gt;          New DervCls()&lt;br /&gt;  ' Access through derived &lt;br /&gt;  ' class.&lt;br /&gt;  Dim DObj As DervCls = &lt;br /&gt;       New DervCls()&lt;br /&gt;&lt;br /&gt;  Public Sub ShowZ()&lt;br /&gt;    System.Console.WriteLine( _&lt;br /&gt;     "Accessed through base "&amp;_&lt;br /&gt;     "class: "  &amp; BObj.Z)&lt;br /&gt;    System.Console.WriteLine(_&lt;br /&gt;    "Accessed through derived "&amp;_&lt;br /&gt;    "class: " &amp; DObj.Z)&lt;br /&gt;    BObj.Test()&lt;br /&gt;    DObj.Test()&lt;br /&gt;  End Sub &lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt;public class BaseCls&lt;br /&gt;{&lt;br /&gt;   // The element to be hidden&lt;br /&gt;   public int Z = 100;   &lt;br /&gt;   public void Test()&lt;br /&gt;   {&lt;br /&gt;      System.Console.WriteLine(&lt;br /&gt;        "Test in BaseCls");&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class DervCls : BaseCls&lt;br /&gt;{&lt;br /&gt;  // The hiding element&lt;br /&gt;  public new string Z = "*";   &lt;br /&gt;  public new void Test()&lt;br /&gt;  {&lt;br /&gt;    System.Console.WriteLine(&lt;br /&gt;      "Test in DervCls");&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class UseClasses&lt;br /&gt;{&lt;br /&gt;  // DervCls widens to BaseCls&lt;br /&gt;  BaseCls BObj = new DervCls();  &lt;br /&gt;   // Access through derived &lt;br /&gt;   //class &lt;br /&gt;  DervCls DObj = new DervCls();  &lt;br /&gt;  public void ShowZ()&lt;br /&gt;  {&lt;br /&gt;    System.Console.WriteLine(&lt;br /&gt;    "Accessed through " +&lt;br /&gt;      "base class: {0}", &lt;br /&gt;      BObj.Z);&lt;br /&gt;    System.Console.WriteLine(&lt;br /&gt;    "Accessed through" +&lt;br /&gt;      " derived class:{0}",&lt;br /&gt;      DObj.Z);&lt;br /&gt;    BObj.Test();&lt;br /&gt;    DObj.Test();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;WHILE Loops&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt;' Test at start of loop&lt;br /&gt;While n &lt; 100 .&lt;br /&gt;   ' Same as n = n + 1.&lt;br /&gt;   n += 1     &lt;br /&gt;End While '&lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt;while (n &lt; 100)&lt;br /&gt;   n++;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Parameter Passing by Value &lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt;' The argument Y is &lt;br /&gt;'passed by value.&lt;br /&gt;Public Sub ABC( _&lt;br /&gt;  ByVal y As Long) &lt;br /&gt;'If ABC changes y, the&lt;br /&gt;' changes do not affect x.&lt;br /&gt;End Sub&lt;br /&gt;   &lt;br /&gt;ABC(x) ' Call the procedure.&lt;br /&gt;' You can force parameters to &lt;br /&gt;' be passed by value, &lt;br /&gt;' regardless of how &lt;br /&gt;' they are declared, &lt;br /&gt;' by enclosing &lt;br /&gt;' the parameters in &lt;br /&gt;' extra parentheses.&lt;br /&gt;ABC((x)) &lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt;/* Note that there is &lt;br /&gt;no way to pass reference &lt;br /&gt;types (objects) strictly &lt;br /&gt;by value. You can choose &lt;br /&gt;to either pass the reference &lt;br /&gt;(essentially a pointer), or &lt;br /&gt;a reference to the reference &lt;br /&gt;(a pointer to a pointer).*/&lt;br /&gt;// The method:&lt;br /&gt;void ABC(int x)&lt;br /&gt;{&lt;br /&gt;   ...&lt;br /&gt;}&lt;br /&gt;// Calling the method:&lt;br /&gt;ABC(i);&lt;br /&gt;Parameter Passing by Reference&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt;Public Sub ABC(ByRef y As Long) &lt;br /&gt;' The parameter y is declared &lt;br /&gt;'by referece:&lt;br /&gt;' If ABC changes y, the changes are&lt;br /&gt;' made to the value of x.&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;ABC(x) ' Call the procedure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt;/* Note that there is no&lt;br /&gt; way to pass reference types &lt;br /&gt; (objects)  strictly by value.&lt;br /&gt; You can choose to  either &lt;br /&gt; pass the reference &lt;br /&gt; (essentially  a pointer), &lt;br /&gt; or a reference to the &lt;br /&gt; reference (a pointer to a &lt;br /&gt; pointer).*/&lt;br /&gt;// Note also that unsafe C# &lt;br /&gt;//methods can take pointers &lt;br /&gt;//just like C++ methods. For &lt;br /&gt;//details, see unsafe.&lt;br /&gt;// The method:&lt;br /&gt;void ABC(ref int x)&lt;br /&gt;{&lt;br /&gt;   ...&lt;br /&gt;}&lt;br /&gt;// Calling the method:&lt;br /&gt;ABC(ref i);&lt;br /&gt;&lt;br /&gt;Structured Exception Handling&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt;Try&lt;br /&gt;   If x = 0 Then&lt;br /&gt;      Throw New Exception( _&lt;br /&gt;         "x equals zero")&lt;br /&gt;   Else&lt;br /&gt;      Throw New Exception( _&lt;br /&gt;        "x does not equal zero")&lt;br /&gt;   End If&lt;br /&gt;Catch err As System.Exception&lt;br /&gt;   MsgBox( _&lt;br /&gt;   "Error: " &amp; Err.Description)&lt;br /&gt;Finally&lt;br /&gt;   MsgBox( _&lt;br /&gt;   "Executing finally block.")&lt;br /&gt;End Try&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt; // try-catch-finally&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;  if (x == 0)&lt;br /&gt;   throw new System.Exception(&lt;br /&gt;     "x equals zero");&lt;br /&gt;  else&lt;br /&gt;   throw new System.Exception(&lt;br /&gt;     "x does not equal zero");&lt;br /&gt;}&lt;br /&gt;catch (System.Exception err)&lt;br /&gt;{&lt;br /&gt;  System.Console.WriteLine(&lt;br /&gt;              err.Message);&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;  System.Console.WriteLine(&lt;br /&gt;   "executing finally block");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Set an Object Reference to Nothing&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt; o = Nothing&lt;br /&gt;C#.NET&gt;&gt; o = null;&lt;br /&gt;&lt;br /&gt;Initializing Value Types&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&lt;br /&gt; Dim dt as New System.DateTime( _&lt;br /&gt;  2001, 4, 12, 22, 16, 49, 844)&lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&lt;br /&gt; System.DateTime dt = &lt;br /&gt; new System.DateTime(&lt;br /&gt; 2001, 4, 12, 22, 16, &lt;br /&gt;      49, 844);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;New Features of both languages in 2005 version&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VB.NET&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;Visual Basic 2005 has many new and improved language features -- such as inheritance, interfaces, overriding, shared members, and overloading -- that make it a powerful object-oriented programming language. As a Visual Basic developer, you can now create multithreaded, scalable applications using explicit multithreading. This language has following new features,&lt;br /&gt;1. Continue Statement, which immediately skips to the next iteration of a Do, For, or While loop. &lt;br /&gt;2. IsNot operator, which you can avoid using the Not and Is operators in an awkward order. &lt;br /&gt;3. 3. Using...End. Using statement block ensures disposal of a system resource when your code leaves the block for any reason. &lt;br /&gt;4. Public Sub setbigbold( _&lt;br /&gt;5.     ByVal c As Control)&lt;br /&gt;6. Using nf As New _&lt;br /&gt;7.   System.Drawing.Font("Arial",_&lt;br /&gt;8.   12.0F, FontStyle.Bold)&lt;br /&gt;9.   c.Font = nf&lt;br /&gt;10.   c.Text = "This is" &amp;_&lt;br /&gt;11.   "12-point Arial bold"&lt;br /&gt;12. End Using&lt;br /&gt;End Sub&lt;br /&gt;13. Explicit Zero Lower Bound on an Array, Visual Basic now permits an array declaration to specify the lower bound (0) of each dimension along with the upper bound. &lt;br /&gt;14. Unsigned Types, Visual Basic now supports unsigned integer data types (UShort, UInteger, and ULong) as well as the signed type SByte. &lt;br /&gt;15. Operator Overloading, Visual Basic now allows you to define a standard operator (such as +, &amp;, Not, or Mod) on a class or structure you have defined. &lt;br /&gt;16. Partial Types, to separate generated code from your authored code into separate source files. &lt;br /&gt;17. Visual Basic now supports type parameters on generic classes, structures, interfaces, procedures, and delegates. A corresponding type argument specifies at compilation time the data type of one of the elements in the generic type. &lt;br /&gt;18. Custom Events. You can declare custom events by using the Custom keyword as a modifier for the Event statement. In a custom event, you specify exactly what happens when code adds or removes an event handler to or from the event, or when code raises the event. &lt;br /&gt;19. Compiler Checking Options, The /nowarn and /warnaserror options provide more control over how warnings are handled. Each one of these compiler options now takes a list of warning IDs as an optional parameter, to specify to which warnings the option applies. &lt;br /&gt;20. There are eight new command-line compiler options: &lt;br /&gt;a. The /codepage option specifies which codepage to use when opening source files. &lt;br /&gt;b. The /doc option generates an XML documentation file based on comments within your code. &lt;br /&gt;c. The /errorreport option provides a convenient way to report a Visual Basic internal compiler error to Microsoft. &lt;br /&gt;d. The /filealign option specifies the size of sections in your output file. &lt;br /&gt;e. The /noconfig option causes the compiler to ignore the Vbc.rsp file. &lt;br /&gt;f. The /nostdlib option prevents the import of mscorlib.dll, which defines the entire System namespace. &lt;br /&gt;g. The /platform option specifies the processor to be targeted by the output file, in those situations where it is necessary to explicitly specify it. &lt;br /&gt;h. The /unify option suppresses warnings resulting from a mismatch between the versions of directly and indirectly referenced assemblies.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C#.NET&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;&lt;br /&gt;With the release of Visual Studio 2005, the C# language has been updated to version 2.0. This language has following new features:&lt;br /&gt;1. Generics types are added to the language to enable programmers to achieve a high level of code reuse and enhanced performance for collection classes. Generic types can differ only by arity. Parameters can also be forced to be specific types. &lt;br /&gt;2. Iterators make it easier to dictate how a for each loop will iterate over a collection's contents. &lt;br /&gt;3. // Iterator Example&lt;br /&gt;4. public class NumChar&lt;br /&gt;5. {&lt;br /&gt;6. string[] saNum = { &lt;br /&gt;7.   "One", "Two", "Three", &lt;br /&gt;8.   "Four", "Five", "Six", &lt;br /&gt;9.   "Seven", "Eight", "Nine", &lt;br /&gt;10.   "Zero"};&lt;br /&gt;11. public &lt;br /&gt;12.  System.Collections.IEnumerator &lt;br /&gt;13.  GetEnumerator()&lt;br /&gt;14. {&lt;br /&gt;15. foreach (string num in saNum)&lt;br /&gt;16. yield return num;&lt;br /&gt;17. }&lt;br /&gt;18. }&lt;br /&gt;19. // Create an instance of &lt;br /&gt;20. // the collection class&lt;br /&gt;21. NumChar oNumChar = new NumChar();&lt;br /&gt;22. // Iterate through it with foreach&lt;br /&gt;23. foreach (string num in oNumChar)&lt;br /&gt;24. Console.WriteLine(num);&lt;br /&gt;25. Partial type definitions allow a single type, such as a class, to be split into multiple files. The Visual Studio designer uses this feature to separate its generated code from user code. &lt;br /&gt;26. Nullable types allow a variable to contain a value that is undefined. &lt;br /&gt;27. Anonymous Method is now possible to pass a block of code as a parameter. Anywhere a delegate is expected, a code block can be used instead: There is no need to define a new method. &lt;br /&gt;28. button1.Click += &lt;br /&gt;29.  delegate { MessageBox.Show( &lt;br /&gt; "Click!") };&lt;br /&gt;30. . The namespace alias qualifier (::) provides more control over accessing namespace members. The global :: alias allows to access the root namespace that may be hidden by an entity in your code. &lt;br /&gt;31. Static classes are a safe and convenient way of declaring a class containing static methods that cannot be instantiated. In C# v1.2 you would have defined the class constructor as private to prevent the class being instantiated. &lt;br /&gt;32. 8. There are eight new compiler options: &lt;br /&gt;a. /langversion option: Can be used to specify compatibility with a specific version of the language. &lt;br /&gt;b. /platform option: Enables you to target IPF (IA64 or Itanium) and AMD64 architectures. &lt;br /&gt;c. #pragma warning: Used to disable and enable individual warnings in code. &lt;br /&gt;d. /linkresource option: Contains additional options. &lt;br /&gt;e. /errorreport option: Can be used to report internal compiler errors to Microsoft over the Internet. &lt;br /&gt;f. /keycontainer and /keyfile: Support specifying cryptographic keys.&lt;br /&gt;&lt;br /&gt;Conclusion&lt;br /&gt;I think that this article will help you understand both language features and also you can choose a language based on your taste. I will update this article in future if there are any changes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetlearn.blogspot.com/2008/04/differences-between-vbnet-c-net-2.html"&gt;&lt;&lt;&lt;&lt;&lt;/a&gt;PREVIOUS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-5622066159106952465?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/5622066159106952465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=5622066159106952465' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/5622066159106952465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/5622066159106952465'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/differences-between-vbnet-c-net-3.html' title='Differences Between  VB.NET&amp; C# .NET-3'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-4237821281951062260</id><published>2008-04-27T23:34:00.000-07:00</published><updated>2008-04-28T23:59:33.677-07:00</updated><title type='text'>Differences Between  VB.NET&amp; C# .NET-2</title><content type='html'>Keyword Differences&lt;br /&gt;Purpose&lt;br /&gt; VB.NET&lt;br /&gt; C#&lt;br /&gt; &lt;br /&gt;Declare a variable VB.NET&lt;br /&gt; Private, Public, Friend, Protected, Static1, Shared, Dim&lt;br /&gt;Declare a variable c#.NET&lt;br /&gt; declarators (keywords include user-defined types and built-in types)&lt;br /&gt; &lt;br /&gt;Declare a named constant vb.net&lt;br /&gt; Const&lt;br /&gt;Declare a named constant c#.net&lt;br /&gt; const&lt;br /&gt; &lt;br /&gt;Create a new object vb.net&lt;br /&gt; New, CreateObject()&lt;br /&gt;Create a new object c#.net&lt;br /&gt; new&lt;br /&gt; &lt;br /&gt;Function/method does not return a value vb.net&lt;br /&gt; Sub&lt;br /&gt;Function/method does not return a value c#.net&lt;br /&gt; void&lt;br /&gt; &lt;br /&gt;Overload a function or method (Visual Basic: overload a procedure or method) vb.net&lt;br /&gt; Overloads&lt;br /&gt;Overload a function or method (Visual Basic: overload a procedure or method) c#.net&lt;br /&gt; (No language keyword required for this purpose)&lt;br /&gt; &lt;br /&gt;Refer to the current object vb.net&lt;br /&gt; Me&lt;br /&gt;Refer to the current object c#.net&lt;br /&gt; this&lt;br /&gt; &lt;br /&gt;Make a nonvirtual call to a virtual method of the current object vb.net&lt;br /&gt; MyClass&lt;br /&gt;Make a nonvirtual call to a virtual method of the current object c#.net&lt;br /&gt; n/a&lt;br /&gt; &lt;br /&gt;Retrieve character from a string&lt;br /&gt;vb.net&gt;&gt; GetChar Function&lt;br /&gt;c#.net&gt;&gt; []&lt;br /&gt; &lt;br /&gt;Declare a compound data type (Visual Basic: Structure)&lt;br /&gt; vb.net&gt;&gt;Structure &lt;members&gt; End Structure&lt;br /&gt; c#.net&gt;&gt;struct, class, interface&lt;br /&gt; &lt;br /&gt;Initialize an object (constructors)&lt;br /&gt; vb.net&gt;&gt;Sub New()&lt;br /&gt; c#.net&gt;&gt;Constructors, or system default type constructors&lt;br /&gt; &lt;br /&gt;Terminate an object directly&lt;br /&gt; vb.net&gt;&gt;n/a&lt;br /&gt; c#.net&gt;&gt; n/a&lt;br /&gt; &lt;br /&gt;Method called by the system just before garbage collection reclaims an object7&lt;br /&gt;vb.net&gt;&gt; Finalize&lt;br /&gt;c#.net&gt;&gt;destructor&lt;br /&gt; &lt;br /&gt;Initialize a variable where it is declared&lt;br /&gt; &lt;br /&gt;vb.net&gt;&gt;Dim x As Long = 5&lt;br /&gt;c#.net&gt;&gt;Dim c As New _&lt;br /&gt;   Car(FuelTypeEnum.Gas)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;// initialize to a value:&lt;br /&gt;vb.net&gt;&gt;int x = 123;&lt;br /&gt;// or use default &lt;br /&gt;// constructor:&lt;br /&gt;c#.net&gt;&gt;int x = new int();&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Take the address of a function&lt;br /&gt;vb.net&gt;&gt; AddressOf (For class members, this operator returns a reference to a function in the form of a delegate instance)&lt;br /&gt; c#.net&gt;&gt;delegate&lt;br /&gt; &lt;br /&gt;Declare that an object can be modified asynchronously&lt;br /&gt; vb.net&gt;&gt;n/a&lt;br /&gt; c#.net&gt;&gt; volatile&lt;br /&gt; &lt;br /&gt;Force explicit declaration of variables&lt;br /&gt; vb.net&gt;&gt;Option Explicit&lt;br /&gt; c#.net&gt;&gt;n/a. (All variables must be declared prior to use)&lt;br /&gt; &lt;br /&gt;Test for an object variable that does not refer to an object&lt;br /&gt; vb.net&gt;&gt;obj = Nothing&lt;br /&gt; c#.net&gt;&gt;obj == null&lt;br /&gt; &lt;br /&gt;Value of an object variable that does not refer to an object&lt;br /&gt;vb.net&gt;&gt; Nothing&lt;br /&gt;c#.net&gt;&gt; null&lt;br /&gt; &lt;br /&gt;Test for a database null expression&lt;br /&gt; vb.net&gt;&gt;IsDbNull&lt;br /&gt; c#.net&gt;&gt;n/a&lt;br /&gt; &lt;br /&gt;Test whether a Variant variable has been initialized&lt;br /&gt; vb.net&gt;&gt;n/a&lt;br /&gt; c#.net&gt;&gt;n/a&lt;br /&gt; &lt;br /&gt;Define a default property&lt;br /&gt; vb.net&gt;&gt;Default&lt;br /&gt; c#.net&gt;&gt;by using indexers&lt;br /&gt; &lt;br /&gt;Refer to a base class&lt;br /&gt; vb.net&gt;&gt;MyBase &lt;br /&gt;c#.net&gt;&gt;base&lt;br /&gt; &lt;br /&gt;Declare an interface&lt;br /&gt; vb.net&gt;&gt;Interface&lt;br /&gt; c#.net&gt;&gt;interface&lt;br /&gt; &lt;br /&gt;Specify an interface to be implemented&lt;br /&gt; vb.net&gt;&gt;Implements (statement)&lt;br /&gt; c#.net&gt;&gt;class C1 : I1&lt;br /&gt; &lt;br /&gt;Declare a class&lt;br /&gt; vb.net&gt;&gt;Class &lt;implementation&gt;&lt;br /&gt; c#.net&gt;&gt;class&lt;br /&gt; &lt;br /&gt;Specify that a class can only be inherited. An instance of the class cannot be created.&lt;br /&gt;vb.net&gt;&gt; MustInherit &lt;br /&gt; c#.net&gt;&gt;abstract&lt;br /&gt; &lt;br /&gt;Specify that a class cannot be inherited&lt;br /&gt;vb.net&gt;&gt; NotInheritable &lt;br /&gt; c#.net&gt;&gt;sealed&lt;br /&gt; &lt;br /&gt;Declare an enumerated type&lt;br /&gt;vb.net&gt;&gt; Enum &lt;members&gt; End Enum&lt;br /&gt;c#.net&gt;&gt;enum&lt;br /&gt; &lt;br /&gt;Declare a class constant&lt;br /&gt;vb.net&gt;&gt; Const&lt;br /&gt;c#.net&gt;&gt;const (Applied to a field declaration)&lt;br /&gt; &lt;br /&gt;Derive a class from a base class&lt;br /&gt;vb.net&gt;&gt; Inherits C2 &lt;br /&gt;c#.net&gt;&gt;class C1 : C2&lt;br /&gt; &lt;br /&gt;Override a method&lt;br /&gt; vb.net&gt;&gt;Overrides&lt;br /&gt;c#.net&gt;&gt; override&lt;br /&gt; &lt;br /&gt;Declare a method that must be implemented in a deriving class&lt;br /&gt;vb.net&gt;&gt; MustOverride&lt;br /&gt;c#.net&gt;&gt; abstract&lt;br /&gt; &lt;br /&gt;Declare a method that can't be overridden&lt;br /&gt;vb.net&gt;&gt; NotOverridable (Methods are not overridable by default.)&lt;br /&gt;c#.net&gt;&gt; sealed&lt;br /&gt; &lt;br /&gt;Declare a virtual method, property (Visual Basic), or property accessor (C#, C++)&lt;br /&gt; vb.net&gt;&gt;Overridable&lt;br /&gt;c#.net&gt;&gt; virtual&lt;br /&gt; &lt;br /&gt;Hide a base class member in a derived class&lt;br /&gt;vb.net&gt;&gt; Shadowing&lt;br /&gt;c#.net&gt;&gt; n/a&lt;br /&gt; &lt;br /&gt;Declare a typesafe reference to a class method&lt;br /&gt;vb.net&gt;&gt; Delegate&lt;br /&gt;c#.net&gt;&gt;delegate&lt;br /&gt; &lt;br /&gt;Specify that a variable can contain an object whose events you wish to handle&lt;br /&gt;vb.net&gt;&gt; WithEvents&lt;br /&gt;c#.net&gt;&gt; (Write code - no specific keyword)&lt;br /&gt; &lt;br /&gt;Specify the events for which an event procedure will be called&lt;br /&gt;vb.net&gt;&gt; Handles (Event procedures can still be associated with a WithEvents variable by naming pattern.)&lt;br /&gt;c#.net&gt;&gt; n/a&lt;br /&gt; &lt;br /&gt;Evaluate an object expression once, in order to access multiple members&lt;br /&gt; &lt;br /&gt;vb.net&gt;&gt;With objExpr &lt;br /&gt;  &lt;.member&gt;&lt;br /&gt;  &lt;.member&gt; &lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;c#.net&gt;&gt;n/a&lt;br /&gt; &lt;br /&gt;Structured exception handling&lt;br /&gt; &lt;br /&gt;vb.net&gt;&gt;Try &lt;attempt&gt;&lt;br /&gt;Catch&lt;br /&gt;&lt;handle errors&gt;&lt;br /&gt;Finally&lt;br /&gt;&lt;always execute&gt;&lt;br /&gt;End Try&lt;br /&gt;&lt;br /&gt;c#.net&gt;&gt; try, catch, finally, throw&lt;br /&gt; &lt;br /&gt;Decision structure (selection)&lt;br /&gt;vb.net&gt;&gt; Select Case ..., Case, Case Else, End Select&lt;br /&gt; c#.net&gt;&gt;switch, case, default, goto, break&lt;br /&gt; &lt;br /&gt;Decision structure (if ... then)&lt;br /&gt; vb.net&gt;&gt;If ... Then, ElseIf ... Then, Else, End If&lt;br /&gt;c#.net&gt;&gt; if, else&lt;br /&gt; &lt;br /&gt;Loop structure (conditional)&lt;br /&gt;vb.net&gt;&gt; While, Do [While, Until] ..., Loop [While, Until]&lt;br /&gt;c#.net&gt;&gt;do, while, continue&lt;br /&gt; &lt;br /&gt;Loop structure (iteration)&lt;br /&gt;vb.net&gt;&gt; For ..., [Exit For], Next&lt;br /&gt;For Each ..., [Exit For,] Next&lt;br /&gt;c#.net&gt;&gt; for, foreach&lt;br /&gt; &lt;br /&gt;Declare an array&lt;br /&gt; &lt;br /&gt;vb.net&gt;&gt;Dim a() As Long&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;c#.net&gt;&gt;int[] x = new int[5];&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Initialize an array&lt;br /&gt; &lt;br /&gt;vb.net&gt;&gt;Dim a() As Long = {3, 4, 5}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;c#.net&gt;&gt;int[] x = new int[5] {&lt;br /&gt;        1, 2, 3, 4, 5};&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Reallocate array&lt;br /&gt;vb.net&gt;&gt; Redim&lt;br /&gt;c#.net&gt;&gt; n/a&lt;br /&gt; &lt;br /&gt;Visible outside the project or assembly&lt;br /&gt; vb.net&gt;&gt;Public&lt;br /&gt;c#.net&gt;&gt; public&lt;br /&gt; &lt;br /&gt;Invisible outside the assembly (C#/Visual Basic) or within the package (Visual J#, JScript)&lt;br /&gt;vb.net&gt;&gt; Friend&lt;br /&gt;c#.net&gt;&gt; internal&lt;br /&gt; &lt;br /&gt;Visible only within the project (for nested classes, within the enclosing class)&lt;br /&gt; vb.net&gt;&gt;Private&lt;br /&gt;c#.net&gt;&gt; private&lt;br /&gt; &lt;br /&gt;Accessible outside class and project or module&lt;br /&gt;vb.net&gt;&gt; Public&lt;br /&gt; c#.net&gt;&gt;public&lt;br /&gt; &lt;br /&gt;Accessible outside the class, but within the project&lt;br /&gt;vb.net&gt;&gt; Friend&lt;br /&gt;c#.net&gt;&gt;internal&lt;br /&gt; &lt;br /&gt;Only accessible within class or module &lt;br /&gt;vb.net&gt;&gt; Private&lt;br /&gt;c#.net&gt;&gt; private&lt;br /&gt; &lt;br /&gt;Only accessible to current and derived classes&lt;br /&gt;vb.net&gt;&gt; Protected &lt;br /&gt;c#.net&gt;&gt; protected&lt;br /&gt; &lt;br /&gt;Preserve procedure's local variables&lt;br /&gt;vb.net&gt;&gt; Static&lt;br /&gt; c#.net&gt;&gt;n/a&lt;br /&gt; &lt;br /&gt;Shared by all instances of a class&lt;br /&gt;vb.net&gt;&gt; Shared &lt;br /&gt;c#.net&gt;&gt; static&lt;br /&gt; &lt;br /&gt;Comment code&lt;br /&gt;vb.net&gt;&gt; '&lt;br /&gt;               Rem&lt;br /&gt;c#.net&gt;&gt; //, /* */ for multi-line comments&lt;br /&gt;/// for XML comments&lt;br /&gt; &lt;br /&gt;Case-sensitive?&lt;br /&gt;vb.net&gt;&gt; No&lt;br /&gt;c#.net&gt;&gt; Yes&lt;br /&gt; &lt;br /&gt;Call Windows API&lt;br /&gt; vb.net&gt;&gt;Declare &lt;API&gt;&lt;br /&gt;c#.net&gt;&gt; use Platform Invoke&lt;br /&gt; &lt;br /&gt;Declare and raise an event&lt;br /&gt;vb.net&gt;&gt; Event, RaiseEvent&lt;br /&gt;c#.net&gt;&gt;event&lt;br /&gt; &lt;br /&gt;Threading primitives&lt;br /&gt;vb.net&gt;&gt; SyncLock&lt;br /&gt;c#.net&gt;&gt; lock&lt;br /&gt; &lt;br /&gt;Go to&lt;br /&gt;vb.net&gt;&gt; Goto&lt;br /&gt;c#.net&gt;&gt; goto&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Data types Differences &lt;br /&gt;Purpose/Size&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Decimal&lt;br /&gt; vb.net&gt;&gt;Decimal &lt;br /&gt;c#.net&gt;&gt; decimal&lt;br /&gt; &lt;br /&gt;Date&lt;br /&gt; vb.net&gt;&gt;Date&lt;br /&gt;c#.net&gt;&gt; DateTime&lt;br /&gt; &lt;br /&gt;(varies)&lt;br /&gt;vb.net&gt;&gt; String &lt;br /&gt;c#.net&gt;&gt; string&lt;br /&gt; &lt;br /&gt;1 byte&lt;br /&gt;vb.net&gt;&gt; Byte&lt;br /&gt;c#.net&gt;&gt; byte&lt;br /&gt; &lt;br /&gt;2 bytes&lt;br /&gt; vb.net&gt;&gt;Boolean&lt;br /&gt;c#.net&gt;&gt; bool&lt;br /&gt; &lt;br /&gt;2 bytes&lt;br /&gt;vb.net&gt;&gt; Short, Char (Unicode character)&lt;br /&gt;c#.net&gt;&gt;short, char (Unicode character)&lt;br /&gt; &lt;br /&gt;4 bytes&lt;br /&gt;vb.net&gt;&gt; Integer&lt;br /&gt;c#.net&gt;&gt; int&lt;br /&gt; &lt;br /&gt;8 bytes&lt;br /&gt;vb.net&gt;&gt; Long&lt;br /&gt;c#.net&gt;&gt; long&lt;br /&gt; &lt;br /&gt;4 bytes&lt;br /&gt; vb.net&gt;&gt;Single&lt;br /&gt;c#.net&gt;&gt; float&lt;br /&gt; &lt;br /&gt;8 bytes&lt;br /&gt;vb.net&gt;&gt; Double&lt;br /&gt;c#.net&gt;&gt; double&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Operators Differences &lt;br /&gt;Purpose&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Integer division&lt;br /&gt; vb.net&gt;&gt;\&lt;br /&gt;c#.net&gt;&gt; /&lt;br /&gt; &lt;br /&gt;Modulus (division returning only the remainder)&lt;br /&gt;vb.net&gt;&gt; Mod&lt;br /&gt;c#.net&gt;&gt; %&lt;br /&gt; &lt;br /&gt;Exponentiation&lt;br /&gt; vb.net&gt;&gt;^&lt;br /&gt;c#.net&gt;&gt; n/a&lt;br /&gt; &lt;br /&gt;Integer division Assignment&lt;br /&gt; vb.net&gt;&gt;\=&lt;br /&gt;c#.net&gt;&gt; /=&lt;br /&gt; &lt;br /&gt;Concatenate&lt;br /&gt; vb.net&gt;&gt;&amp;= NEW&lt;br /&gt;c#.net&gt;&gt;+=&lt;br /&gt; &lt;br /&gt;Modulus&lt;br /&gt; vb.net&gt;&gt;n/a&lt;br /&gt; c#.net&gt;&gt;%=&lt;br /&gt; &lt;br /&gt;Bitwise-AND&lt;br /&gt;vb.net&gt;&gt; n/a&lt;br /&gt;c#.net&gt;&gt; &amp;=&lt;br /&gt; &lt;br /&gt;Bitwise-exclusive-OR&lt;br /&gt;vb.net&gt;&gt; n/a&lt;br /&gt;c#.net&gt;&gt;^=&lt;br /&gt; &lt;br /&gt;Bitwise-inclusive-OR&lt;br /&gt; vb.net&gt;&gt;n/a&lt;br /&gt;c#.net&gt;&gt; |=&lt;br /&gt; &lt;br /&gt;Equal&lt;br /&gt;vb.net&gt;&gt; =&lt;br /&gt;c#.net&gt;&gt; ==&lt;br /&gt; &lt;br /&gt;Not equal&lt;br /&gt; vb.net&gt;&gt;&lt;&gt; &lt;br /&gt;c#.net&gt;&gt; !=&lt;br /&gt; &lt;br /&gt;Compare two object reference variables&lt;br /&gt;vb.net&gt;&gt; Is&lt;br /&gt;c#.net&gt;&gt;==&lt;br /&gt; &lt;br /&gt;Compare object reference type&lt;br /&gt;vb.net&gt;&gt; TypeOf x Is Class1&lt;br /&gt;c#.net&gt;&gt; x is Class1 &lt;br /&gt; &lt;br /&gt;Concatenate strings&lt;br /&gt;vb.net&gt;&gt; &amp;&lt;br /&gt;c#.net&gt;&gt;+&lt;br /&gt; &lt;br /&gt;Shortcircuited Boolean AND&lt;br /&gt; vb.net&gt;&gt;AndAlso&lt;br /&gt;c#.net&gt;&gt;&amp;&amp;&lt;br /&gt; &lt;br /&gt;Shortcircuited Boolean OR&lt;br /&gt; vb.net&gt;&gt;OrElse&lt;br /&gt;c#.net&gt;&gt; ||&lt;br /&gt; &lt;br /&gt;Scope resolution&lt;br /&gt;vb.net&gt;&gt; .&lt;br /&gt;c#.net&gt;&gt; . and base&lt;br /&gt; &lt;br /&gt;Array element&lt;br /&gt;vb.net&gt;&gt; ()&lt;br /&gt;c#.net&gt;&gt; [ ]&lt;br /&gt; &lt;br /&gt;Type cast&lt;br /&gt;vb.net&gt;&gt; Cint, CDbl, ..., CType&lt;br /&gt;c#.net&gt;&gt; (type)&lt;br /&gt; &lt;br /&gt;Postfix increment&lt;br /&gt;vb.net&gt;&gt; n/a&lt;br /&gt;c#.net&gt;&gt; ++&lt;br /&gt; &lt;br /&gt;Postfix decrement&lt;br /&gt; vb.net&gt;&gt;n/a&lt;br /&gt;c#.net&gt;&gt; --&lt;br /&gt; &lt;br /&gt;Indirection&lt;br /&gt;vb.net&gt;&gt; n/a&lt;br /&gt;c#.net&gt;&gt; * (unsafe mode only)&lt;br /&gt; &lt;br /&gt;Address of&lt;br /&gt;vb.net&gt;&gt; AddressOf&lt;br /&gt;c#.net&gt;&gt; &amp; (unsafe mode only; also see fixed)&lt;br /&gt; &lt;br /&gt;Logical-NOT&lt;br /&gt;vb.net&gt;&gt; Not&lt;br /&gt;c#.net&gt;&gt; !&lt;br /&gt; &lt;br /&gt;One's complement&lt;br /&gt;vb.net&gt;&gt; Not&lt;br /&gt; c#.net&gt;&gt;~&lt;br /&gt; &lt;br /&gt;Prefix increment&lt;br /&gt;vb.net&gt;&gt; n/a&lt;br /&gt; c#.net&gt;&gt;++&lt;br /&gt; &lt;br /&gt;Prefix decrement&lt;br /&gt;vb.net&gt;&gt; n/a&lt;br /&gt; c#.net&gt;&gt;--&lt;br /&gt; &lt;br /&gt;Size of type&lt;br /&gt;vb.net&gt;&gt; n/a&lt;br /&gt; c#.net&gt;&gt;sizeof&lt;br /&gt; &lt;br /&gt;Bitwise-AND&lt;br /&gt; vb.net&gt;&gt;And&lt;br /&gt;c#.net&gt;&gt; &amp;&lt;br /&gt; &lt;br /&gt;Bitwise-exclusive-OR&lt;br /&gt;vb.net&gt;&gt; Xor&lt;br /&gt;c#.net&gt;&gt;^&lt;br /&gt; &lt;br /&gt;Bitwise-inclusive-OR&lt;br /&gt; vb.net&gt;&gt;Or&lt;br /&gt;c#.net&gt;&gt; |&lt;br /&gt; &lt;br /&gt;Logical-AND&lt;br /&gt;vb.net&gt;&gt; And&lt;br /&gt; c#.net&gt;&gt;&amp;&amp;&lt;br /&gt; &lt;br /&gt;Logical-OR&lt;br /&gt;vb.net&gt;&gt; Or&lt;br /&gt;c#.net&gt;&gt; ||&lt;br /&gt; &lt;br /&gt;Conditional&lt;br /&gt; vb.net&gt;&gt;If Function ()&lt;br /&gt;c#.net&gt;&gt; ?:&lt;br /&gt; &lt;br /&gt;Pointer to member&lt;br /&gt; vb.net&gt;&gt;n/a&lt;br /&gt;c#.net&gt;&gt; . (Unsafe mode only)&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Programming Difference&lt;br /&gt;&lt;a href="http://dotnetlearn.blogspot.com/2008/04/differences-between-vbnet-c-net-1.html"&gt;&lt;&lt;&lt;&lt;&lt;/a&gt;PREVOIUS &lt;br /&gt; &lt;a href="http://dotnetlearn.blogspot.com/2008/04/differences-between-vbnet-c-net-3.html"&gt;NEXT&gt;&gt;&gt;&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-4237821281951062260?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/4237821281951062260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=4237821281951062260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4237821281951062260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4237821281951062260'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/differences-between-vbnet-c-net-2.html' title='Differences Between  VB.NET&amp; C# .NET-2'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-6001416232364659351</id><published>2008-04-27T23:32:00.000-07:00</published><updated>2008-04-28T23:31:38.041-07:00</updated><title type='text'>Differences Between  VB.NET&amp; C# .NET-1</title><content type='html'>Contents&lt;br /&gt;Introduction&lt;br /&gt;Advantages of both languages&lt;br /&gt;Keyword Differences&lt;br /&gt;Data types Differences&lt;br /&gt;Operators Differences&lt;br /&gt;Programming Difference&lt;br /&gt;New Features of both languages in 2005 version&lt;br /&gt;Conclusion&lt;br /&gt;History&lt;br /&gt;Introduction&lt;br /&gt;Some people like VB.NET's natural language, case-insensitive approach, others like C#'s terse syntax. But both have access to the same framework libraries. We will discuss about the differences in the following topics:&lt;br /&gt;Advantages of both languages&lt;br /&gt;Keyword Differences&lt;br /&gt;Data types Differences&lt;br /&gt;Operators Differences&lt;br /&gt;Programming Difference&lt;br /&gt;Advantages of both languages&lt;br /&gt;&lt;br /&gt;VB.net Advantages&lt;br /&gt;&lt;br /&gt;Support for optional parameters - very handy for some COM interoperability.&lt;br /&gt;Support for late binding with Option Strict off - type safety at compile time goes out of the window, but legacy libraries which don't have strongly typed interfaces become easier to use.&lt;br /&gt;Support for named indexers.&lt;br /&gt;Various legacy VB functions (provided in the Microsoft.VisualBasic namespace, and can be used by other languages with a reference to the Microsoft.VisualBasic.dll). Many of these can be harmful to performance if used unwisely, however, and many people believe they should be avoided for the most part.&lt;br /&gt;The with construct: it's a matter of debate as to whether this is an advantage or not, but it's certainly a difference.&lt;br /&gt;Simpler (in expression - perhaps more complicated in understanding) event handling, where a method can declare that it handles an event, rather than the handler having to be set up in code.&lt;br /&gt;The ability to implement interfaces with methods of different names. (Arguably this makes it harder to find the implementation of an interface, however.)&lt;br /&gt;Catch ... When ... clauses, which allow exceptions to be filtered based on runtime expressions rather than just by type.&lt;br /&gt;The VB.NET parts of Visual Studio .NET compiles your code in the background. While this is considered as an advantage for small projects, people creating very large projects have found that the IDE slows down considerably as the project gets larger.&lt;br /&gt;&lt;br /&gt;IN C#.net Advantages&lt;br /&gt;&lt;br /&gt;XML documentation generated from source code comments. (This is coming in VB.NET with Whidbey (the code name for the next version of Visual Studio and .NET), and there are tools which will do it with existing VB.NET code already.)&lt;br /&gt;Operator overloading - again, coming to VB.NET in Whidbey.&lt;br /&gt;Language support for unsigned types (you can use them from VB.NET, but they aren't in the language itself). Again, support for these is coming to VB.NET in Whidbey.&lt;br /&gt;The using statement, which makes unmanaged resource disposal simple.&lt;br /&gt;Explicit interface implementation, where an interface which is already implemented in a base class can be re-implemented separately in a derived class. Arguably this makes the class harder to understand, in the same way that member hiding normally does.&lt;br /&gt;Unsafe code. This allows pointer arithmetic etc, and can improve performance in some situations. However, it is not to be used lightly, as a lot of the normal safety of C# is lost (as the name implies). Note that unsafe code is still managed code, i.e., it is compiled to IL, JITted, and run within the CLR.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetlearn.blogspot.com/2008/04/differences-between-vbnet-c-net-2.html"&gt;NEXT&gt;&gt;&gt;&gt; &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-6001416232364659351?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/6001416232364659351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=6001416232364659351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/6001416232364659351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/6001416232364659351'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/differences-between-vbnet-c-net-1.html' title='Differences Between  VB.NET&amp; C# .NET-1'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-8461565920819734033</id><published>2008-04-24T23:59:00.000-07:00</published><updated>2008-04-25T00:01:15.966-07:00</updated><title type='text'>Generics</title><content type='html'>Generic Method Creation&lt;br /&gt; &lt;br /&gt; A generic method is a method that can process a value whose type is known only when the variable is accessed. To create a generic method, on the right side of the name of the method, type the &lt;&gt; operator. Inside of this operator, enter a letter or a name, which is referred to as parameter type. Here is an example:&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;TypeOfValue&gt;()&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;One of the ways you can use the parameter type is to pass an argument to the method. You do this by preceding the name of the argument with the parameter type. Here is an example:&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;TypeOfValue&gt;(TypeOfValue value)&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;In the body of the method, you can process the argument as you see fit. At a minimum, and based on our earlier program, you can simply display the value by passing it to the Console.WriteLine() method. Here is an example:&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;TypeOfValue&gt;(TypeOfValue value)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine(value);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;By tradition, most programmers and most documents use the letter T for the parameter type.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Creating a Generic Method&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;To create a generic method, change the ShowItem() method as follows:&lt;br /&gt;  public void ShowItem&lt;T&gt;(T item)&lt;br /&gt;{&lt;br /&gt;      Console.WriteLine("Item: {0}", item);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Calling a Generic Method&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;As mentioned earlier, one of the particularities of a generic method is that, at the time it is defined, the method doesn't know the type of the parameter. This means that, when calling the method, you must make sure you clearly specify the type of value that will be processed. You can do this by directly passing (a constant of) the type of value that the method will process. Here are different examples of calling our Show() method:&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;TypeOfValue&gt;(TypeOfValue value)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine(value);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Exercise&lt;br /&gt;{&lt;br /&gt;    static int Main()&lt;br /&gt;    {&lt;br /&gt;        var exo = new Generator();&lt;br /&gt;&lt;br /&gt;        // Call the version of the function that displays an integer&lt;br /&gt;        var Value1 = 246;&lt;br /&gt;        exo.Show(Value1);&lt;br /&gt;&lt;br /&gt;        // Call the version of the function that displays a character&lt;br /&gt;        var Value2 = 'G';&lt;br /&gt;        exo.Show(Value2);&lt;br /&gt;&lt;br /&gt;        // Call the version of the function that displays a decimal&lt;br /&gt;        var Value3 = 355.65;&lt;br /&gt;        exo.Show(Value3);&lt;br /&gt;        &lt;br /&gt;        return 0;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;When complied and executed, this program would produce:&lt;br /&gt;&lt;br /&gt;246&lt;br /&gt;G&lt;br /&gt;355.65&lt;br /&gt;Press any key to continue . . .&lt;br /&gt;&lt;br /&gt;A Generic Method With Various Parameter Types&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;As seen above, you can pass different arguments to a method. You can also pass different parameter types, in any appropriate order of your choice, to a method. To pass two parameter types to a method, inside its &lt;&gt; operator, enter the names of two parameter types separated by a comma. Here is an example:&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;FirstType, SecondType&gt;()&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;If you want to use the parameter types, you can pass an argument for each to the method. Remember that each parameter type represents a data type; so you can use it as the type of an argument. Here are examples:&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;FirstType, SecondType&gt;(FirstType first,&lt;br /&gt;                                            SecondType second)&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;In the body of the method, you can then use the arguments as you see fit. For example, you can display their values by passing them to the Console.WriteLine() method. Here is an example:&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;FirstType, SecondType&gt;(FirstType first,&lt;br /&gt;                                            SecondType second)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("First:  {0}\nSecond: {1}\n", first, second);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;Calling a Generic Method With Various Parameter Types&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;To call a method that takes various parameters, you can simply pass it the value of each argument. Here is an example:&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;FirstType, SecondType&gt;(FirstType first,&lt;br /&gt;                                            SecondType second)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("First:  {0}\nSecond: {1}\n", first, second);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Exercise&lt;br /&gt;{&lt;br /&gt;    static int Main()&lt;br /&gt;    {&lt;br /&gt;        var exo = new Generator();&lt;br /&gt;        &lt;br /&gt;        var iValue = 246;&lt;br /&gt;        var message = "Some Message";&lt;br /&gt;        exo.Show(message, iValue);&lt;br /&gt;&lt;br /&gt;        return 0;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;This would produce:&lt;br /&gt;&lt;br /&gt;First:  Some Message&lt;br /&gt;Second: 246&lt;br /&gt;&lt;br /&gt;Press any key to continue . . .&lt;br /&gt;An alternative is to specify the type of each argument. To do this, inside the &lt;&gt; operator on the right side of the name of the method, enter the data types separated by a comma. Here are examples:&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;public class Generator&lt;br /&gt;{&lt;br /&gt;    public void Show&lt;FirstType, SecondType&gt;(FirstType first,&lt;br /&gt;                                            SecondType second)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("First:  {0}\nSecond: {1}\n", first, second);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Exercise&lt;br /&gt;{&lt;br /&gt;    static int Main()&lt;br /&gt;    {&lt;br /&gt;        var exo = new Generator();&lt;br /&gt;        &lt;br /&gt;        var iValue = 246;&lt;br /&gt;        var message = "Some Message";&lt;br /&gt;        exo.Show(message, iValue);&lt;br /&gt;&lt;br /&gt;        iValue = 85;&lt;br /&gt;        var cValue = 'G';&lt;br /&gt;        exo.Show&lt;int, char&gt;(iValue, cValue);&lt;br /&gt;&lt;br /&gt;        var weeklyHours = 42.50d;&lt;br /&gt;        var hourlySalary = 25.05;&lt;br /&gt;        exo.Show&lt;double, double&gt;(weeklyHours, hourlySalary);&lt;br /&gt;&lt;br /&gt;        return 0;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;This would produce:&lt;br /&gt;&lt;br /&gt;First:  Some Message&lt;br /&gt;Second: 246&lt;br /&gt;&lt;br /&gt;First:  85&lt;br /&gt;Second: G&lt;br /&gt;&lt;br /&gt;First:  42.5&lt;br /&gt;Second: 25.05&lt;br /&gt;&lt;br /&gt;Press any key to continue . . .&lt;br /&gt;&lt;br /&gt;Notice that the arguments can be of the same type or different types. It is up to you to determine the type of a particular argument when calling the method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-8461565920819734033?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/8461565920819734033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=8461565920819734033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8461565920819734033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8461565920819734033'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/generics.html' title='Generics'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-6336444566148347565</id><published>2008-04-24T00:31:00.000-07:00</published><updated>2008-04-24T00:32:32.417-07:00</updated><title type='text'>Software Design Patterns</title><content type='html'>This article is an introduction to Software Design Patterns. "Design Patterns" sounds new to a guy frm visual basic  background . hmm. What  you mean by "Design Patterns" for Software. Is it a new terminology just coined for software alone. Nope.. Its there in all fields !!!!.&lt;br /&gt;&lt;br /&gt;So lets discuss what is Software Design Patterns from a developer perspective.&lt;br /&gt;&lt;br /&gt;Design Patterns are pre-defined solutions  to design problems in any software development. In our day-to-day life we are coming across lot of similiar problems and there are n- number of ways of solve the same.. But have u ever thing that the same problem which u solved can be handled in a different or a better method which is already defined..&lt;br /&gt;&lt;br /&gt;Are you looking for a definition for Design patterns ? &lt;br /&gt;&lt;br /&gt;"Design patterns are recurring solutions to software design problems you find again and again in real-world application development. Design patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges" &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Gang of Four patterns is the base for all software design patterns available :-&lt;br /&gt;&lt;br /&gt;GoF is caategorized into three groups&lt;br /&gt;&lt;br /&gt;   1. Creational&lt;br /&gt;   2. Structural&lt;br /&gt;   3. Behavioral&lt;br /&gt;&lt;br /&gt;Just to summarize each group, here is the list of all 23 software design patterns &lt;br /&gt;&lt;br /&gt;Creational Design Patterns&lt;br /&gt;&lt;br /&gt;1. Abstract Factory&lt;br /&gt;2. Factory Method&lt;br /&gt;3. Prototype&lt;br /&gt;4. Builder&lt;br /&gt;5. Singleton&lt;br /&gt;&lt;br /&gt;Structural Design Patterns&lt;br /&gt;&lt;br /&gt;6. Adapter&lt;br /&gt;7. Bridge&lt;br /&gt;8. Composite&lt;br /&gt;9. Decorator&lt;br /&gt;10.Facade&lt;br /&gt;11.Flyweight&lt;br /&gt;12.proxy&lt;br /&gt;&lt;br /&gt;Behavioural Patterns&lt;br /&gt;&lt;br /&gt;13. Chain of Responsibility&lt;br /&gt;14. Command&lt;br /&gt;15. Interpreter&lt;br /&gt;16. Iterator&lt;br /&gt;17. Mediator&lt;br /&gt;18. Memento&lt;br /&gt;19. Observer&lt;br /&gt;20. State&lt;br /&gt;21. Strategy&lt;br /&gt;22. Template Method&lt;br /&gt;23. Visitor&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this will help you to get a general understanding of Software Design Patterns. In the &lt;br /&gt;Upcoming sections I would like to discuss each design patterns in-depth&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-6336444566148347565?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/6336444566148347565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=6336444566148347565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/6336444566148347565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/6336444566148347565'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/software-design-patterns.html' title='Software Design Patterns'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-8534472440390571797</id><published>2008-04-23T00:28:00.000-07:00</published><updated>2008-04-23T00:31:26.754-07:00</updated><title type='text'>OOPS Concepts by Example</title><content type='html'>I assume that you are familar with the following OOP&lt;br /&gt;concepts; classes, objects, attributes, methods, types. If not, then this article might not be&lt;br /&gt;in your realm. I'd suggest starting with the basic concepts of C++ before you attempt to&lt;br /&gt;understand the more indepth concepts that I'll be discussing in this article. When we&lt;br /&gt;speak of OOP concepts, the conversation usually revolves around encapsulation,&lt;br /&gt;inheritance and polymorphism. This is what I will attempt to describe in this article.&lt;br /&gt;Inheritance&lt;br /&gt;Let us start by defining inheritnace. A very good website for finding computer science&lt;br /&gt;definitions is http://www.whatis.com. The definitions in this article are stolen from that&lt;br /&gt;website.&lt;br /&gt;Definition: Inheritance&lt;br /&gt;Inheritance is the concept that when a class of object is defined, any subclass that is&lt;br /&gt;defined can inherit the definitions of one or more general classes. This means for the&lt;br /&gt;programmer that an object in a subclass need not carry its own definition of data and&lt;br /&gt;methods that are generic to the class (or classes) of which it is a part. This not only&lt;br /&gt;speeds up program development; it also ensures an inherent validity to the defined&lt;br /&gt;subclass object (what works and is consistent about the class will also work for the&lt;br /&gt;subclass).&lt;br /&gt;The simple example in C++ is having a class that inherits a data member from its parent&lt;br /&gt;class.&lt;br /&gt;class A&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;integer d;&lt;br /&gt;};&lt;br /&gt;class B : public A&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;};&lt;br /&gt;The class B in the example does not have any direct data member does it? Yes, it does. It&lt;br /&gt;inherits the data member d from class A. When one class inherits from another, it&lt;br /&gt;acquires all of its methods and data. We can then instantiate an object of class B and call&lt;br /&gt;into that data member.&lt;br /&gt;void func()&lt;br /&gt;{&lt;br /&gt;B b;&lt;br /&gt;b.d = 10;&lt;br /&gt;};&lt;br /&gt;www.kbcafe.com&lt;br /&gt;Copyright 2001-2002 Randy Charles Morin&lt;br /&gt;Polymorphism&lt;br /&gt;Inheritance is a very easy concept to understand. Polymorphism on the other hand is&lt;br /&gt;much harder. Polymorphism is about an objects ability to provide context when methods&lt;br /&gt;or operators are called on the object.&lt;br /&gt;Definition: Polymorphism&lt;br /&gt;In object-oriented programming, polymorphism (from the Greek meaning "having&lt;br /&gt;multiple forms") is the characteristic of being able to assign a different meaning to a&lt;br /&gt;particular symbol or "operator" in different contexts.&lt;br /&gt;The simple example is two classes that inherit from a common parent and implement the&lt;br /&gt;same virtual method.&lt;br /&gt;class A&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;virtual void f()=0;&lt;br /&gt;};&lt;br /&gt;class B&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;virtual void f()&lt;br /&gt;{std::cout &lt;&lt; "Hello from B" &lt;&lt; std::endl;};&lt;br /&gt;};&lt;br /&gt;class C&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;virtual void f()&lt;br /&gt;{std::cout &lt;&lt; "Hello from C" &lt;&lt; std::endl;};&lt;br /&gt;};&lt;br /&gt;I&lt;br /&gt;f I have an object A, then calling the method f() will produce different results depending&lt;br /&gt;on the context, the real type of the object A.&lt;br /&gt;func(A &amp; a)&lt;br /&gt;{&lt;br /&gt;A.f();&lt;br /&gt;};&lt;br /&gt;Encapsulation&lt;br /&gt;The least understood of the three concepts is encapsulation. Sometimes, encapsulation is&lt;br /&gt;also called protection or information hiding. In fact, encapsulation, protection and&lt;br /&gt;information hiding are three overlapping concepts.&lt;br /&gt;Definition: Encapsulation&lt;br /&gt;Encapsulation is the inclusion within a program object of all the resources need for&lt;br /&gt;the object to function - basically, the method and the data. The object is said to&lt;br /&gt;"publish its interfaces." Other objects adhere to these interfaces to use the object&lt;br /&gt;without having to be concerned with how the object accomplishes it. The idea is&lt;br /&gt;"don't tell me how you do it; just do it." An object can be thought of as a selfcontained&lt;br /&gt;atom. The object interface consists of public methods and instantiate data.&lt;br /&gt;Protection and information hiding are techniques used to accomplish encapsulation of an&lt;br /&gt;object. Protection is when you limit the use of class data or methods. Information hiding&lt;br /&gt;www.kbcafe.com&lt;br /&gt;Copyright 2001-2002 Randy Charles Morin&lt;br /&gt;is when you remove data, methods or code from a class's public interface in order to&lt;br /&gt;refine the scope of an object. So how are these three concepts implemented in C++?&lt;br /&gt;You'll remember that C++ classes have a public, protected and private interface. Moving&lt;br /&gt;methods or data from public to protected or to private, you are hiding the information&lt;br /&gt;from the public or protected interface. If you have a class A with one public integer data&lt;br /&gt;member d, then the C++ definition would be...&lt;br /&gt;class A&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;integer d;&lt;br /&gt;};&lt;br /&gt;I&lt;br /&gt;f you moved that data member from the public scope of the private scope, then you&lt;br /&gt;would be hiding the member. Better said, you are hiding the member from the public&lt;br /&gt;interface.&lt;br /&gt;class A&lt;br /&gt;{&lt;br /&gt;private:&lt;br /&gt;integer d;&lt;br /&gt;};&lt;br /&gt;I&lt;br /&gt;t is important to note that information hiding are not the same as encapsulation. Just&lt;br /&gt;because you protect or hide methods or data, does not mean you are encapsulating an&lt;br /&gt;object. But the ability to protect or hide methods or data, provide the ability to&lt;br /&gt;encapsulate an object. You might say that encapsulating is the proper use of protection&lt;br /&gt;and information hiding. As an example, if I used information hiding to hide members that&lt;br /&gt;should clearly be in the public interface, then I am using information hiding techniques,&lt;br /&gt;but I am not encapsulating the class. In fact, I am doing the exact opposite (unencapsulating&lt;br /&gt;the class). Do not get the idea that encapsulation is only information&lt;br /&gt;hiding. Encapsulation is a lot more. Protection is another way of encapsulating a class.&lt;br /&gt;Protection is about adding methods and data to a class. When you add methods or data to&lt;br /&gt;a class, then you are protecting the methods or data from use without first having an&lt;br /&gt;object of the class. In the previous example, the data member d cannot be used except as&lt;br /&gt;a data member of an object of class A. It is being protected from use outside of this&lt;br /&gt;scenario. I have also heard many computer scientist use information hiding and&lt;br /&gt;protection interchangeably. In this case, the scientist takes the meaning of protection and&lt;br /&gt;assign it to information hiding. This is quite acceptable. Although I'm no historian, I&lt;br /&gt;believe the definition of information hiding has taken some turns over the years. But I do&lt;br /&gt;believe it is stabilizing on the definition I presented here.&lt;br /&gt;Abstraction&lt;br /&gt;Another OOP concept related to encapsulation that is less widely used but gaining ground&lt;br /&gt;is abstration.&lt;br /&gt;Definition: Abstraction&lt;br /&gt;Through the process of abstraction, a programmer hides all but the relevant data about&lt;br /&gt;an object in order to reduce complexity and increase efficiency. In the same way that&lt;br /&gt;abstraction sometimes works in art, the object that remains is a representation of the&lt;br /&gt;original, with unwanted detail omitted. The resulting object itself can be referred to as&lt;br /&gt;www.kbcafe.com&lt;br /&gt;Copyright 2001-2002 Randy Charles Morin&lt;br /&gt;an abstraction, meaning a named entity made up of selected attributes and behavior&lt;br /&gt;specific to a particular usage of the originating entity.&lt;br /&gt;The example presented is quite simple. Human's are a type of land animal and all land&lt;br /&gt;animals have a number of legs. The C++ definition of this concept would be...&lt;br /&gt;class LandAnimal&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;virtual int NumberOfLegs()=0;&lt;br /&gt;};&lt;br /&gt;class Human : public LandAnimal&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;virtual int NumberOfLegs()&lt;br /&gt;{return 2;};&lt;br /&gt;};&lt;br /&gt;The method NumberOfLegs in LangAnimal is said to be a pure virtual function. An&lt;br /&gt;abstract class is said to be any class with at least one pure virtual function. Here I have&lt;br /&gt;created a class LandAnimal that is abstract. It can be said that the LandAnimal class was&lt;br /&gt;abstracted from the commonality between all types of land animals, or at least those that I&lt;br /&gt;care about. Other land animals can derive there implementation from the same class.&lt;br /&gt;class Elephant : public LandAnimal&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;virtual int NumberOfLegs()&lt;br /&gt;{return 4;};&lt;br /&gt;};&lt;br /&gt;Although I cannot create an instance of the class LandAnimal, I can pass derived&lt;br /&gt;instances of the class to a common function without having to implement this function for&lt;br /&gt;each type of LandAnimal.&lt;br /&gt;bool HasTwoLegs(LandAnimal &amp; x)&lt;br /&gt;{&lt;br /&gt;return (x.NumberOfLegs()==2);&lt;br /&gt;};&lt;br /&gt;There is also a less rigid definition of abstraction that would include classes that without&lt;br /&gt;pure virtual functions, but that should not be directly instantiated. A more rigid definition&lt;br /&gt;of abstraction is called purely abstract classes. A C++ class is said to be purely abstract, if&lt;br /&gt;the class only contains pure virtual functions. The LandAnimal class was such a class.&lt;br /&gt;Purely abstract classes are often called interfaces, protocol classes and abstract base&lt;br /&gt;classes.&lt;br /&gt;More Concepts&lt;br /&gt;Another growing concept in OOP is dynamic and static binding. Most languages provide&lt;br /&gt;one or the other. C++ provides both. A method that is not virtual is said to be statically&lt;br /&gt;bound, whereas virtual methods are said to be dynamically bound. Non-virtual methods&lt;br /&gt;are statically bound, because the binding of the method is performed at compile and link&lt;br /&gt;time and cannot be changed. Virtual methods are dynamically bound, because the binding&lt;br /&gt;of the method is actually performed at run-time. When you call a virtual method, a small&lt;br /&gt;lookup is performed in the object virtual table (a.k.a. vtable) to find the address of the&lt;br /&gt;method being called. By manipulating an objects vtable at run-time, the target address&lt;br /&gt;www.kbcafe.com&lt;br /&gt;Copyright 2001-2002 Randy Charles Morin&lt;br /&gt;can be altered. Four other growing OOP concepts are persistance, concurrency, reflection&lt;br /&gt;and object composition. I will not discuss these here, but maybe in a later article. Hope&lt;br /&gt;this article proves informative and thank you for your time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-8534472440390571797?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/8534472440390571797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=8534472440390571797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8534472440390571797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8534472440390571797'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/04/oops-concepts-by-example.html' title='OOPS Concepts by Example'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-4609475948543695323</id><published>2008-03-12T23:12:00.000-07:00</published><updated>2008-03-12T23:15:13.647-07:00</updated><title type='text'>OOPS &amp; C#</title><content type='html'>&lt;span style="color:#000000;"&gt;OOP &amp;amp; C#&lt;br /&gt;The skeleton of object - oriented programming is of course the concepts of class. This C# tutorial&lt;/span&gt;&lt;span style="color:#000000;"&gt; on OOPS explains classes and their importance in implementation of object ? oriented principles.&lt;br /&gt;Any language can be called object ? oriented if it has data and method that use data encapsulated in items named objects. An object ? oriented programming method has many advantages, some of them are flexibility and code reusability.&lt;br /&gt;All the programming languages&lt;/span&gt;&lt;span style="color:#000000;"&gt; supporting Object oriented Programming will be supporting these three main concepts:&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;Encapsulation&lt;br /&gt;Inheritance&lt;br /&gt;Polymorphism&lt;br /&gt;Encapsulation in C#:&lt;br /&gt;Encapsulation is process of keeping data and methods together inside objects. In this way &lt;/span&gt;&lt;a class="kLink" oncontextmenu="return false;" id="KonaLink3" onmouseover="adlinkMouseOver(event,this,3);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,3);" onmouseout="adlinkMouseOut(event,this,3);" href="http://www.codersource.net/csharp_tutorial_oops.html#" target="_top"&gt;&lt;span style="color:#000000;"&gt;developer&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#000000;"&gt; must define some methods of object?s interaction. In C# , encapsulation is realized through the classes. A Class can contain data structures and methods. Consider the following class.&lt;br /&gt;public class Aperture{&lt;br /&gt;public Aperture(){}protected double height;protected double width;protected double thickness;public double GetVolume(){&lt;br /&gt;double volume = height*width*thickness;if(volume&lt;0)return isoutside =" true;" ap =" new"&gt;&lt;span style="color:#000000;"&gt;you need to run .NET console and run the next command: csc filename.cs . &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-4609475948543695323?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/4609475948543695323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=4609475948543695323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4609475948543695323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/4609475948543695323'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2008/03/oops-c.html' title='OOPS &amp; C#'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-8766530273856460818</id><published>2007-07-14T00:02:00.000-07:00</published><updated>2007-07-14T00:04:59.610-07:00</updated><title type='text'>TELUGULiterature</title><content type='html'>Carrying forward the job of introducing Telugu literature, the literature of apeople, belonging to the second highest language group in India i।e. Telugu, though we haveconfined much to the modern literature, in the mix of works presented there is a vintage qualityto the stories section, and the poetry represents a few important current voices. Stories of Chaso,and Souris are part of that genre, and of Kethu Viswanatha Reddy , Chaganti Tulasi and VaaralaKrishnamurthy deal with different subjects. The cover page painting is an artistic representationof Sri Sri’s poem “Avataram’ ( The manifestation) from his magnum Opus “Maha Prashanam”wherein the poet draws many images, invoking the awesome power of the downtrodden.The times are so interesting that the indomitable human will expressed through the art of writingis having a close encouner with the brusque nature of the State, in its different avatars. Writers,as always, the famous and the persecuted lot, have remained the beacons of hope, optimism, andvision befitting the challenges waiting for us in this third millennium.The work of the Mosaic team is on behalf of the entire Telugu writers of past and the present,and we humbly anticipate that the support from writers and connoisseurs of literature will go along way in keeping us ticking.A Nobel for a voice of reason, going to Orhan Pamuk, a Man-Booker landing in the lap of anyoung Indian writer Kiran Desai for her efficient portrayal of human dilemmas, and above all fora poetic initiative, taking poetry confined to the bound volumes, and book release functions,to the bubbling and vibrant people in the troubled land of Columbia, and for drawing worldwide attention to the trauma of the people in this drug infested and violence marred state, byraising a human voice of protest, and unfurling the flag of peace in the blood soaked streets ofMedellin, and other cities of Columbia, the Right Livelihood Award, announced to a Communityof literary artists, and to their activities, though lesser known in the hierarchy of awards, definitelystands out, as the most important event of the season.Being the one of its kind effort in the field of Telugu Literature, to bring out the works of Englishtranslations of different authors in the journal form, ( after the efforts by Srinivas Rayaprol, wayback in 1950s, bringing out “The East &amp; West”), the Mosaic team intends to create an intenseawareness about the importance of translation of talented works and introducing them to theworld readership, or literary readership across the continents, as the recent Nobel laureate OrhanPamuk said, and in this direction, it is high time that we organize translators conferencesperiodically, and establish a translators forum, to discuss the issues at hand, and to draw the roadmap for future activities.“Men are powerless only when they admit they are” said Sartre, and in building an intellectualnetworking activity, for long lasting peace and harmony all over the world and for achieving thegoal of human empowerment, let us commit ourselves to the diffusion of ideas, which is possibleonly through literature, though speaking in many tongues, the same message.Our work is before you to examine, analyze and to give us your valuable feedback for improvement.Please participate in this quest for excellence and we look forward to your contribution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-8766530273856460818?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/8766530273856460818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=8766530273856460818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8766530273856460818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/8766530273856460818'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2007/07/teluguliterature.html' title='TELUGULiterature'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6171124407563382566.post-6182392377821630685</id><published>2007-07-13T23:34:00.000-07:00</published><updated>2007-07-13T23:35:11.847-07:00</updated><title type='text'>MODERN ART</title><content type='html'>Documenta's Mission to Explain Modern Art&lt;br /&gt;By R. Jay Magill, Jr. and Tanja Maka&lt;br /&gt;Can the masses appreciate modern art? The Documenta art extravaganza in Kassel is betting they can. For the first time ever, organizers are doing everything they can to help locals to understand the art -- and art-lovers to understand the locals.&lt;br /&gt;&lt;a href="http://www.spiegel.de/international/germany/0,1518,grossbild-898204-489189,00.html"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.spiegel.de/international/germany/0,1518,grossbild-898204-489189,00.html"&gt;&lt;/a&gt;&lt;br /&gt;Andrea Geyer&lt;br /&gt;Can art be explained? Documenta thinks it can.A ship made out of gas canisters. Rows of wooden chairs. Three orange computer screens. Self-strumming guitars. What do these things mean? And why are they all housed in a giant, corrugated-plastic shack?&lt;br /&gt;Many contemporary art exhibitions are perplexing. And this year's Documenta, which runs from June 16 to Sept. 23, doesn't break the mold. Except for one major exception. Unlike the others that have preceded it, Documenta 12 has a deliberate educational component. The event, which takes place in Kassel every five years, is determined to allow non-experts entry into the hermetic realm of contemporary art.&lt;br /&gt;Through educational programming, guided tours, community outreach programs, three magazines, and, they claim, the art itself, organizers of this year's Documenta aim to enlighten rather than confuse.&lt;br /&gt;"Education at this Documenta is not a service or tool," Ruth Noack, Documenta 12's curator, told SPIEGEL ONLINE. "It is, instead, an integral part of the exhibition."&lt;br /&gt;This is a radical move for Documenta, which has often been seen by Kasselers in its 52-year history as an elitist ship that docks in the city every five years for 100 days and then departs -- leaving little in its wake aside from millions in city-wide income. Taxi drivers will lament the traffic but condone the extra clients. Many residents will spot pretentiousness without haste. But as Ralf Knecht, a musician and lifelong Kassler, says, Documenta has long since been dubbed by locals as "doggemenda," -- a rendering of the show's name in local dialect that makes a mockery of the international art world.&lt;br /&gt;PHOTO GALLERY: DOCUMENTA 12 SHOWCASES BEST OF CONTEMPORARY ART&lt;br /&gt;&lt;a title="Fotostrecke zeigen..." onclick="window.open('/fotostrecke/0,5538,22412,00.html','SPONbiga_3',SpOnENV_BigaPopupParams_3).focus();return false;" href="http://www.spiegel.de/fotostrecke/0,5538,22412,00.html" target="SPONbiga_3"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a title="Fotostrecke zeigen..." onclick="window.open('/fotostrecke/0,5538,22412,00.html','SPONbiga_3',SpOnENV_BigaPopupParams_3).focus();return false;" href="http://www.spiegel.de/fotostrecke/0,5538,22412,00.html" target="SPONbiga_3"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a title="Fotostrecke zeigen..." onclick="window.open('/fotostrecke/0,5538,22412,00.html','SPONbiga_3',SpOnENV_BigaPopupParams_3).focus();return false;" href="http://www.spiegel.de/fotostrecke/0,5538,22412,00.html" target="SPONbiga_3"&gt;&lt;/a&gt;&lt;br /&gt;Click on a picture to launch the image gallery (17 Photos)We're the Kids of Documenta&lt;br /&gt;The next 100 days, though, are supposed to be different. In order to achieve its educational, egalitarian ends, Documenta 12 has enlisted the help of a multitude of tour guides (or "mediators") -- an idea from the show's artistic director, Roger M. Buergel, Noack's mustachioed, articulate husband. And they're not solely in the form of starving German college students. High school students will be a part of it, as will younger children. Additionally, people from across the globe, including from South Africa and Australia, will take part thanks to help from the Goethe Institute.&lt;br /&gt;Charlotte Huddleston, a curator from New Zealand serving on the education team, told SPIEGEL ONLINE: "Yes, the show is a slow burner. This time around, though, it's OK to say that you don't know about something if you don't, rather than make things up. Everything feels more open."&lt;br /&gt;The education team reaches deep into the youth pool, too. For those aged 6 to 11, there's the "Hatching" program, so named because it invites children to draw and make photographs in a quiet area designated to foster creativity. Claudia Hummel, in charge of the program, was elated to receive funding for the entire endeavor from the German Education Ministry. The children's activities aim to involve them in art -- rather than serve as cover for babysitting -- and hopes that youngsters will then ask their parents about what they found interesting, bringing young and old into dialogue.&lt;br /&gt;There are also 60 adolescents, aged 13 to 19, from 12 schools in and around Kassel, that will give after-school and weekend tours, each of which lasts an hour and a half or longer. "Far from being oblivious to art," notes Ulrich Schötker, Documenta's director of education, "high-school students are experts of their own ways of seeing."&lt;br /&gt;&lt;a href="http://www.spiegel.de/international/germany/0,1518,grossbild-898211-489189,00.html"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.spiegel.de/international/germany/0,1518,grossbild-898211-489189,00.html"&gt;&lt;/a&gt;&lt;br /&gt;Frank Schinski / Documenta&lt;br /&gt;Documenta this year has enlisted the help of children and students to help locals understand the exhibit and visitors to understand Kassel."For me it's been a great experience," says Till Maciejewski, an athletic-built 10th-grader who has been working on his tour since October. "It's more about discussions with people than about art questions," he says, "and I get to talk about the art that I think is interesting, like Juan Davila," a Chilean artist whose work from the 1970s features pornography, bestiality, and other social taboos. "Because my aunt and uncle are also artists, there's family pride to be helping out at Documenta."&lt;br /&gt;Sonja Parzefall, a recent graduate of the University of Lüneburg, in northern Germany, has led the high-schoolers program, which has the official title "Inhabiting the World," since October 2006. "These are not your traditional guided art tours," she says. "It's not an 'art history' education, but rather a way for visitors to begin a discussion about the works themselves. The high-school students have been entirely committed and enthused, even though it can be daunting."&lt;br /&gt;Indeed. Documenta, at a total cost of €19 million, includes over 500 works of art by 113 artists and occupies five buildings, one of which, the Aue-Pavillion, was constructed solely for the exhibit over a sprawling 10,000 square meters (107,640 square feet). As students became increasingly involved in tackling this behemoth, their status in school -- and self-confidence -- changed, too. "One 13-year-old," Parzefall smilingly recounts, "told me that her classmates had made fun of her for joining the artsy Documenta team. Now they are jealous."&lt;br /&gt;The Practice of Democratic Aesthetics&lt;br /&gt;The education offensive is also taking on the adult world. The Advisory Board -- the first ever in Documenta's history -- is a 40-person committee of Kassel residents attempting to fuse the exhibit with the community. Discussion tents, spaces for exhibit goers to try their hand at artistic creation, and a number of excursions in and around Kassel are all part of the package.&lt;br /&gt;Some of the planned events even have a practical bent. Gottfried Schubert, who has lived on a 50-person commune for the past 17 years, will be leading a discussion which will bring the socially disadvantaged together with political elite to discuss practical solutions to economic problems. "We're enthusiastic to have a platform where otherwise unseen citizens will have a chance to voice their opinions about their lives," Schubert says.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://service.spiegel.de/backoffice/newsletter-service.do?product=spon-en-newsletter" target="_top"&gt;&lt;/a&gt;It's about time that Documenta's curators are taking account of the community surrounding the show, says Ayse Gülec, education director at a three-decade-old community center and head of the Advisory Board. "Documenta has always said that visitors should experience the world through art," she says. "Well, Kassel is part of the world. And the various ethnic groups at our center are international -- Albanian, Spanish, Turkish, Afghan, Iranian, and about a hundred more."&lt;br /&gt;But are such noble goals really possible to meet? On a recent walk through the exhibit as part of an English-speaking press tour, the German and South African guides seemed befuddled at how not to behave in a "hierarchical" manner, how to debunk notions of "privileged" interpretation, how exactly to open up the "discourses of culture." Especially while standing in front of seven toy tanks that had been deep fried in dough.&lt;br /&gt;"The notion that art can never entirely be explained," Documenta's artistic director writes, "is exactly where art's power lies." It's a powerful sentiment, and the educators and activists involved are anxious to see what occurs in the next 100 days, to see if art's power can truly conquer modernity's load-bearing walls of economic, cultural, and social segregation.&lt;br /&gt;After those 100 days, however, who knows? Asked if she thought Documenta's efforts at inclusion, outreach, and education would succeed in future renditions of the show, civic leader Güleç leaned forward and smirked, "What do you think?"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6171124407563382566-6182392377821630685?l=dotnetlearn.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetlearn.blogspot.com/feeds/6182392377821630685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6171124407563382566&amp;postID=6182392377821630685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/6182392377821630685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6171124407563382566/posts/default/6182392377821630685'/><link rel='alternate' type='text/html' href='http://dotnetlearn.blogspot.com/2007/07/modern-art.html' title='MODERN ART'/><author><name>navin kumar</name><uri>http://www.blogger.com/profile/02983510610085893545</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03066637008497565486'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>