<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PROGRAMMER DESK &#187; .Net</title>
	<atom:link href="http://vinayhatwal.wordpress.com/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://vinayhatwal.wordpress.com</link>
	<description>Accept Changes To Develop Good Solutions</description>
	<lastBuildDate>Sun, 02 Aug 2009 10:34:20 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='vinayhatwal.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/fddfa1cd68a112c3fb6eca04033658e3?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>PROGRAMMER DESK &#187; .Net</title>
		<link>http://vinayhatwal.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vinayhatwal.wordpress.com/osd.xml" title="PROGRAMMER DESK" />
		<item>
		<title>Inheritance</title>
		<link>http://vinayhatwal.wordpress.com/2009/06/16/inheritance/</link>
		<comments>http://vinayhatwal.wordpress.com/2009/06/16/inheritance/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 08:48:51 +0000</pubDate>
		<dc:creator>vinayhatwal</dc:creator>
				<category><![CDATA[Inheritance]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[Access Specifires]]></category>
		<category><![CDATA[MustInherit]]></category>
		<category><![CDATA[MustOverride]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[NonInheritable]]></category>
		<category><![CDATA[OPPS]]></category>
		<category><![CDATA[Overridable]]></category>
		<category><![CDATA[override]]></category>
		<category><![CDATA[Overrides]]></category>
		<category><![CDATA[sealed]]></category>
		<category><![CDATA[Shadows]]></category>
		<category><![CDATA[virtual]]></category>

		<guid isPermaLink="false">http://vinayhatwal.wordpress.com/?p=143</guid>
		<description><![CDATA[Inheritance
Written by – Vinay Hatwal
Dt. 16-Jun-2009
                                                                               
Inheritance is the OOPs concept in which new classes form from the existing classes i.e. using the class functionality in the new classes. Inheritance was first introduced in 1967 for Simula, a language which was used for simulation so the name is Simula.
Inheritance is intended to help reuse existing code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=143&subd=vinayhatwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="center">Inheritance</p>
<p align="center">Written by – Vinay Hatwal</p>
<p align="center">Dt. 16-Jun-2009</p>
<p>                                                                               </p>
<p>Inheritance is the OOPs concept in which new classes form from the existing classes i.e. using the class functionality in the new classes. Inheritance was first introduced in 1967 for <a title="Simula" href="http://en.wikipedia.org/wiki/Simula">Simula</a>, a language which was used for simulation so the name is Simula.</p>
<p>Inheritance is intended to help <a title="Reusability" href="http://en.wikipedia.org/wiki/Reusability">reuse</a> existing code with little or no modification. Inheritance is also sometimes called generalization, because the <a title="Is-a" href="http://en.wikipedia.org/wiki/Is-a">is-a</a> relationships represent a hierarchy between classes of objects.</p>
<p>For Example, A “vehicle” is the generalization of “Car”, “Scooter”, “Bus” etc and the “Car”, “Scooter”, ”Bus” are the specialization of the “Vehicle”. Because the “Car” is a Vehicle so “Car” naturally inherits properties common to the entire vehicle like Color, No of Wheels, and EnginPower etc.</p>
<p>Following example show the inheritance in action. Shape is the Base Class and Square , Rectangle amd Circle are the classes derived from Shape Class and inherits all the functionality of the Shape class the shows the specialisation of the Shape Class.</p>
<div id="attachment_144" class="wp-caption aligncenter" style="width: 494px"><img class="size-full wp-image-144" title="in" src="http://vinayhatwal.files.wordpress.com/2009/06/in.jpg?w=484&#038;h=466" alt="Inheritance" width="484" height="466" /><p class="wp-caption-text">Inheritance</p></div>
<p><strong><span style="text-decoration:underline;">Inheritance in Action</span></strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>VB.NET</strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Public Class BaseClass</p>
<p> </p>
<p>End Class</p>
<p> </p>
<p> </p>
<p>Public Class DerivedClass</p>
<p>    Inherits BaseClass</p>
<p> </p>
<p>End Class</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>C#.NET</strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>public class BaseClass</p>
<p>{</p>
<p>}</p>
<p> </p>
<p>public class DerivedClass : BaseClass</p>
<p>{</p>
<p>}</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span style="text-decoration:underline;"> </span></p>
<p><span style="text-decoration:underline;"> </span></p>
<p><span style="text-decoration:underline;"> </span></p>
<p>Above DerivedClass Will contain all the inheritable funtionality of the BaseClass. Inheritane can be used in</p>
<p><strong> </strong></p>
<p><strong>VB.NET – Inherits</strong></p>
<p><strong>C#.NET &#8211; :</strong></p>
<p> </p>
<p><span style="text-decoration:underline;"> </span></p>
<p><span style="text-decoration:underline;"> </span></p>
<p><span style="text-decoration:underline;">Access Specifires</span></p>
<p> </p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="227" valign="top"><strong>Functionality</strong></td>
<td width="175" valign="top"><strong>VB.NET</strong></td>
<td width="157" valign="top"><strong>C#.NET</strong></td>
</tr>
<tr>
<td width="227" valign="top">Gives variable public access which means that there is no restriction on their accessibility</td>
<td width="175" valign="top">Public</td>
<td width="157" valign="top">public</td>
</tr>
<tr>
<td width="227" valign="top">Gives variable private access which means that they are accessible only within their declaration content</td>
<td width="175" valign="top">Private</td>
<td width="157" valign="top">private</td>
</tr>
<tr>
<td width="227" valign="top">Protected access gives a variable accessibility within their own class or a class derived from that class</td>
<td width="175" valign="top">Protected</td>
<td width="157" valign="top">protected</td>
</tr>
<tr>
<td width="227" valign="top">Gives variable friend access which means that they are accessible within the program that contains their declaration</td>
<td width="175" valign="top">Friend</td>
<td width="157" valign="top">internal</td>
</tr>
<tr>
<td width="227" valign="top">Gives a variable both protected and friend access</td>
<td width="175" valign="top">Protected Friend</td>
<td width="157" valign="top">protected internal</td>
</tr>
<tr>
<td width="227" valign="top">Makes a variable static which means that the variable will hold the value even the procedure in which they are declared ends</td>
<td width="175" valign="top">Static</td>
<td width="157" valign="top">static</td>
</tr>
<tr>
<td width="227" valign="top">Declares a variable that can be shared across many instances and which is not associated with a specific instance of a class or structure</td>
<td width="175" valign="top">Shared</td>
<td width="157" valign="top">static</td>
</tr>
<tr>
<td width="227" valign="top">Makes a variable only to be read and cannot be written</td>
<td width="175" valign="top">ReadOnly</td>
<td width="157" valign="top">-</td>
</tr>
</tbody>
</table>
<p> </p>
<p> </p>
<p><strong>Keywords used in Inheritance in VB.NET/C#</strong></p>
<p><strong> </strong></p>
<p><strong>1)      </strong><strong>MustInherit, MustOverride /abstract</strong></p>
<p><strong>2)      </strong><strong>Overridable/virtual</strong></p>
<p><strong>3)      </strong><strong>Overrides/override</strong></p>
<p><strong>4)      </strong><strong>NonInheritable/sealed</strong></p>
<p><strong>5)      </strong><strong>Shadows/New</strong></p>
<p> </p>
<p><strong><span style="text-decoration:underline;">Concepts Regarding Interitance</span></strong></p>
<p><strong>1)      </strong><strong>Abstraction</strong></p>
<p>Abstraction is &#8220;the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a means for specifying which variation to use&#8221; (Richard Gabriel).</p>
<p>In Abstraction we will look only on the keywords</p>
<p><strong>a)      </strong><strong>MustInherit, MustOverride /abstract</strong></p>
<p> </p>
<p>Abstract Classes or MustInherit class can not me instantiated. The can only be inherited in the derived class.</p>
<p>For Example –</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>VB.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>Public MustInherit Class Base</p>
<p>    Public Sub NormalMethod()</p>
<p>    End Sub</p>
<p>    Public MustOverride Sub MustOverridableMethod()</p>
<p>End Class</p>
<p> </p>
<p> </p>
<p>Public Class Derived</p>
<p>    Inherits Base</p>
<p>    Public Overrides Sub MustOverridableMethod()</p>
<p> </p>
<p>    End Sub</p>
<p>End Class</p>
<p> </p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>C#.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>public abstract class Base</p>
<p>{</p>
<p>        public void NormalMethod()</p>
<p>        {</p>
<p>        }</p>
<p>        public abstract void MustOverridableMethod();</p>
<p>}</p>
<p>   </p>
<p>  public class Derived : Base</p>
<p>  {</p>
<p> </p>
<p>      public override void MustOverridableMethod()</p>
<p>              {</p>
<p>              throw new NotImplementedException();</p>
<p>      }</p>
<p>}</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p>In the above example if you are declaring the method as MustOverride/ abstract then u have to give definition of that method in the derived class. But if you are defining the method in the MustInherit/Abstract class then you may or may not define this method in the derived class.</p>
<p> </p>
<p> </p>
<p> </p>
<p><strong>b)      </strong><strong>Overridable/virtual and Overrides/override</strong></p>
<p> </p>
<p>Overridable/virtual is used to polimorphically declare the base class method. A non overridable/not virtual method can not me polymorfically declared in the base class because it will hide the base class method in the derived class (Refer to Shadowing).</p>
<p>When we declare a Overridable/virtual method, it must contain a method body. Other wise the compiler will generate an error. Remember that, since Overridable/virtual methods are used for achieving polymorphism and since polymorphism works only with objects, it not possible to declare a static method as virtual in C#. Similarly the private methods are also not possible to declare virtual, since they can&#8217;t override inside a derived class.</p>
<p> </p>
<p>For Example –<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>VB.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>Public Class PolyBase</p>
<p>    Public Overridable Function GetName() As String</p>
<p>        Return &#8220;Base Polymorphic Class&#8221;</p>
<p>    End Function</p>
<p>End Class</p>
<p> </p>
<p>Public Class PolyDerived</p>
<p>    Inherits PolyBase</p>
<p>    Public Overrides Function GetName() As String</p>
<p>        Return &#8220;Derived Polymorphic Class&#8221;</p>
<p>    End Function</p>
<p>End Class</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>C#.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>public class PolyBase</p>
<p>    {</p>
<p>        public virtual string GetName()</p>
<p>        {</p>
<p>            return &#8220;Base Polymorphic Class&#8221;;</p>
<p>        }</p>
<p>    }</p>
<p> </p>
<p>    public class PolyDerived : PolyBase</p>
<p>    {</p>
<p>        public override string GetName()</p>
<p>        {</p>
<p>            return &#8220;Derived Polymorphic Class&#8221;;</p>
<p>        }</p>
<p>    }</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p><strong>2)      </strong><strong>Sealed Classes &#8211; </strong></p>
<p> </p>
<p>Sealed Class can be instanciated but can not be inherited in another class .In VB.Net NotInheritable keyword is used to declare a class Seald and In C#.Net it is declared by sealed.</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>VB.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>Public NotInheritable Class NotInheritableClass</p>
<p>    Public Function Fun1() As String</p>
<p>        Return &#8220;My class can not be inherited&#8221;</p>
<p>    End Function</p>
<p>End Class</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>C#.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>sealed class NonInheritableClass</p>
<p>       {</p>
<p>        public string Fun1()</p>
<p>        {</p>
<p>            return &#8220;this class can not be inherited&#8221;;</p>
<p>        }</p>
<p>}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><strong>3)      </strong><strong>Shadowing</strong></p>
<p>In .Net it is possible to declare the member of the base class with the same name in the derived class. In this class we are actully hiding the base class member in the derived class , if u do so then .Net compiler will show a warning.</p>
<p>Consider the following example-</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>VB.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><img class="aligncenter size-full wp-image-145" title="sh" src="http://vinayhatwal.files.wordpress.com/2009/06/sh.jpg?w=719&#038;h=222" alt="sh" width="719" height="222" /></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>C#.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><img class="aligncenter size-full wp-image-146" title="ssss" src="http://vinayhatwal.files.wordpress.com/2009/06/ssss.jpg?w=625&#038;h=269" alt="ssss" width="625" height="269" /></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p> </p>
<p>See the compiler warning closely.</p>
<p>In VB.Net it is clearly advising to use the Shadows with the new Fun1() to hide the base class functionality. Here the correct code is -</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>VB.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>Public Class Base</p>
<p>    Private x As Integer</p>
<p>    Private y As Integer</p>
<p>    Public Function Fun1() As Integer</p>
<p>        Return x + y</p>
<p>    End Function</p>
<p>End Class</p>
<p> </p>
<p> </p>
<p>Public Class Derived</p>
<p>    Inherits Base</p>
<p>    Public Shadows Function Fun1() As Integer</p>
<p>        Return 10</p>
<p>    End Function</p>
<p>End Class</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>Shadows keyword hides the base class functionality and warning too.</p>
<p> </p>
<p>And in the C# it is advising to use the new keyword to hide the base class method. Here the correct code is-</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>C#.NET</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>class Base</p>
<p>    {</p>
<p>        private  int x = 10;</p>
<p>        private int y = 20;</p>
<p>        public int Fun1()</p>
<p>        {</p>
<p>            return x + y;</p>
<p>        }</p>
<p>    }</p>
<p>   </p>
<p>    class Derived : Base</p>
<p>    {</p>
<p>        public new int Fun1()</p>
<p>        {</p>
<p>            return 10;</p>
<p>        }</p>
<p>    }</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> </p>
<p>__________________________________________________________________________</p>
<p><strong> </strong></p>
Posted in Inheritance Tagged: .Net, abstract, Access Specifires, Inheritance, MustInherit, MustOverride, New, NonInheritable, OPPS, Overridable, override, Overrides, sealed, Shadows, virtual <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vinayhatwal.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vinayhatwal.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vinayhatwal.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vinayhatwal.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vinayhatwal.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vinayhatwal.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vinayhatwal.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vinayhatwal.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vinayhatwal.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vinayhatwal.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=143&subd=vinayhatwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vinayhatwal.wordpress.com/2009/06/16/inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30134ff30180ffc15825d15c005dbce5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vinayhatwal</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/06/in.jpg" medium="image">
			<media:title type="html">in</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/06/sh.jpg" medium="image">
			<media:title type="html">sh</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/06/ssss.jpg" medium="image">
			<media:title type="html">ssss</media:title>
		</media:content>
	</item>
		<item>
		<title>New Features in Microsoft VS 2010</title>
		<link>http://vinayhatwal.wordpress.com/2009/04/17/new-features-in-microsoft-vs-2010/</link>
		<comments>http://vinayhatwal.wordpress.com/2009/04/17/new-features-in-microsoft-vs-2010/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 08:31:05 +0000</pubDate>
		<dc:creator>vinayhatwal</dc:creator>
				<category><![CDATA[VS-2010]]></category>
		<category><![CDATA[new features in VS2010]]></category>
		<category><![CDATA[Vinayhatwal]]></category>

		<guid isPermaLink="false">http://vinayhatwal.wordpress.com/?p=139</guid>
		<description><![CDATA[
New Features in Microsoft VS 2010
 
 
Cloud Development
With Windows Azure Tools for Microsoft Visual Studio, developers can build, debug and deploy services and applications for Azure, the new cloud environment Microsoft announced in October 2008. 
 
 
Web Development
In Visual Studio 2010, Microsoft is continuing their investment in great web development tools. Visual Studio 2010 enhancements for web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=139&subd=vinayhatwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="line-height:11.25pt;text-align:center;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;"><strong></p>
<p class="MsoNormal" style="text-align:center;margin:0 0 0 .25in;" align="center"><strong><span style="color:#666666;font-family:Arial;"><span style="font-size:small;">New Features in Microsoft VS 2010</span></span></strong></p>
<p class="MsoNormal" style="line-height:11.25pt;text-align:center;margin:0;"> </p>
<p></strong></span> </p>
<p class="MsoNormal" style="line-height:11.25pt;margin:0;"><strong><span style="font-size:9pt;color:#666666;font-family:Arial;">Cloud Development</span></strong></p>
<p class="MsoNormal" style="line-height:11.25pt;text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">With Windows Azure Tools for Microsoft Visual Studio, developers can build, debug and deploy services and applications for Azure, the new cloud environment Microsoft announced in October 2008. </span></p>
<p class="MsoNormal" style="line-height:11.25pt;text-align:justify;margin:0;"> </p>
<p class="MsoNormal" style="line-height:11.25pt;text-align:justify;margin:0;"> </p>
<h3 style="margin:auto 0;"><span style="font-size:x-small;color:#666666;font-family:Arial;">Web Development</span></h3>
<p class="MsoNormal" style="line-height:11.25pt;text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">In Visual Studio 2010, Microsoft is continuing their investment in great web development tools. Visual Studio 2010 enhancements for web developers include:</span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">A high-performance and standards-compliant JavaScript, IntelliSense<sup>®</sup> engine </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">&#8216;One Click Deployment&#8217; for quickly and easily publishing a website&#8217;s files and configuration settings from the development machines to the final deployed site </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Full support for Silverlight for developers wishing to build cutting-edge, rich internet applications. </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="line-height:11.25pt;margin:0;"><strong><span style="font-size:9pt;color:#666666;font-family:Arial;">Democratising Application Lifecycle Management</span></strong></p>
<p class="MsoNormal" style="line-height:11.25pt;text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">Microsoft Visual Studio Team System 2010 will deliver new capabilities that embrace the needs of the users in the lifecycle – from architects to developers, from project managers to testers. Among the great new functionality in Visual Studio Team System 2010:</span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Discover and identify existing code assets and architecture with the new Architecture Explorer </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Design and share multiple diagram types, including use case, activity and sequence diagrams </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Improve testing efforts with tooling for better documentation of test scenarios and more thorough collection of test data </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Easily identify and run only the tests affected by a code change with the new Test Impact View </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Enhanced version control capabilities including gated check-in, branch visualisation and build workflow. </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"> </p>
<p class="MsoNormal" style="line-height:11.25pt;margin:0;"><strong><span style="font-size:9pt;color:#666666;font-family:Arial;">Inspiring Developer Delight</span></strong></p>
<p class="MsoNormal" style="line-height:11.25pt;text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">Since the first release of Visual Studio, Microsoft has made application development more productive, efficient, flexible and profitable to the developers and companies that use it. Visual Studio 2010 continues to deliver on the core developer experience by significantly improving the day-to-day process for development teams:</span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Understand existing (and write new) code </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Intuitive web development from the back-end to the end result </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Wrangle disparate C++ code into one arena </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Build new Windows 7 applications or upgrade existing applications </span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:11.25pt;text-align:justify;margin:0 0 0 58.55pt;"><span style="font-size:10pt;color:#666666;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:9pt;color:#666666;font-family:Arial;">Enable Office tools to make your solutions more flexible and productive for specific needs</span><span style="font-size:7.5pt;color:#666666;font-family:Arial;">. </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">Resource –</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 .25in;"><span style="font-size:9pt;color:#666666;font-family:Arial;"><a href="http://download.microsoft.com/download/C/0/9/C0965791-049B-4200-9008-F07A783026F6/VisualStudio2010_ProductOverview.pdf"><span style="color:#800080;">http://download.microsoft.com/download/C/0/9/C0965791-049B-4200-9008-F07A783026F6/VisualStudio2010_ProductOverview.pdf</span></a></span></p>
Posted in VS-2010 Tagged: new features in VS2010, Vinayhatwal, VS-2010 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vinayhatwal.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vinayhatwal.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vinayhatwal.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vinayhatwal.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vinayhatwal.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vinayhatwal.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vinayhatwal.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vinayhatwal.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vinayhatwal.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vinayhatwal.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=139&subd=vinayhatwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vinayhatwal.wordpress.com/2009/04/17/new-features-in-microsoft-vs-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30134ff30180ffc15825d15c005dbce5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vinayhatwal</media:title>
		</media:content>
	</item>
		<item>
		<title>.Net Framework 4.0</title>
		<link>http://vinayhatwal.wordpress.com/2009/04/17/net-framework-40/</link>
		<comments>http://vinayhatwal.wordpress.com/2009/04/17/net-framework-40/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 07:51:39 +0000</pubDate>
		<dc:creator>vinayhatwal</dc:creator>
				<category><![CDATA[.Net Framework 4.0]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[new .net relieases]]></category>
		<category><![CDATA[new releases]]></category>
		<category><![CDATA[Vinayhatwal]]></category>

		<guid isPermaLink="false">http://vinayhatwal.wordpress.com/?p=132</guid>
		<description><![CDATA[.Net Framework 4.0
 Every year the industry develops new technology and new trends. Now Microsoft is again come to provide next version of .net framework i.e. .Net Framework 4.0. As a result MS Visual Studio 2010 is just around the corner with the new innovation in application architecture, development, and deployment. So in this article I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=132&subd=vinayhatwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="text-align:center;"><span style="font-size:9pt;color:#666666;font-family:Arial;"><span style="font-size:14pt;font-family:&quot;"><span style="color:#000000;">.Net Framework 4.0</span></span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"> <span style="font-size:9pt;color:#666666;font-family:Arial;">Every year the industry develops new technology and new trends. Now Microsoft is again come to provide next version of .net framework i.e. .Net Framework 4.0. As a result MS Visual Studio 2010 is just around the corner with the new innovation in application architecture, development, and deployment. So in this article I am describing some new features coming in the .Net Framework 4.0. Before describing new features of .Net Framework 4.0, I am giving a summary of some of the main functionality in each .net version.</span> </p>
<p class="MsoNormal" style="text-align:justify;margin:0;"> </p>
<p class="MsoNormal" style="text-align:justify;margin:0;"> </p>
<table class="MsoTableTheme" style="border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width:1.45in;background-color:transparent;border:windowtext 1pt solid;padding:0 5.4pt;" width="139" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">.NET Framework 4.0</span></p>
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">(The Future Release)</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:windowtext 1pt solid;border-left:#ece9d8;width:161.25pt;border-bottom:windowtext 1pt solid;background-color:transparent;padding:0 5.4pt;" colspan="3" width="215" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">PLINQ</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:windowtext 1pt solid;border-left:#ece9d8;width:177.15pt;border-bottom:windowtext 1pt solid;background-color:transparent;padding:0 5.4pt;" colspan="3" width="236" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">TPL</span></p>
</td>
</tr>
<tr style="height:20.2pt;">
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:windowtext 1pt solid;width:1.45in;border-bottom:windowtext 1pt solid;height:20.2pt;background-color:transparent;padding:0 5.4pt;" width="139" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">.NET Framework 3.5</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:161.25pt;border-bottom:windowtext 1pt solid;height:20.2pt;background-color:transparent;padding:0 5.4pt;" colspan="3" width="215" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">LINQ</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:177.15pt;border-bottom:windowtext 1pt solid;height:20.2pt;background-color:transparent;padding:0 5.4pt;" colspan="3" width="236" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">ADO.NET Entity Framework</span></p>
</td>
</tr>
<tr style="height:17.5pt;">
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:windowtext 1pt solid;width:1.45in;border-bottom:windowtext 1pt solid;height:17.5pt;background-color:transparent;padding:0 5.4pt;" width="139" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">.NET Framework 3.0</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:72.7pt;border-bottom:windowtext 1pt solid;height:17.5pt;background-color:transparent;padding:0 5.4pt;" width="97" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">WPF</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:88.55pt;border-bottom:windowtext 1pt solid;height:17.5pt;background-color:transparent;padding:0 5.4pt;" colspan="2" width="118" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">WCF</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:88.55pt;border-bottom:windowtext 1pt solid;height:17.5pt;background-color:transparent;padding:0 5.4pt;" colspan="2" width="118" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">WF</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:88.6pt;border-bottom:windowtext 1pt solid;height:17.5pt;background-color:transparent;padding:0 5.4pt;" width="118" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">Card Space</span></p>
</td>
</tr>
<tr style="height:17.95pt;">
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:windowtext 1pt solid;width:1.45in;border-bottom:windowtext 1pt solid;height:17.95pt;background-color:transparent;padding:0 5.4pt;" rowspan="3" width="139" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">.NET Framework 2.0</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:117.1pt;border-bottom:windowtext 1pt solid;height:17.95pt;background-color:transparent;padding:0 5.4pt;" colspan="2" width="156" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">WinForms</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:117.05pt;border-bottom:windowtext 1pt solid;height:17.95pt;background-color:transparent;padding:0 5.4pt;" colspan="2" width="156" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0 0 0 35.9pt;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">ASP.NET</span></p>
</td>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:104.25pt;border-bottom:windowtext 1pt solid;height:17.95pt;background-color:transparent;padding:0 5.4pt;" colspan="2" width="139" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0 0 0 34.05pt;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">ADO.NET</span></p>
</td>
</tr>
<tr style="height:17.05pt;">
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:4.7in;border-bottom:windowtext 1pt solid;height:17.05pt;background-color:transparent;padding:0 5.4pt;" colspan="6" width="451" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">Base Class Library</span></p>
</td>
</tr>
<tr>
<td style="border-right:windowtext 1pt solid;border-top:#ece9d8;border-left:#ece9d8;width:4.7in;border-bottom:windowtext 1pt solid;background-color:transparent;padding:0 5.4pt;" colspan="6" width="451" valign="top">
<p class="MsoNormal" style="text-align:center;margin:0;" align="center"><span style="font-size:9pt;color:#666666;font-family:Arial;">CLR</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-align:justify;margin:0;"> </p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">So you have just seen the major change in each version on .Net Framework. Above figure defines the feature stack of the .Net Framework. </span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:9pt;color:#666666;font-family:Arial;">Following are new features provided by .NET Framework 4.0 –</span></strong><span style="font-size:10pt;"><span style="color:#000000;font-family:Times New Roman;"> </span></span></p>
<ul style="margin-top:0;" type="disc">
<li class="MsoNormal"><strong><span style="font-size:10pt;font-family:Arial;">New Languages</span></strong><strong><span style="font-size:small;color:#000000;font-family:Times New Roman;"> </span></strong></li>
</ul>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">.NET 4.0 will include <a href="http://www.informit.com/guides/%3ca%20href="><span style="color:#666666;text-decoration:none;">IronPython</span></a>, <a href="http://www.ironruby.net/"><span style="color:#666666;text-decoration:none;">IronRuby</span></a>, and <a href="http://research.microsoft.com/fsharp/fsharp.aspx"><span style="color:#666666;text-decoration:none;">F#</span></a>, among others. The three named languages have been available in some form for a few years now, but it appears that with .NET 4.0 they become &#8220;official&#8221; in the same way as C#, Visual Basic .NET. Both IronPython and IronRuby leverage the Dynamic Language Runtime (DLR), a subsystem that supports dynamic languages on .NET. The DLR has been around for a couple of years now, but with .NET 4.0 becomes an integral part of the .NET runtime.</span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">In order to support the new languages, and to ensure language interoperability, the CLR team did make some changes. Two additions are particularly interesting to me: BigInteger and Tuple. Because these features are in the base class libraries, all .NET languages can use them</span><span style="font-size:10pt;"><span style="color:#000000;font-family:Times New Roman;"> </span></span></p>
<ul style="margin-top:0;" type="disc">
<li class="MsoNormal"><strong><span style="font-size:10pt;font-family:Arial;">Threading improvements</span></strong><span style="font-size:10pt;"><span style="color:#000000;font-family:Times New Roman;"> </span></span></li>
</ul>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">Framework 4.0 includes the Task Parallel Library (TPL), a library of objects that make it easier to write code that takes advantage of multiple cores. Not only do TPL functions relieve you of the tedium involved with starting and managing threads, they also help you to structure your code to make the most of the computing resources available.</span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">During development and use of the TPL, the CLR team found a number of areas in which the .NET thread pool (the subsystem that the TPL depends on) was less than optimum. They have since improved the thread pool, giving a performance boost not only TPL programs, but to all programs that make use of .NET threading services. </span><span style="font-size:10pt;"><span style="color:#000000;font-family:Times New Roman;"> </span></span></p>
<ul style="margin-top:0;" type="disc">
<li class="MsoNormal"><strong><span style="font-size:10pt;font-family:Arial;">Garbage Collector Improvements</span></strong><strong><span style="font-size:small;color:#000000;font-family:Times New Roman;"> </span></strong></li>
</ul>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">All in all, the .NET garbage collector is considered a good thing. However, it does have some drawbacks. In particular, it can severely impact performance in some cases.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">The server garbage collector in .NET 3.51 and earlier versions is optimized for higher throughput, but has to pause all threads when it does a full collection. The result is that processing comes to a halt whenever a full collection occurs. This can be very annoying.</span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">The pauses still occur in .NET 4.0, but the system will notify your program before a full collection starts, and notify it again when the garbage collector has finished with collection. In a multi-server environment, you can use this feature to direct traffic away from your server while it&#8217;s in the middle of a full collection. That helps with server farms, but doesn&#8217;t help with memory-intensive applications that are running on a single machine.</span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">The workstation garbage collector in 4.0 gets a new background collection feature, which results in fewer pauses and doesn&#8217;t require any changes to your code. Only very unusual circumstances will result in the long latency that you might have seen in versions 3.51 or earlier</span><strong><span style="font-size:small;color:#000000;font-family:Times New Roman;"> </span></strong></p>
<ul style="margin-top:0;" type="disc">
<li class="MsoNormal"><strong><span style="font-size:10pt;font-family:Arial;">PLINQ</span></strong><strong><span style="font-size:small;color:#000000;font-family:Times New Roman;"> </span></strong></li>
</ul>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">.Net Framework 3.5 introduced new concept i.e. LINQ(Language Integrated Queries). Microsoft original motivation behind LINQ was to address the impedance mismatch between programming languages and database</span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">Microsoft LINQ defines a set of proprietary query operators that can be used to query, project and filter data in <a title="Array" href="http://en.wikipedia.org/wiki/Array"><span style="color:#666666;text-decoration:none;">arrays</span></a>, enumerable <a title="Class (computer science)" href="http://en.wikipedia.org/wiki/Class_(computer_science)"><span style="color:#666666;text-decoration:none;">classes</span></a>, <a title="XML" href="http://en.wikipedia.org/wiki/XML"><span style="color:#666666;text-decoration:none;">XML</span></a> (XLINQ), <a title="Relational database" href="http://en.wikipedia.org/wiki/Relational_database"><span style="color:#666666;text-decoration:none;">relational database</span></a>, and third party data sources. While it allows any data source to be queried, it requires that the data be encapsulated as <a title="Object (computer science)" href="http://en.wikipedia.org/wiki/Object_(computer_science)"><span style="color:#666666;text-decoration:none;">objects</span></a>. So, if the data source does not natively store data as objects, the data must be <a title="Object-Relational mapping" href="http://en.wikipedia.org/wiki/Object-Relational_mapping"><span style="color:#666666;text-decoration:none;">mapped</span></a> to the object domain. Queries written using the query operators are executed either by the LINQ query processing engine or, via an extension mechanism, handed over to LINQ providers which either implement a separate query processing engine or translate to a different format to be executed on a separate data store (such as on a database server as <a title="SQL" href="http://en.wikipedia.org/wiki/SQL"><span style="color:#666666;text-decoration:none;">SQL</span></a> queries (DLINQ)). The results of a query are returned as a collection of in-memory objects that can be <a title="Enumeration" href="http://en.wikipedia.org/wiki/Enumeration"><span style="color:#666666;text-decoration:none;">enumerated</span></a> using a standard <a title="Iterator" href="http://en.wikipedia.org/wiki/Iterator"><span style="color:#666666;text-decoration:none;">iterator</span></a> function such as <a title="C Sharp (programming language)" href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)"><span style="color:#666666;text-decoration:none;">C#</span></a>&#8217;s <a title="Foreach" href="http://en.wikipedia.org/wiki/Foreach"><span style="color:#666666;text-decoration:none;">foreach</span></a>.</span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">Like all constructs in LINQ, PLINQ is based on extension methods, in this case the AsParallel method. Once you&#8217;ve built the expression tree representing the query, the AsParallel operation is added at the very end, which tells the &#8220;LINQ engine&#8221; to figure out parallel jobs and do all of the magic required to make the app benefit from multi-threaded execution. A conceptual example is shown below:</span><span style="font-size:9pt;color:#666666;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:9pt;color:#666666;font-family:Arial;">var result = (from p in db.Products join pd in xml.ProductDescriptions on p.ID equals pd.ID where p.Price &gt; 100 select new { p.Name, p.Price, pd.Description }).AsParallel();</span> </p>
Posted in .Net Framework 4.0 Tagged: .Net, .Net Framework 4.0, new .net relieases, new releases, Vinayhatwal <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vinayhatwal.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vinayhatwal.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vinayhatwal.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vinayhatwal.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vinayhatwal.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vinayhatwal.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vinayhatwal.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vinayhatwal.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vinayhatwal.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vinayhatwal.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=132&subd=vinayhatwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vinayhatwal.wordpress.com/2009/04/17/net-framework-40/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30134ff30180ffc15825d15c005dbce5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vinayhatwal</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Services</title>
		<link>http://vinayhatwal.wordpress.com/2009/04/10/windows-services/</link>
		<comments>http://vinayhatwal.wordpress.com/2009/04/10/windows-services/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 07:58:38 +0000</pubDate>
		<dc:creator>vinayhatwal</dc:creator>
				<category><![CDATA[Windows Services]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[Vinayhatwal]]></category>
		<category><![CDATA[windows services]]></category>

		<guid isPermaLink="false">http://vinayhatwal.wordpress.com/?p=118</guid>
		<description><![CDATA[Windows Services


By: Vinay Hatwal
Dated: Apr 10, 2009 
Level: Beginner
 
The idea of using Windows services came into my mind when I was working on Finger Print Attendance System for Bajaj Capital Ltd. This system was going to be used by all the branches of the company. So I wanted to synchronize the attendance of the employees [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=118&subd=vinayhatwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:center;"><strong>Windows Services</strong></p>
<p style="text-align:left;">
<p class="MsoNormal">
<p class="MsoNormal"><em>By: Vinay Hatwal</em></p>
<p class="MsoNormal"><em>Dated: Apr 10, 2009<span> </span></em></p>
<p class="MsoNormal"><em>Level: Beginner</em></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="text-align:justify;">The idea of using Windows services came into my mind when I was working on Finger Print Attendance System for Bajaj Capital Ltd. This system was going to be used by all the branches of the company. So I wanted to synchronize the attendance of the employees of each branch with our company’s ERP system. So that, I decided to develop windows services for the same purpose. There was one issue in real time synchronization of attendance with the Head Office.<span> </span>The issue was slow internet connection and no internet connectivity available all the time. So the solution was to send the attendance when internet is connected not on the time of attendance punching. So the solution was WINDOWS SERVICES.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">In this article I will explain how to make Windows Services by using c#.net.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;"><strong>Windows services</strong> are long running executable file developed for running in background as long a windows is running. These executables run in the background and there is no any requirement for the user interaction. They run in the background so that there is no need to take graphical interface in the Windows Services. You can think about UNIX Daemon if u r familiar with the UNIX environment. On the Windows the same concept is Windows Services. Windows Services can be configured to run automatically when Windows is booted. They can also be configured to run on Local machine, single user account, and also on Network.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">You can find windows services in your local machine on</p>
<p class="MsoNormal" style="text-align:justify;">Start-&gt; Control Panel -&gt; Administrative Tools -&gt; Services</p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:12pt;font-family:&quot;">These services looks like this—</span></p>
<p style="text-align:center;">
<p style="text-align:left;">
<div style="text-align:left;"><strong></strong></div>
<p><strong></p>
<div id="attachment_121" class="wp-caption aligncenter" style="width: 710px"><strong><img class="size-full wp-image-121 " title="111" src="http://vinayhatwal.files.wordpress.com/2009/04/111.jpg?w=700&#038;h=768" alt="Windows Service Browser" width="700" height="768" /></strong><p class="wp-caption-text">Windows Service Browser</p></div>
<p> </p>
<p></strong></p>
<p style="text-align:left;">
<p style="text-align:left;">
<p class="MsoNormal" style="text-align:justify;">By using windows service you can use databases, text files, and all shareable resources with it etc.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">To create Windows Services in .net (I am creating in .net 2.0)</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;"><strong><span style="font-size:14pt;">Creating Windows Services</span></strong></p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span>1)<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span>&lt;!&#8211;[endif]&#8211;&gt;To create windows services, go to File menu and then select New Project, then select Windows Service. You will see the dialog box shown below. Name the project – MyWindowService.</p>
<p><img class="aligncenter size-full wp-image-122" title="12" src="http://vinayhatwal.files.wordpress.com/2009/04/12.jpg?w=680&#038;h=494" alt="12" width="680" height="494" /></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;">2) After clicking on OK you will see the following. Change the name of the service from Service1.cs to MyService.cs. </span></p>
<p><img class="aligncenter size-full wp-image-123" title="2" src="http://vinayhatwal.files.wordpress.com/2009/04/2.jpg?w=1024&#038;h=768" alt="2" width="1024" height="768" /></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;">3) Now go to in on the properties on the MyService and change the property Service Name to MyService.</span></p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;">4) Do right click on the MyService design view and select <strong>View Code</strong> option from the context menu. You can see two overrided methods in the window OnStart() and OnStop(). </span></p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;">These are the members of the ServiceBase class and inheritted by the MyService Class. There are some more members also present in the ServiceBase class like OnContinue(), OnPause() etc. but I am just describing about these two only.<span> </span></span></p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;">The idea of using windows service is only behind these to methods. Any work u want to perform on the sharable resources, you can write code for that in the OnStart() method. I have just put Beep () here. It will give the beep sound on starting the Window Service. And just 2 beep on Stoping it. You can see in the coding below.</span></p>
<p><img class="aligncenter size-full wp-image-124" title="3" src="http://vinayhatwal.files.wordpress.com/2009/04/3.jpg?w=1024&#038;h=768" alt="3" width="1024" height="768" /></p>
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>5)<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">to install this Windows Service on the local system you need to add installers in your Service. Just right click on the Service Design window and then select <strong>Add Installer.</strong></span></p>
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>6)<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">Project Installer will automatically be added in your solution, name ProjectInstaller.sc. and you can also find two component in it </span></p>
<p class="MsoNormal" style="margin-left:1in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>a.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">serviceProcessInstaller1</span></p>
<p class="MsoNormal" style="margin-left:1in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>b.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">serviceInstaller1</span></p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>7)<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">You can now decide how your Windows Process will be display, you can set the account for your service on which it will be running, and you can give the Display Service Name, Description and the start type of the service like Automat, Manual, or Disabled. For doing all these you can follow these steps</span></p>
<p class="MsoNormal" style="margin-left:1in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>a.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">Go to on the properties of <strong>serviceProcessInstaller1</strong>, and set <strong>Account</strong><span> </span>property to Local System, so that it would be sharable to all users.</span></p>
<p class="MsoNormal" style="margin-left:1in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>b.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">Now go to on the properties of <strong>serviceInstaller1, </strong>and<strong> </strong>ser <strong>Description</strong> as u like and set <strong>Display Name</strong> as u want to display in the Services Console, and now set<span> </span><strong>StartType</strong> to <strong>Automatic</strong> so that the service can be run on the starting of the Windows operation system.</span></p>
<p class="MsoNormal" style="margin-left:.75in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> <span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">After doing all the configuration just press F6 for building the solution. Now Your Window Service is ready to use.</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.5in;text-align:justify;text-indent:-.25in;">&lt;!&#8211;[if !supportLists]&#8211;&gt;<span style="font-size:11pt;"><span>9)<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span>&lt;!&#8211;[endif]&#8211;&gt;<span style="font-size:11pt;">Now for using it u have to install this service on your local machine. You can do this by using the instalUtill.exe utility provided by .net framework to install this service on your machine.</span></p>
<p class="MsoNormal" style="text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">Now take the executable of this service and jus copy it into your system32 directory.</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">Go to your application path where your project is running, and go to the bin\debug directory then copy MyWindowServices.exe and paste it into syetem32.</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">Now go to on the <strong>Visual Studio 2005 Command Prompt</strong> and type the following for installing the newly developed Window Service–</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><strong><span style="font-size:11pt;">C:\&gt; installutil c:\windows\system32\</span> </strong><strong><span style="font-size:11pt;">MyWindowServices.exe</span></strong></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;">
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><strong><span style="font-size:11pt;"><img class="aligncenter size-full wp-image-125" title="4" src="http://vinayhatwal.files.wordpress.com/2009/04/4.jpg?w=667&#038;h=503" alt="4" width="667" height="503" /></span></strong></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;">
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;">
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">To uninstall use –</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><strong><span style="font-size:11pt;">C:\&gt; installutil /u c:\windows\system32\</span> </strong><strong><span style="font-size:11pt;">MyWindowServices.exe</span></strong></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p><span style="font-size:11pt;font-family:&quot;">You can see your service in the service console like </span></p>
<p><span style="font-size:11pt;font-family:&quot;"><img class="aligncenter size-full wp-image-126" title="5" src="http://vinayhatwal.files.wordpress.com/2009/04/5.jpg?w=1024&#038;h=768" alt="5" width="1024" height="768" /></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">Now just do right click on it and the start. You will listen one beep on starting and two beep on stopping the Windows Service.</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">So friends. Enjoy the Window Services, hope your will learn by this article. Hope you will be enjoying after creation the windows service.</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">I am always waiting for your comments and suggestion so that I can improve my articles.<span> </span></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><span style="font-size:11pt;">Again<span> </span>Coming Soon…………………….</span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"> </p>
<p class="MsoNormal" style="margin-left:.25in;text-align:justify;"><strong><span style="font-size:11pt;">Vinay Hatwal</span></strong></p>
Posted in Windows Services Tagged: .Net, services, Vinayhatwal, windows services <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vinayhatwal.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vinayhatwal.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vinayhatwal.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vinayhatwal.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vinayhatwal.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vinayhatwal.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vinayhatwal.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vinayhatwal.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vinayhatwal.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vinayhatwal.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=118&subd=vinayhatwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vinayhatwal.wordpress.com/2009/04/10/windows-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30134ff30180ffc15825d15c005dbce5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vinayhatwal</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/04/111.jpg" medium="image">
			<media:title type="html">111</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/04/12.jpg" medium="image">
			<media:title type="html">12</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/04/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/04/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/04/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2009/04/5.jpg" medium="image">
			<media:title type="html">5</media:title>
		</media:content>
	</item>
		<item>
		<title>Crystal Report With .Net</title>
		<link>http://vinayhatwal.wordpress.com/2008/08/13/crystal-report-with-net/</link>
		<comments>http://vinayhatwal.wordpress.com/2008/08/13/crystal-report-with-net/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 06:09:21 +0000</pubDate>
		<dc:creator>vinayhatwal</dc:creator>
				<category><![CDATA[Crystal Report With .Net]]></category>

		<guid isPermaLink="false">http://vinayhatwal.wordpress.com/?p=42</guid>
		<description><![CDATA[Crystal Report with C#.Net 2.0
 
Using Crystal Report is very easy task. Sometime we afraid to use crystal reports with the code of Vb.Net or C#.Net even when we have used crystal reports in the previous technologies like Visual Basic 6. Before writing this tutorial I found some of my friends unable to user crystal report [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=42&subd=vinayhatwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="text-align:center;margin:0;" align="center"><strong><span style="font-size:20pt;color:#ff0000;"><span style="font-family:Times New Roman;">Crystal Report with C#.Net 2.0</span></span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:small;font-family:Times New Roman;">Using Crystal Report is very easy task. Sometime we afraid to use crystal reports with the code of Vb.Net or C#.Net even when we have used crystal reports in the previous technologies like Visual Basic 6. Before writing this tutorial I found some of my friends unable to user crystal report and stuck out in small problems regarding Crystal Report. So I decided to write this tutorial for them and also for those people who are afraid with Crystal Reports and found some difficulties to use it. This tutorial may play a very important role to learn Crystal with Vb.Net/C#.Net for those are new to take crystal with .Net but have used crystal with some of the earlier technologies or who are new even to Crystal.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:small;font-family:Times New Roman;">So Friends, Lets Have a look on the tools used in crystal reports with VB.Net/C#.Net.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">1)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">DataSet (</span></span><span style="font-size:11pt;font-family:'Courier New';">System.Data.<strong><span style="color:#008080;">DataSet)</span></strong></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">2)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Crystal Report </span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">3)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">CrystalReportViewer1 (</span></span><span style="font-size:11pt;font-family:'Courier New';">CrystalDecisions.Windows.Forms.<strong><span style="color:#008080;">CrystalReportViewer</span></strong></span><span style="font-size:small;font-family:Times New Roman;">) </span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span><span style="font-family:Times New Roman;"><span style="font-size:small;">4)</span><span style="font-family:'Times New Roman';">      </span></span></span><span style="font-size:11pt;font-family:'Courier New';">System.Data.SqlClient</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:11pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:11pt;font-family:'Courier New';">Now Follow these Steps for the first stage to learn the crystal reports</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:11pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="text-decoration:underline;"><span style="font-size:11pt;font-family:'Courier New';">Stage 1 Create Data Base Table (I ussed SqlServer2000) </span></span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="text-decoration:underline;"><span style="font-size:11pt;font-family:'Courier New';"><span style="text-decoration:none;"> </span></span></span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:11pt;font-family:'Courier New';">1. Create These Basic Tables using SqlServer2000</span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">Create Table DemoStudentMaster</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">(</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>StudentId int primary key,</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>StudentName varchar(15),</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>StudentAddress varchar(50),</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>StudentCity varchar(20),</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>StudentMobile varchar(10)</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">)</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">Create Table StudentFeeDetails</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">(</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>StudentId int references DemoStudentMaster(StudentId),</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>SumittedFeeAmt int,</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>ForMonth int,</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>ForYear int</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">)</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">2. Insert Values in These Tables </span></span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">DemoStudentMaster</span></span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into DemoStudentMaster values (1,&#8217;Vinay Hatwal&#8217;,'Nehru Place&#8217;,'New Delhi&#8217;,'9911884523&#8242;);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into DemoStudentMaster values (2,&#8217;Panjak Pundir&#8217;,'Nehru Place&#8217;,'New Delhi&#8217;,'7483434356&#8242;);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into DemoStudentMaster values (3,&#8217;Ashish C.&#8217;,'Nehru Place&#8217;,'New Delhi&#8217;,'7473949866&#8242;);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into DemoStudentMaster values (4,&#8217;Sandeep S.&#8217;,'Nehru Place&#8217;,'New Delhi&#8217;,'791198475&#8242;);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into DemoStudentMaster values (5,&#8217;Pradeep K.&#8217;,'Nehru Place&#8217;,'New Delhi&#8217;,'8911884523&#8242;);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">StudentFeeDetails</span></span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (1,1000,2,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (1,1000,3,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (1,1000,4,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (1,1000,5,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (1,1000,6,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (1,1000,7,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (2,4000,2,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (2,4000,3,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (2,4000,4,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (2,4000,5,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (2,4000,6,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (3,3000,2,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (3,3000,3,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (3,3000,4,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (5,10000,2,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;">insert into StudentFeeDetails values (5,10000,3,2008);</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.5in;"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">Now Your Tables Are Ready To Use in Crystal Report.</span></span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">Stage 2 – Creating Sample Application in .Net</span></span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">Using C#.Net 2.0</span></span></strong></li>
</ol>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">a)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Open a new Project with C# names MyDemoCrystalPrj.</span></span></p>
<p><a href="http://vinayhatwal.files.wordpress.com/2008/08/12.jpg"><img class="aligncenter size-full wp-image-48" src="http://vinayhatwal.files.wordpress.com/2008/08/12.jpg?w=1024&#038;h=640" alt="" width="1024" height="640" /></a></p>
<p> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">b)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Open Solution Explorer , Right Click on MyDemoCrystalPrj then click on Add and then click on New Items.</span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><a href="http://vinayhatwal.files.wordpress.com/2008/08/21.jpg"><img class="aligncenter size-full wp-image-49" src="http://vinayhatwal.files.wordpress.com/2008/08/21.jpg?w=1024&#038;h=640" alt="" width="1024" height="640" /></a></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">c)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Now Select The DataSet. Renamed it as SampleDataSet , Click on Add Button. Now The SampleDataSet.xsd tab will display.</span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> <a href="http://vinayhatwal.files.wordpress.com/2008/08/34.jpg"><img class="aligncenter size-full wp-image-53" src="http://vinayhatwal.files.wordpress.com/2008/08/34.jpg?w=683&#038;h=419" alt="" width="683" height="419" /></a></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:12pt;font-family:'Times New Roman';">   d) Right click on the middle of the page and then click on Add and then DataTable, After Clicking on it a Data Table will Appear on screen.</span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-size:12pt;font-family:'Times New Roman';"><a href="http://vinayhatwal.files.wordpress.com/2008/08/41.jpg"><img class="aligncenter size-full wp-image-54" src="http://vinayhatwal.files.wordpress.com/2008/08/41.jpg?w=1024&#038;h=640" alt="" width="1024" height="640" /></a></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p><span style="font-size:12pt;font-family:'Times New Roman';"></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span>e)<span style="font-family:'Times New Roman';">      </span></span>Now Right Click on DataTable1 and select Rename . Rename id as StudentMasterTable.</p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span>f)<span style="font-family:'Times New Roman';">      </span></span>After it Right Click on The table and Select Add then Column. Make The Following Column in it.</p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 1in;"><span>a.<span style="font-family:'Times New Roman';">       </span></span>StudentID</p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 1in;"><span>b.<span style="font-family:'Times New Roman';">      </span></span>StudentName</p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 1in;"><span>c.<span style="font-family:'Times New Roman';">       </span></span>StudentAddress</p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 1in;"><span>d.<span style="font-family:'Times New Roman';">      </span></span>StuentMob</p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.25in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span>g)<span style="font-family:'Times New Roman';">      </span></span>Now Again Open Solution Explorer , Right Click on MyDemoCrystalPrj then click on Add and then click on New Items then select Crystal Report. Rename it as MasterCrystalReport.rpt(All the related references will be automatically added in the references)</p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span>h)<span style="font-family:'Times New Roman';">      </span></span>After Adding Crystal In Project Following Dialog Box Will appear on the screen</p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p> </p>
<p><span style="font-size:12pt;font-family:'Times New Roman';"></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p></span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><a href="http://vinayhatwal.files.wordpress.com/2008/08/51.jpg"><img class="aligncenter size-full wp-image-55" src="http://vinayhatwal.files.wordpress.com/2008/08/51.jpg?w=366&#038;h=447" alt="" width="366" height="447" /></a></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">i)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Select option As a Blank Report and then press OK. Crystal Report will appear and looks like </span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><a href="http://vinayhatwal.files.wordpress.com/2008/08/61.jpg"><img class="aligncenter size-full wp-image-56" src="http://vinayhatwal.files.wordpress.com/2008/08/61.jpg?w=1024&#038;h=640" alt="" width="1024" height="640" /></a></p>
<p> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">j)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Now right click on DataBase Fields in the Field Explorer , Select Database Expert. After selecting it following screen will appear. </span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.25in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>      </span>Select Project Data &gt; ADO.NET DataSets &gt; MyDemoCrystalPrj.SampleDataSet </span></span></p>
<p class="MsoNormal" style="text-indent:0.25in;text-align:justify;margin:0 0 0 0.25in;"><span style="font-size:small;font-family:Times New Roman;">then add it and then click on OK</span></p>
<p><a href="http://vinayhatwal.files.wordpress.com/2008/08/71.jpg"><img class="aligncenter size-full wp-image-57" src="http://vinayhatwal.files.wordpress.com/2008/08/71.jpg?w=668&#038;h=453" alt="" width="668" height="453" /></a></p>
<p> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">k)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Now Field Explorer will look like </span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><a href="http://vinayhatwal.files.wordpress.com/2008/08/81.jpg"><img class="aligncenter size-full wp-image-58" src="http://vinayhatwal.files.wordpress.com/2008/08/81.jpg?w=288&#038;h=254" alt="" width="288" height="254" /></a></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">l)</span><span style="font-family:'Times New Roman';">      </span></span><span style="font-size:small;">Drag then Fields of StudentMasterTable in the detail section of the Crystal Report. You Can also take the heading on the Report Header Section .Right Client On Report Header Section , Select Insert then Select Text Object. Give the Text as Student Detail and format it according to your need. After Inserting all the things your report will look like</span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"> <a href="http://vinayhatwal.files.wordpress.com/2008/08/94.jpg"><img class="aligncenter size-full wp-image-60" src="http://vinayhatwal.files.wordpress.com/2008/08/94.jpg?w=1024&#038;h=640" alt="" width="1024" height="640" /></a></p>
<p> </p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">m)</span><span style="font:7pt &quot;">      </span></span><span style="font-size:small;">Now Open Form1 and Take CrystalReportViewer Form the Crystal Report Strip in the Toolbox.</span></span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">n)</span><span style="font:7pt &quot;">      </span></span><span style="font-size:small;">Now Go To the Coding Window of<span>  </span>Form1 and write the following code.</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.25in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System.Collections.Generic;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System.ComponentModel;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System.Data;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System.Data.SqlClient;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System.Drawing;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System.Text;</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">using</span></strong><span style="font-size:11pt;font-family:&quot;"> System.Windows.Forms;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:11pt;color:blue;font-family:&quot;">namespace</span></strong><span style="font-size:11pt;font-family:&quot;"> MyDemoCrystalPrj</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>    </span><strong><span style="color:blue;">public</span></strong> <strong><span style="color:blue;">partial</span></strong> <strong><span style="color:blue;">class</span></strong> <strong><span style="color:teal;">Form1</span></strong> : <strong><span style="color:teal;">Form</span></strong><span style="color:teal;"></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>    </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>        </span><strong><span style="color:teal;">SqlConnection</span></strong> con;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>        </span><strong><span style="color:teal;">DataSet</span></strong> ds;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>        </span><strong><span style="color:blue;">public</span></strong> Form1()</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span><strong><span style="color:teal;">SqlDataAdapter</span></strong> adp;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span>con = <strong><span style="color:blue;">new</span></strong> <strong><span style="color:teal;">SqlConnection</span></strong>(<strong><span style="color:maroon;">&#8220;Server=.;Database=master;Integrated Security=true&#8221;</span></strong>);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>      </span><span>      </span>ds = <strong><span style="color:blue;">new</span></strong> <strong><span style="color:teal;">DataSet</span></strong>();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span>adp = <strong><span style="color:blue;">new</span></strong> <strong><span style="color:teal;">SqlDataAdapter</span></strong>(<strong><span style="color:maroon;">&#8220;select StudentId,StudentName,StudentAddress,StudentCity,StudentMobile from DemoStudentMaster&#8221;</span></strong>, con);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span>adp.Fill(ds, <strong><span style="color:maroon;">&#8220;StudentTable&#8221;</span></strong>);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span>InitializeComponent();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>   </span><span>     </span><strong><span style="color:blue;">private</span></strong> <strong><span style="color:blue;">void</span></strong> Form1_Load(<strong><span style="color:blue;">object</span></strong> sender, <strong><span style="color:teal;">EventArgs</span></strong> e)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>        </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span><strong><span style="color:teal;">MasterCrystalReport</span></strong> cr = <strong><span style="color:blue;">new</span></strong> <strong><span style="color:teal;">MasterCrystalReport</span></strong>();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span>cr.SetDataSource(ds.Tables[<strong><span style="color:maroon;">"StudentTable"</span></strong>].DefaultView);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>            </span>crystalReportViewer1.ReportSource = cr;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>    </span><span>        </span>crystalReportViewer1.Show();</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>        </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:11pt;font-family:&quot;"><span>    </span>}</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:11pt;font-family:&quot;">}</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0 0 0 0.25in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-indent:-0.25in;text-align:justify;margin:0 0 0 0.5in;"><span style="font-family:Times New Roman;"><span><span style="font-size:small;">o)</span><span style="font:7pt &quot;">      </span></span><span style="font-size:small;">Finally Run The Project. Your Crystal Report Will Look Like </span></span></p>
<p><a href="http://vinayhatwal.files.wordpress.com/2008/08/103.jpg"><img class="aligncenter size-full wp-image-61" src="http://vinayhatwal.files.wordpress.com/2008/08/103.jpg?w=1024&#038;h=640" alt="" width="1024" height="640" /></a></p>
<div style="border-right:medium none;border-top:medium none;border-left:medium none;border-bottom:windowtext 1pt solid;padding:0 0 1pt;">
<p class="MsoNormal" style="text-align:justify;margin:0;padding:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
</div>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:small;font-family:Times New Roman;">Note – If you find the helps you for learning the crystal report as a beginner the please write comment on this tutorial or just writ few words on </span><a href="mailto:vinayhatwal@gmail.com"><span style="font-size:small;font-family:Times New Roman;">vinayhatwal@gmail.com</span></a><span style="font-size:small;font-family:Times New Roman;">. I will be back by taking some new tutorial on new technologies soon.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span><span style="font-size:small;font-family:Times New Roman;">   </span></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vinayhatwal.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vinayhatwal.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vinayhatwal.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vinayhatwal.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vinayhatwal.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vinayhatwal.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vinayhatwal.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vinayhatwal.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vinayhatwal.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vinayhatwal.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vinayhatwal.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vinayhatwal.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=42&subd=vinayhatwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vinayhatwal.wordpress.com/2008/08/13/crystal-report-with-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30134ff30180ffc15825d15c005dbce5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vinayhatwal</media:title>
		</media:content>

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/12.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/21.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/34.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/41.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/51.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/61.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/71.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/81.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/94.jpg" medium="image" />

		<media:content url="http://vinayhatwal.files.wordpress.com/2008/08/103.jpg" medium="image" />
	</item>
		<item>
		<title>ADO.NET INTERVIEW QUESTIONS</title>
		<link>http://vinayhatwal.wordpress.com/2008/07/25/adonet-interview-questions/</link>
		<comments>http://vinayhatwal.wordpress.com/2008/07/25/adonet-interview-questions/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 05:06:25 +0000</pubDate>
		<dc:creator>vinayhatwal</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Ado.Net]]></category>

		<guid isPermaLink="false">http://vinayhatwal.wordpress.com/?p=8</guid>
		<description><![CDATA[ 
To test a Web Service you must create a windows application or web application to consume this service? It is True/False?
FALSEHow many classes can a single.NET DLL contain?
Answer1:
As many
Answer2:
One or more
What are good ADO.NET object(s) to replace the ADO Recordset object?
The differences includes
In ADO, the in-memory representation of data is the recordset.
In ADO.net, it is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=8&subd=vinayhatwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p> </p>
<p class="MsoNormal" style="background:white;line-height:12pt;margin:0;"><strong><span style="font-size:9pt;color:#666b71;font-family:Verdana;">To test a Web Service you must create a windows application or web application to consume this service? It is True/False?</span></strong><span style="font-size:9pt;color:#666b71;font-family:Verdana;"><br />
FALSE<strong><span style="font-family:Verdana;">How many classes can a single.NET DLL contain?</span></strong><br />
Answer1:<br />
As many</p>
<p>Answer2:<br />
One or more</p>
<p><strong><span style="font-family:Verdana;">What are good ADO.NET object(s) to replace the ADO Recordset object?</span></strong><br />
The differences includes<br />
In ADO, the in-memory representation of data is the recordset.<br />
In ADO.net, it is the dataset<br />
A recordset looks like a single table in ADO<br />
In contrast, a dataset is a collection of one or more tables in ADO.net<br />
ADO is designed primarily for connected access<br />
ADO.net the disconnected access to the database is used<br />
In ADO you communicate with the database by making calls to an OLE DB provider.<br />
In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source.<br />
In ADO you cant update the database from the recordset. ADO.NET the data adapter allows you to control how the changes to the dataset are transmitted to the database.</p>
<p><strong><span style="font-family:Verdana;">On order to get assembly info which namespace we should import?</span></strong><br />
System.Reflection Namespace</p>
<p><strong><span style="font-family:Verdana;">How do you declare a static variable and what is its lifetime? Give an example.</span></strong><br />
Answer1<br />
static int Myint–The life time is during the entire application.<br />
br&amp;gt; Answer2<br />
The static modifier is used to declare a static member, which belongs to the type itself rather than to a specific object. The static modifier can be used with fields, methods, properties, operators, events and constructors, but cannot be used with indexers, destructors, or types. In C#, the static keyword indicates a class variable. In VB, the equivalent keyword is Shared. Its scoped to the class in which it occurs.</p>
<p>Example<br />
a. Static int var //in c#.net<br />
b. static void Time( ) //in c#.net</p>
<p><strong><span style="font-family:Verdana;">How do you get records number from 5 to 15 in a dataset of 100 records? Write code.</span></strong><br />
Answer1<br />
DataSet ds1=new DataSet(); String strCon=”data source=IBM-6BC8A0DACEF;initial catalog=pubs;integrated security=SSPI;persist” +” security info=False;user<br />
id=sa;workstation id=IBM-6BC8A0DACEF;packet size=4096?;<br />
String strCom1=”SELECT * FROM employee”;<br />
SqlDataAdapter sqlDa1=new SqlDataAdapter(strCom1,strCon);<br />
ds1.Tables.Add(”employee”);<br />
sqlDa1.Fill(ds1,40,50,ds1.Tables[”employee”].TableName);<br />
DataGrid dg1.DataSource=ds1.Tables[”employee”].DefaultView;<br />
dg1.DataBind();</p>
<p>Answer2<br />
OleDbConnection1.Open()<br />
OleDbDataAdapter1.Fill(DataSet21, 5, 15, “tab”)<br />
This will fill the dataset with the records starting at 5 to 15<br />
.NET Database interview questions</p>
<p><strong><span style="font-family:Verdana;">How do you call and execute a Stored Procedure in.NET? Give an example.</span></strong><br />
Answer1<br />
ds1=new DataSet();<br />
sqlCon1=new SqlConnection(connectionstring);<br />
String strCom1=”byroyalty”;<br />
sqlCom1=new SqlCommand(strCom1,sqlCon1);<br />
sqlCom1.CommandType=CommandType.StoredProcedure;<br />
sqlDa1=new SqlDataAdapter(sqlCom1);<br />
SqlParameter myPar=new SqlParameter(”@percentage”,SqlDbType.Int);<br />
sqlCom1.Parameters.Add (myPar);<br />
myPar.Value=40;<br />
sqlDa1.Fill(ds1);<br />
dg1.DataSource=ds1;<br />
dg1.DataBind();</p>
<p>Answer2<br />
Yes<br />
Dim cn as new OleDbConnection ( “Provider=Microsoft.Jet.OLEDB.4.0;”+ _<br />
“Data Source=C:\Documents and Settings\User\My Documents\Visual Studio Projects\1209\db1.mdb”+ _<br />
“User ID=Admin;”+ _<br />
“Password=;”);<br />
Dim cmd As New OleDbCommand(”Products”, cn)<br />
cmd.CommandType = CommandType.StoredProcedure<br />
Dim da As New OleDataAdapter(cmd)<br />
Dim ds As New DataSet()<br />
da.Fill(ds, “Products”)<br />
DataGrid1.DataSource = ds.Tables(”Products”)</p>
<p><strong><span style="font-family:Verdana;">What is the maximum length of a varchar in SQL Server?</span></strong><br />
Answer1<br />
VARCHAR[(n)]<br />
Null-terminated Unicode character string of length n,<br />
with a maximum of 255 characters. If n is not supplied, then 1 is assumed.</p>
<p>Answer2<br />
8000</p>
<p>Answer3<br />
The business logic is the aspx.cs or the aspx.vb where the code is being written. The presentation logic is done with .aspx extention.</p>
<p><strong><span style="font-family:Verdana;">How do you define an integer in SQL Server?</span></strong><br />
We define integer in Sql server as<br />
var_name int</p>
<p><strong><span style="font-family:Verdana;">How do you separate business logic while creating an ASP.NET application?</span></strong><br />
There are two level of asp.net debugging<br />
1. Page level debugging<br />
For this we have to edit the page level debugging enable the trace to true in the line in the html format of the page.<br />
%@ Page Language=”vb” trace=”true”AutoEventWireup=”false” Codebehind=”WebForm1.aspx.vb” Inherits=”WebApplication2.WebForm1?&amp;gt;</p>
<p>2. You can enable the debugging in the application level for this<br />
Edit the following trace value in web.config file<br />
Enable trace enabled=true.</p>
<p>If there is a calendar control to be included in each page of your application, and and we do not intend to use the Microsoft-provided calendar control, how do you develop it? Do you copy and paste the code into each and every page of your application?</p>
<p>Create the Calendar User Control<br />
The control we will create will contain a calendar control and a label which has the corresponding date and time written<br />
Steps are:-</p>
<p>Creating a CalenderControl<br />
1) To begin, open Visual Studio .NET and begin a new C# Windows Control Library.<br />
2) You may name it whatever you like, for this sample the project name will be CalenderControl</p>
<p>Using the Calender Control in a Windows Application<br />
It’s just like adding any other control like a button or a label.<br />
1) First, create a new Windows Application project named: CustomControl.<br />
2) Add a reference to the Calender Control DLL named: CalenderControl.dll.<br />
3) Now you a can customize the Toolbox:<br />
Right-Click the Toolbox&amp;gt; .NET Framework Components&amp;gt; Browse&amp;gt; select the CalenderControl.dll.<br />
4)The Calender Control is now added to the Toolbox and can be inserted in Windows Form as any other control. The control itself will take care of the date display</p>
<p><strong><span style="font-family:Verdana;">How can you deploy an asp.net application ?</span></strong><br />
You can deploy an ASP.NET Web application using any one of the following three deployment options.<br />
a) Deployment using VS.NET installer<br />
b) Using the Copy Project option in VS .NET<br />
c) XCOPY Deployment</p>
<p><strong><span style="font-family:Verdana;">Explain similarities and differences between Java and.NET?</span></strong><br />
Comparing Java and .NET is comparing apples and oranges. Either the question needs to be to compare Java and C# or J2EE and .NET.</p>
<p><strong><span style="font-family:Verdana;">What are the XML files that are important in developing an ASP.NET application?</span></strong><br />
The XML file necessary for the for developing an asp.net application is Web.config</p>
<p><strong><span style="font-family:Verdana;">Specify the best ways to store variables so that we can access them in various pages of ASP.NET application?</span></strong><br />
Declare the variables in Global.aspx</p>
<p><strong><span style="font-family:Verdana;">How many objects are there in ASP?</span></strong><br />
Answer1<br />
8 objects, they are request,response, server,application,session,file, dictionary, textstream.</p>
<p>Answer2<br />
There are 6 objects in ASP.net<br />
a) Server<br />
b) Session<br />
c) Application<br />
d) ObjectContext<br />
e) Response<br />
f) Request</p>
<p><strong><span style="font-family:Verdana;">Which DLL file is needed to be registered for ASP?</span></strong><br />
The dll needed for the ASP.net is SYSTEM.WEB.dll</p>
<p><strong><span style="font-family:Verdana;">Is there any inbuilt paging (for example shoping cart, which will show next 10 records without refreshing) in ASP? How will you do pating?</span></strong><br />
Use DataGrid control which has in-built paging features for the purpose.</p>
<p><strong><span style="font-family:Verdana;">What does Server.MapPath do?</span></strong><br />
Answer1<br />
srver.mappath() maps the path given in the argument to the server’s physical path.</p>
<p>Answer2<br />
It returns the complete(absolute) path of the file used in parameter.</p>
<p>Answer3<br />
It returns a string containing the physical path in the server’s file system that corresponds to the virtual or relative path specified by the Path argument.</p>
<p><strong><span style="font-family:Verdana;">Name atleast three methods of response object other than Redirect.</span></strong><br />
Answer1<br />
a) Response.Clear( )<br />
Clears the content of the current output stream.<br />
b) Response.Close( )<br />
Closes the network socket for the current response.<br />
c) Response.End( )<br />
Stops processing the current request and sends all buffered content to the client immediately.</p>
<p>Answer2<br />
methods of Response is Redirect a. Transfer</p>
<p><strong><span style="font-family:Verdana;">Name atleast two methods of response object other than Transfer.</span></strong><br />
a) Response.ClearContent( )<br />
Clears the content of the current output stream.<br />
b) Response.ClearHeaders( )<br />
Clears the HTTP headers from the current output stream.</p>
<p><strong><span style="font-family:Verdana;">What is State?</span></strong><br />
It is the property of the web forms.<br />
ASP.NET provides four types of state:<br />
Application state<br />
Session state<br />
Cookie state<br />
View state.</p>
<p><strong><span style="font-family:Verdana;">Explain differences between ADO and DAO.</span></strong><br />
dao- can access only access database<br />
ado- can access any databases</p>
<p><strong><span style="font-family:Verdana;">How many types of cookies are there?</span></strong><br />
2 types, persistant and impersistant.</p>
<p><strong><span style="font-family:Verdana;">How many types of cookies are there?</span></strong><br />
Answer1<br />
Two type of cookeies.<br />
a) single valued eg request.cookies(”UserName”).value=”Mahesh”<br />
b)Multivalued cookies. These are used in the way collections are used.<br />
e.g.<br />
request.cookies(”CookiName”)(”UserName”)=”Mahesh”<br />
request.cookies(”CookiName”)(”UserID”)=”ABC003?<br />
rember no value method in multivalued cooki</p>
<p>Answer2<br />
There are two types of cookies:<br />
Session cookies<br />
Persistent cookies</p>
<p><strong><span style="font-family:Verdana;">Tell few steps for optimizing (for speed and resource) ASP page/application.</span></strong><br />
Avoid mixing html code with asp code</p>
<p><strong><span style="font-family:Verdana;">Which command using Query Analyzer will give you the version of SQL Server and Operating System?</span></strong><br />
@@VERSION<br />
Returns version, processor architecture, build date, and operating system for the current installation of SQL Server.</p>
<p><strong><span style="font-family:Verdana;">How to find the SQL server version from Query Analyser</span></strong><br />
Answer1<br />
To determine which version of Microsoft SQL Server 2005 is running, connect to SQL Server 2005 by using SQL Server Management Studio, and then run the following Transact-SQL statement:<br />
SELECT SERVERPROPERTY(’productversion’), SERVERPROPERTY (’productlevel’), SERVERPROPERTY (’edition’)<br />
The results are:<br />
• The product version (for example, “9.00.1399.06?)<br />
. • The product level (for example, “RTM”).<br />
• The edition (for example, “Enterprise Edition”).<br />
For example, the result looks similar to:<br />
9.00.1399.06 RTM Enterprise Edition</p>
<p><strong><span style="font-family:Verdana;">How to determine which version of SQL Server 2000 is running</span></strong><br />
To determine which version of SQL Server 2000 is running, connect to SQL Server 2000 by using Query Analyzer, and then run the following code:<br />
SELECT SERVERPROPERTY(’productversion’), SERVERPROPERTY (’productlevel’), SERVERPROPERTY (’edition’)<br />
The results are:<br />
• The product version (for example, 8.00.534).<br />
• The product level (for example, “RTM” or “SP2?).<br />
• The edition (for example, “Standard Edition”). For example, the result looks similar to<br />
:<br />
8.00.534 RTM Standard Edition</p>
<p>Answer2<br />
One can also use SELECT @@Version where the result would look like<br />
Microsoft SQL Server 2005 &#8211; 9.00.1399.06 (Intel X86)<br />
Oct 14 2005 00:33:37<br />
Copyright (c) 1988-2005 Microsoft Corporation<br />
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)</p>
<p><strong><span style="font-family:Verdana;">Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table.</span></strong><br />
Answer1.<br />
a. Select count(*) from table1<br />
b. SELECT object_name(id) ,rowcnt FROM sysindexes WHERE indid IN (1,0) AND OBJECTPROPERTY(id, ‘IsUserTable’) = 1<br />
c. exec sp_table_validation @table = ‘authors’</p>
<p><span style="font-size:9pt;color:#666b71;font-family:Verdana;">Answer2.<br />
SELECT count( * ) as totalrecords FROM employee<br />
This will display total records under the name totalrecords in the table employee<br />
use COUNT_BIG<br />
Returns the number of items in a group.<br />
@@ROWCOUNT<br />
Returns the number of rows affected by the last statement.<br />
Use this statement after an SQL select * statement, to retrieve the total number of rows in the table</p>
<p></span></span></p>
<p> </p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="background:white;line-height:12pt;margin:0;"><strong><span style="font-size:9pt;color:#666b71;font-family:Verdana;">To test a Web Service you must create a windows application or web application to consume this service? It is True/False?</span></strong><span style="font-size:9pt;color:#666b71;font-family:Verdana;"><br />
FALSE<strong><span style="font-family:Verdana;">How many classes can a single.NET DLL contain?</span></strong><br />
Answer1:<br />
As many</p>
<p>Answer2:<br />
One or more</p>
<p><strong><span style="font-family:Verdana;">What are good ADO.NET object(s) to replace the ADO Recordset object?</span></strong><br />
The differences includes<br />
In ADO, the in-memory representation of data is the recordset.<br />
In ADO.net, it is the dataset<br />
A recordset looks like a single table in ADO<br />
In contrast, a dataset is a collection of one or more tables in ADO.net<br />
ADO is designed primarily for connected access<br />
ADO.net the disconnected access to the database is used<br />
In ADO you communicate with the database by making calls to an OLE DB provider.<br />
In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source.<br />
In ADO you cant update the database from the recordset. ADO.NET the data adapter allows you to control how the changes to the dataset are transmitted to the database.</p>
<p><strong><span style="font-family:Verdana;">On order to get assembly info which namespace we should import?</span></strong><br />
System.Reflection Namespace</p>
<p><strong><span style="font-family:Verdana;">How do you declare a static variable and what is its lifetime? Give an example.</span></strong><br />
Answer1<br />
static int Myint–The life time is during the entire application.<br />
br&amp;gt; Answer2<br />
The static modifier is used to declare a static member, which belongs to the type itself rather than to a specific object. The static modifier can be used with fields, methods, properties, operators, events and constructors, but cannot be used with indexers, destructors, or types. In C#, the static keyword indicates a class variable. In VB, the equivalent keyword is Shared. Its scoped to the class in which it occurs.</p>
<p>Example<br />
a. Static int var //in c#.net<br />
b. static void Time( ) //in c#.net</p>
<p><strong><span style="font-family:Verdana;">How do you get records number from 5 to 15 in a dataset of 100 records? Write code.</span></strong><br />
Answer1<br />
DataSet ds1=new DataSet(); String strCon=”data source=IBM-6BC8A0DACEF;initial catalog=pubs;integrated security=SSPI;persist” +” security info=False;user<br />
id=sa;workstation id=IBM-6BC8A0DACEF;packet size=4096?;<br />
String strCom1=”SELECT * FROM employee”;<br />
SqlDataAdapter sqlDa1=new SqlDataAdapter(strCom1,strCon);<br />
ds1.Tables.Add(”employee”);<br />
sqlDa1.Fill(ds1,40,50,ds1.Tables[”employee”].TableName);<br />
DataGrid dg1.DataSource=ds1.Tables[”employee”].DefaultView;<br />
dg1.DataBind();</p>
<p>Answer2<br />
OleDbConnection1.Open()<br />
OleDbDataAdapter1.Fill(DataSet21, 5, 15, “tab”)<br />
This will fill the dataset with the records starting at 5 to 15<br />
.NET Database interview questions</p>
<p><strong><span style="font-family:Verdana;">How do you call and execute a Stored Procedure in.NET? Give an example.</span></strong><br />
Answer1<br />
ds1=new DataSet();<br />
sqlCon1=new SqlConnection(connectionstring);<br />
String strCom1=”byroyalty”;<br />
sqlCom1=new SqlCommand(strCom1,sqlCon1);<br />
sqlCom1.CommandType=CommandType.StoredProcedure;<br />
sqlDa1=new SqlDataAdapter(sqlCom1);<br />
SqlParameter myPar=new SqlParameter(”@percentage”,SqlDbType.Int);<br />
sqlCom1.Parameters.Add (myPar);<br />
myPar.Value=40;<br />
sqlDa1.Fill(ds1);<br />
dg1.DataSource=ds1;<br />
dg1.DataBind();</p>
<p>Answer2<br />
Yes<br />
Dim cn as new OleDbConnection ( “Provider=Microsoft.Jet.OLEDB.4.0;”+ _<br />
“Data Source=C:\Documents and Settings\User\My Documents\Visual Studio Projects\1209\db1.mdb”+ _<br />
“User ID=Admin;”+ _<br />
“Password=;”);<br />
Dim cmd As New OleDbCommand(”Products”, cn)<br />
cmd.CommandType = CommandType.StoredProcedure<br />
Dim da As New OleDataAdapter(cmd)<br />
Dim ds As New DataSet()<br />
da.Fill(ds, “Products”)<br />
DataGrid1.DataSource = ds.Tables(”Products”)</p>
<p><strong><span style="font-family:Verdana;">What is the maximum length of a varchar in SQL Server?</span></strong><br />
Answer1<br />
VARCHAR[(n)]<br />
Null-terminated Unicode character string of length n,<br />
with a maximum of 255 characters. If n is not supplied, then 1 is assumed.</p>
<p>Answer2<br />
8000</p>
<p>Answer3<br />
The business logic is the aspx.cs or the aspx.vb where the code is being written. The presentation logic is done with .aspx extention.</p>
<p><strong><span style="font-family:Verdana;">How do you define an integer in SQL Server?</span></strong><br />
We define integer in Sql server as<br />
var_name int</p>
<p><strong><span style="font-family:Verdana;">How do you separate business logic while creating an ASP.NET application?</span></strong><br />
There are two level of asp.net debugging<br />
1. Page level debugging<br />
For this we have to edit the page level debugging enable the trace to true in the line in the html format of the page.<br />
%@ Page Language=”vb” trace=”true”AutoEventWireup=”false” Codebehind=”WebForm1.aspx.vb” Inherits=”WebApplication2.WebForm1?&amp;gt;</p>
<p>2. You can enable the debugging in the application level for this<br />
Edit the following trace value in web.config file<br />
Enable trace enabled=true.</p>
<p>If there is a calendar control to be included in each page of your application, and and we do not intend to use the Microsoft-provided calendar control, how do you develop it? Do you copy and paste the code into each and every page of your application?</p>
<p>Create the Calendar User Control<br />
The control we will create will contain a calendar control and a label which has the corresponding date and time written<br />
Steps are:-</p>
<p>Creating a CalenderControl<br />
1) To begin, open Visual Studio .NET and begin a new C# Windows Control Library.<br />
2) You may name it whatever you like, for this sample the project name will be CalenderControl</p>
<p>Using the Calender Control in a Windows Application<br />
It’s just like adding any other control like a button or a label.<br />
1) First, create a new Windows Application project named: CustomControl.<br />
2) Add a reference to the Calender Control DLL named: CalenderControl.dll.<br />
3) Now you a can customize the Toolbox:<br />
Right-Click the Toolbox&amp;gt; .NET Framework Components&amp;gt; Browse&amp;gt; select the CalenderControl.dll.<br />
4)The Calender Control is now added to the Toolbox and can be inserted in Windows Form as any other control. The control itself will take care of the date display</p>
<p><strong><span style="font-family:Verdana;">How can you deploy an asp.net application ?</span></strong><br />
You can deploy an ASP.NET Web application using any one of the following three deployment options.<br />
a) Deployment using VS.NET installer<br />
b) Using the Copy Project option in VS .NET<br />
c) XCOPY Deployment</p>
<p><strong><span style="font-family:Verdana;">Explain similarities and differences between Java and.NET?</span></strong><br />
Comparing Java and .NET is comparing apples and oranges. Either the question needs to be to compare Java and C# or J2EE and .NET.</p>
<p><strong><span style="font-family:Verdana;">What are the XML files that are important in developing an ASP.NET application?</span></strong><br />
The XML file necessary for the for developing an asp.net application is Web.config</p>
<p><strong><span style="font-family:Verdana;">Specify the best ways to store variables so that we can access them in various pages of ASP.NET application?</span></strong><br />
Declare the variables in Global.aspx</p>
<p><strong><span style="font-family:Verdana;">How many objects are there in ASP?</span></strong><br />
Answer1<br />
8 objects, they are request,response, server,application,session,file, dictionary, textstream.</p>
<p>Answer2<br />
There are 6 objects in ASP.net<br />
a) Server<br />
b) Session<br />
c) Application<br />
d) ObjectContext<br />
e) Response<br />
f) Request</p>
<p><strong><span style="font-family:Verdana;">Which DLL file is needed to be registered for ASP?</span></strong><br />
The dll needed for the ASP.net is SYSTEM.WEB.dll</p>
<p><strong><span style="font-family:Verdana;">Is there any inbuilt paging (for example shoping cart, which will show next 10 records without refreshing) in ASP? How will you do pating?</span></strong><br />
Use DataGrid control which has in-built paging features for the purpose.</p>
<p><strong><span style="font-family:Verdana;">What does Server.MapPath do?</span></strong><br />
Answer1<br />
srver.mappath() maps the path given in the argument to the server’s physical path.</p>
<p>Answer2<br />
It returns the complete(absolute) path of the file used in parameter.</p>
<p>Answer3<br />
It returns a string containing the physical path in the server’s file system that corresponds to the virtual or relative path specified by the Path argument.</p>
<p><strong><span style="font-family:Verdana;">Name atleast three methods of response object other than Redirect.</span></strong><br />
Answer1<br />
a) Response.Clear( )<br />
Clears the content of the current output stream.<br />
b) Response.Close( )<br />
Closes the network socket for the current response.<br />
c) Response.End( )<br />
Stops processing the current request and sends all buffered content to the client immediately.</p>
<p>Answer2<br />
methods of Response is Redirect a. Transfer</p>
<p><strong><span style="font-family:Verdana;">Name atleast two methods of response object other than Transfer.</span></strong><br />
a) Response.ClearContent( )<br />
Clears the content of the current output stream.<br />
b) Response.ClearHeaders( )<br />
Clears the HTTP headers from the current output stream.</p>
<p><strong><span style="font-family:Verdana;">What is State?</span></strong><br />
It is the property of the web forms.<br />
ASP.NET provides four types of state:<br />
Application state<br />
Session state<br />
Cookie state<br />
View state.</p>
<p><strong><span style="font-family:Verdana;">Explain differences between ADO and DAO.</span></strong><br />
dao- can access only access database<br />
ado- can access any databases</p>
<p><strong><span style="font-family:Verdana;">How many types of cookies are there?</span></strong><br />
2 types, persistant and impersistant.</p>
<p><strong><span style="font-family:Verdana;">How many types of cookies are there?</span></strong><br />
Answer1<br />
Two type of cookeies.<br />
a) single valued eg request.cookies(”UserName”).value=”Mahesh”<br />
b)Multivalued cookies. These are used in the way collections are used.<br />
e.g.<br />
request.cookies(”CookiName”)(”UserName”)=”Mahesh”<br />
request.cookies(”CookiName”)(”UserID”)=”ABC003?<br />
rember no value method in multivalued cooki</p>
<p>Answer2<br />
There are two types of cookies:<br />
Session cookies<br />
Persistent cookies</p>
<p><strong><span style="font-family:Verdana;">Tell few steps for optimizing (for speed and resource) ASP page/application.</span></strong><br />
Avoid mixing html code with asp code</p>
<p><strong><span style="font-family:Verdana;">Which command using Query Analyzer will give you the version of SQL Server and Operating System?</span></strong><br />
@@VERSION<br />
Returns version, processor architecture, build date, and operating system for the current installation of SQL Server.</p>
<p><strong><span style="font-family:Verdana;">How to find the SQL server version from Query Analyser</span></strong><br />
Answer1<br />
To determine which version of Microsoft SQL Server 2005 is running, connect to SQL Server 2005 by using SQL Server Management Studio, and then run the following Transact-SQL statement:<br />
SELECT SERVERPROPERTY(’productversion’), SERVERPROPERTY (’productlevel’), SERVERPROPERTY (’edition’)<br />
The results are:<br />
• The product version (for example, “9.00.1399.06?)<br />
. • The product level (for example, “RTM”).<br />
• The edition (for example, “Enterprise Edition”).<br />
For example, the result looks similar to:<br />
9.00.1399.06 RTM Enterprise Edition</p>
<p><strong><span style="font-family:Verdana;">How to determine which version of SQL Server 2000 is running</span></strong><br />
To determine which version of SQL Server 2000 is running, connect to SQL Server 2000 by using Query Analyzer, and then run the following code:<br />
SELECT SERVERPROPERTY(’productversion’), SERVERPROPERTY (’productlevel’), SERVERPROPERTY (’edition’)<br />
The results are:<br />
• The product version (for example, 8.00.534).<br />
• The product level (for example, “RTM” or “SP2?).<br />
• The edition (for example, “Standard Edition”). For example, the result looks similar to<br />
:<br />
8.00.534 RTM Standard Edition</p>
<p>Answer2<br />
One can also use SELECT @@Version where the result would look like<br />
Microsoft SQL Server 2005 &#8211; 9.00.1399.06 (Intel X86)<br />
Oct 14 2005 00:33:37<br />
Copyright (c) 1988-2005 Microsoft Corporation<br />
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)</p>
<p><strong><span style="font-family:Verdana;">Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table.</span></strong><br />
Answer1.<br />
a. Select count(*) from table1<br />
b. SELECT object_name(id) ,rowcnt FROM sysindexes WHERE indid IN (1,0) AND OBJECTPROPERTY(id, ‘IsUserTable’) = 1<br />
c. exec sp_table_validation @table = ‘authors’</p>
<p><span style="font-size:9pt;color:#666b71;font-family:Verdana;">Answer2.<br />
SELECT count( * ) as totalrecords FROM employee<br />
This will display total records under the name totalrecords in the table employee<br />
use COUNT_BIG<br />
Returns the number of items in a group.<br />
@@ROWCOUNT<br />
Returns the number of rows affected by the last statement.<br />
Use this statement after an SQL select * statement, to retrieve the total number of rows in the table</p>
<p></span></span></p>
<p> </p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vinayhatwal.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vinayhatwal.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vinayhatwal.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vinayhatwal.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vinayhatwal.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vinayhatwal.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vinayhatwal.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vinayhatwal.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vinayhatwal.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vinayhatwal.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vinayhatwal.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vinayhatwal.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vinayhatwal.wordpress.com&blog=4320862&post=8&subd=vinayhatwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vinayhatwal.wordpress.com/2008/07/25/adonet-interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30134ff30180ffc15825d15c005dbce5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vinayhatwal</media:title>
		</media:content>
	</item>
	</channel>
</rss>