Microsoft .

Net success Kit
• • Success Kit C# Questions? What is a class? Blue print of an object. It is programmer defined datatype.It can be public, private, protected. What is object? It is a specific instance of a class, we are using “new” keyword when we create an object Ex. car c=new car (); What is static member variable and methods? It means belongs to a class rather than to an object. What are the Oops features? a).Encapsulation: Hiding some features from outside world. We are using excess modified like Private, Public, and Protected. b).Pollymorphism: many forms of methods/classes. Ex. Overloaded method. Here we can assign subclass object to a super class object. c).Inheritance: It is process by which sub class inherits member variable & methods from super class. d).Abstraction: It is hiding, providing the interface to the user. Ex. Object. What Is Value Type? Just values in the memory are stored in a class Ex.int, char & struct. What is Reference Type? Contain the address of the object are stored in attack. Ex. Class, interfaces, array & strings. What is constructor? ->It helps in creating an instance of a class? ->Have no return type, not even void. ->Can be private, public/procted. ->Can be overloaded. Access Modifier. Private->It access within the class. Protected->it access within the class & any subclass of that class. Public->It excess by all. Abstract Method. Abstract method is a keyword, which contain abstract method of abstract class. Abstract class:-Which contain abstract methods.

• • • • • • • • • • • • •

• • • •

• • • • •

• • • • • • •

By: Er.Gopabandhu Behera

i

Microsoft .Net success Kit
• ->abstract class can not be instantied. ->Wee using abstract keyword, when we declare a abstract class. Ex.Public abstract class car { } What is Method Overloading? It means same method name & different signature. -> They can be in the same class/different class. ->Public class Adding numbers {Public int add (int a, int b) { Return a+b; } Public int Add (int a, int b,int c) { Return a+b+c; } } What is method overriding? It means same method name & same signature. ->They can not be in the same class. ->It has to be in the subclass. ->Static method can not be overridden. ->Exception can be same or more. ->Excess modified can be same or more. ->Method overriding is done by the ‘virtual’ keyword. What is Boxing & unboxing? Boxing->When storing value type in the form of object type in the heap memory(value type into reference type) UnBoxing->When you are converting object type in the form of value type(reference type into value type). What is an Interface? An interface is just like class but not a class, which contains any abstract method & member variable, should be final/static. It is an entity that is defined by the word Interface. An interface has No implementation; it only has the signature or in other words, just the definition of the Methods without the body. As one of the similarities to abstract class, it is a contract that is Used to define hierarchies for all subclasses or it defines specific set of methods and their


• • •

• •
• • • • • • • • • •

• •
• • • • • •

• • •

• • • •

By: Er.Gopabandhu Behera

ii

config file 16. The process of calling a destructor when an object is reclaimed by the garbage collector is called finalization. The main difference between them is that a class can implement more than one Interface but can only inherit from one abstract class.WriteXML (server. The CLR is the execution engine for .Parse(null) throws an ArgumentNullException. Access to metadata (enhanced type information) Managing memory for managed objects Enforcement of code access security • • • • • • • • • • • • By: Er. When true. interfaces are used to implement multiple inheritance. a destructor has no return type. Or it can be turned off by mentioning cookie state= false in web. to execute all destructors on exit. including: Code management (loading and execution) Application memory isolation Verification of type safety Conversion of IL to native code.Microsoft . except where the string is null. Like constructors.ToInt32(null) returns zero.ToInt32(string) and Int32. It is the runtime that converts a MSIL code into the host machine language code. How do you turn off cookies for one page in your site? Use the Cookie. Since C# doesn’t support multiple Inheritance. this property instructs the client application not to save the Cookie on the users hard disk when a session ends.What is the difference between Convert.NET Framework applications. Discard Property which Gets or sets the discard flag set by the server. It is called when an object is no more required. What is CLR? CLR is .Parse(string)? The two give identical results. which is then executed appropriately.xml")) 19. running on a separate thread. It provides a number of services.Gopabandhu Behera iii . The name of the destructor is the same as the class name and is preceded by a tilde(~) sign. whereas Int32. How u can create XML file? To write Dataset Contents out to disk as an XML file use: MyDataset.Net success Kit • • • • • • • • • • • Arguments. 17. Convert. Note: Destructor takes no arguments. C# manages the memory dynamically and uses a garbage collector.What are Destructors? A destructor is opposite to s constructor.NET equivalent of Java Virtual Machine (JVM). • • • • • • 18.MapPath ("MyXMLFile.

cls is small set of specification to make all languages as a .vc++) wants to be compliant language it has to follow cls standard. =>CLS : cls is a standard for . and pre-existing DLL's (unmanaged code And data) Automation of object layout Support for developer Services (profiling. debugging.net. Which two properties are on every validation control? Control to validate & Error Message.Gopabandhu Behera iv . 22. 20.net compliant languages.NET Framework and the operations Performed on those types. 23. When user requests another page previous page data no longer available. 21. if my languages (c#.Microsoft .j#.collect method but it is recommended that u should not call this coz we don’t know the exact time when the gc will be called automatic.in clr common language runtime). Session State persist the data of particular user in the server. What is "Common Type System" (CTS)? CTS define all of the basic types that can be used in the . in . =>CTS : Common Type System is also a standard like cls. If two languages (c# or vb.net . cls make a use of cts and clr. In c# we use int which is converted to Int32 of CLR to Communicate with vb. can I free memory explicitly without waiting for garbage Collector to free the memory? Yes you can clear the memory using gc. COM objects. What Is The Difference Between View State and Session State? View State persist the values of controls of particular page in the client (browser) when post Back operation done.Net success Kit • • Exception handling. 24. All this time we have been talking about language interoperability. and so on).NET Compact Framework. they have to convert into some common type (i. None of this is possible without all the language sharing the same • • • • • • • • • • • • • • • • • • • • • • • • • • • By: Er.NET Class Framework.net which uses Integer or vice versa. This data available till user close the browser or session time completes. and .e.vb.net or j# or vc++) wants to communicate with each other. including cross-language exceptions Interoperation between managed code. What is CTS and CLS? =>cls stands for common language specification where as cts stands for common type system.

Why is catch(Exception) almost always a bad idea? Well.doc file try yourself • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • By: Er. private void Button12_Click(object sender.) 26. using(StreamReader reader=new StreamReader(path)) { string line. VC++. 27.Net) permissions are granted. System. 29. How can I read .EventArgs e) { string path="C:Inetpub ew1.Gopabandhu Behera v . How do you turn off cookies for one page in your site? By setting the Cookie. 30. Discard property false. while ((line=reader. What this means is that an int should mean the same in VB. What is Full Trust? Your code is allowed to do anything in the framework. 25.is used to execute more than one program at a time. 28. How do you create a permanent cookie? By setting the expiry date of the cookie to a later time (like 10 years later. a process is a collection of threads that share the same virtual memory. meaning that all (.Text+="<br>"+line.NET compliant languages.doc document in ASP. The GAC has Full Trust because it’s on the local HD. and a thread always run in a process context. 31. What is the difference between thread and process? Thread .Net success Kit • • data types. you can change that using caspol . } } } from . if at that point you know that an error has occurred. This is achieved through introduction of Common Type System (CTS). process .executes single programA thread is a path of execution that run on CPU. How to get the column count of a report? SY-LINSZ system variable gives the column count (line size) and SYLINCT for line count.Microsoft .ReadLine())!=null) { Label2. A process has at least one thread of execution. and that has Full Trust by default. then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.Net? You can read from a text file like this.txt". C# and all other .

In Visual Basic we use the Inherits keyword to inherit one class from other. 34. HTTP is used in web services and tcp works well in remoting. include the directive < %@ Page Enable View State="false" % > at the top of an . 35.Gopabandhu Behera vi . View State: View State is the mechanism ASP. Ex: Public Class Base ----End Class Public Class Derived Inherits Base --End Class 37. What is the transport protocol you use to call a Web service SOAP? Http is preferred for Soap while tcp for binary i. Can you explain what inheritance is and an example of when you might use it? The process of deriving a new class from an existing class is called Inheritance. The derived class inherits some or everything of the base class.aspx page or add the attribute Enable View State="false" to any control.Net success Kit • • 32. View State Maintains the UI State of a Page View State is base64encoded. If you want to NOT maintain the View State. Differences between Datagrid. Briefly explain how server form post-back works ? Post Back: The process in which a Web page sends data back to the same page on the server. It is not encrypted but it can be encrypted by setting Enable View Stat MAC="true" & setting the machine Key validation type to 3DES. Datalist and Repeater? • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • By: Er.e. What exactly is being serialized when you perform serialization? Serialization is the process of converting an object into stream of bytes.NET uses to keep track of server control state values that don't otherwise post back as part of the HTTP form. The old class is called the base class and the new class is called derived class. We perform it at the time of trans port an object in remoting. 33.Microsoft . How does the Xml Serializer work? What ACL permissions does a process using it require? Xml Serializer requires write permission to the system’s TEMP directory. 36.

NET Framework. How different are interface and abstract class in . instead of working on a row-by-row basis. Finally. DataGrid caters to sorting and has basic paging for your disposal. Again you have little contro. A server control is a compiled DLL file and cannot be edited. be manipulated through its public properties at designtime or runtime. Briefly explain what user controls are and what server controls are and the differences between the two. The Repeater repeats a chunk of HTML you write. Occasionally I like using a DataList because it allows me to easily list out my records in rows of three for instance.NET control (sometimes called a server control) is a server-side component that is shipped with . It is possible to build a custom server control (sometimes called a custom control or composite • • • • • • • • • • • By: Er. you’re working on a column-by-column basis. I use the Repeater the most due to its flexibility w/ HTML. Datalist has a property called repeat. Creating a Pagination scheme isn't that hard. It can.Net success Kit • • • • • • • • • • • • • • • • • Datagrid has paging while Datalist doesnt.Gopabandhu Behera vii . the DataGrid is the motherload. it has the least functionality of the three. over the HTML. Out of the 3 controls. accept you have very little control over the HTML that the control renders. An ASP. A repeater is used when more intimate control over html generation is required.Net? Abstract classes can not be instantiated it can have or cannot have abstract method basically known as mustinherit as the methods are static in nature where interfaces are the declaration and r defined where they are called used for dynamic methods 39.Microsoft . 38. (This is of great help in designing layouts). however. DataList is the next step up from a Repeater. DataList is the first of the three controls that allow you RepeatColumns horizontally or vertically. so I rarely if ever use a DataGrid. However. NOTE: DataList and DataGrid both render as HTML tables by default. Direction = vertical/horizontal. When only checkboxes/radiobuttons are repeatedly served then a checkboxlist or radiobuttonlist are used as they involve fewer overheads than a Datagrid. This is not there in Datagrid.

) 42. ViewState is persisted to a string variable by the ASP. it is good practice to return its default value on postback. The type of ViewState is System.Net success Kit • • • • • • • control).NET. Delegates can invoke the methods that they reference without making explicit calls to those methods.NET page framework and sent to the client and back as a hidden variable. It has an interface that can be completely edited and changed. While there will be a multitude of controls for every possible function built by third-party vendors for ASP. (If a property is not persisted in ViewState. a user control will consist of previously built server controls (called constituent controls when used within a user control).StateBag. What is serialization. Serialization is used to save session state in ASP. 40.Gopabandhu Behera viii . If a control uses ViewState for property data instead of a private field. which is a dictionary that stores name/value pairs. It can be manipulated at design-time and runtime via properties that you are responsible for creating.NET. Delegate is an entity that is entrusted with the task of representation.NET? Serialization is when you persist the state of an object to a storage medium so an exact copy can be re-created at a later stage. (We will build these in part 2 of this article.Net ? Object 45.Web. as mentioned above. that property automatically will be persisted across round trips to the client. What is the root class in . assign or passing on information. how it works in . Serialization is to copy objects to the Clipboard in Windows Forms Serialization is used by remoting to pass objects by value from one application domain to another. Upon postback. 41. Explain how Viewstate is being formed and how it is stored on client. In code sense.Microsoft . it means a Delegate is entrusted with a Method to report • • • • • • • • • • • • • • • • • • • • • • By: Er. they will exist in the form of compiled server controls. the page framework parses the input string from the hidden variable and populates the ViewState property of each control. What is Delegation? A delegate acts like a strongly type function pointer.UI.) In contrast.NET answer to ActiveX Web controls. Custom server controls may be the .

o In-Proc (By Default) o SQL-Server (Out-proc) . Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced . You can use reflection to dynamically create an instance of a type.Net success Kit • • information back to it when a certain task (which the Method expects) is accomplished outside the Method's class. For example. o State-Server (Out-Proc) . Reflection provides objects that encapsulate assemblies.Using State Server.Microsoft . It will require minimal setup on the client machines • • • • • • • • • • • • • • • • • • • • • • • • • • • By: Er.Using SQL server or any other database for storing sessions regarding current logged in user. as one dedicated server for managing sessions. You can then invoke the type's methods or access its fields and properties.NET component? A web service has the following characteristics: It communicates using open protocols like HTTP Processes XML messages framed using SOAP May be described using WSDL Can be discovered using UDDI Any application which is supposed to reach a wide customer base should be written as a web service. services which help in stock trading by providing analysis of market trends could best be implemented as a web service. dynamically determine all the classes contained in a given assembly and invoke their methods. 48.Gopabandhu Behera ix .Reflection 47. one support the in-proc mechanism and other two's support the out-proc mechanism. Describe session handling in a web farm. 46. modules. or get the type from an existing object. The reasons are Such a web service would be easily discovered by potential customers when they need it. For example. bind the type to an existing object.NET there are three ways to manage session objects. What is Reflection? It extends the benefits of metadata by allowing developers to inspect and use it at runtime. and types. Namespace: System. as opposed to customized applications for specific customers. how does it work and what are the limits ? In ASP. State Server will run as service on web server having dotnet installed.

51.NET implements authentication using authentication providers.Net success Kit • • The updates to the system will be automatically available to all its consumers.Microsoft .config file. are supposed to develop the Web page and authenticate the user by checking the provided user ID and password against some user database 3. 49. Unauthenticated users are redirected to the Passport site 4 NONE/CUSTOM AUTHENTICATION: If we don?t want ASP. as shown below: other authentication options WINDOWS AUTHENTICATION Schemes o Integrated Windows authentication o Basic and basic with SSL authentication o Digest authentication o Client Certificate authentication FORMS AUTHENTICATION You.NET supports the following three authentication providers: • • • • • • • • • • • • • • • • • • • • • • • • • • • • By: Er.Gopabandhu Behera x .WINDOWS AUTHENTICATION 2.PASSPORT AUTHENTICATION A centralized service provided by Microsoft. which are code modules that verify credentials and implement other security functionality such as cookie generation. We want to provide our own custom authentication.NET Authentication Providers and IIS Security? ASP. without any need to deploy the updates on their machines. The reason behind this decision could be: We don?t want to authenticate our users.FORMS AUTHENTICATION 3. we can set the authentication mode to ?none?. What is ASP.Net Button Is post backed on the server & not yet Submit & when It goes to the server its states is lost So if we r using JavaScript in our application so we always use the Input Button in the asp Button. Why The JavaScript Validation Not Run on the Asp.NONE/CUSTOM AUTHENTICATION The authentication option for the ASP. ASP. as a Web application developer.PASSPORT AUTHENTICATION 4.NET? 1.NET application is specified by using the tag in the Web. 50. What are the authentication methods in . and our Web site is open for all to use.NET to perform any authentication.Net? The Asp. offers a single logon point for clients.

Gopabandhu Behera xi . which means that subsequent authentications are unnecessary. wat are they? Private.Microsoft . when exposing the functionalitiss across different Platforms • • • • • • • • • • • • • • • • • • By: Er. A shared assembly is normally stored in the global assembly cache. in conjunction with the Microsoft? Passport software development kit (SDK). provides similar functionality as Forms Authentication to Passport users. Passport Authentication: This is a centralized authentication service provided by Microsoft that offers a single logon facility and membership services for participating sites. Subsequent requests are issued with the cookie in the request headers.NET issues a cookie that contains the credentials or a key for reacquiring the client identity.NET Framework: Predefined attributes such as Assembly Version. which is a repository of assemblies maintained by the . ASP. 52. Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced .NET component? Webservice: Appropriate. Satellite assemblies are often used to deploy language-specific resources for an application. Public/Shared. 53. A private assembly is normally used by a single application. and is stored in the application's directory. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. The user can then supply logon credentials. which already exist and are accessed through the Runtime Classes. What are Attributes? Attributes are declarative tags in code that insert additional metadata into an assembly.NET.NET runtime. and custom attributes. Satellite. ASP. Attribute class. 54.Net success Kit • • • • • • • • • • • Forms Authentication: Using this provider causes unauthenticated requests to be redirected to a specified HTML form using client side redirection. which you write yourself by extending the System. There exist two types of attributes in the . If the application authenticates the request (using application-specific logic). and post the form back to the server. How many types of assemblies are there .

or another list of items.Now. } 57. value. It provides a forward-only. or Java-Java platform) 55.Net..NET Component: Appropriate..NET to J2EE.Value = "http://www.Net-. when exposing the functionalities within propritory O/S(. .e. 58.faqpanel.. ExecuteNonQuery : Use for data manipulation.AddMonths(6). read-only. 56.How to get a cookie? if (Request. Delete. an XML file.Add(myWebSiteName).etc. myCookie.What is difference between ExecuteReader. Update.Value. The Repeater control may be bound to a database table. myCookie. and very quick searches can be made for values by searching through their keys.What is Repeater Control in ASP.Cookies["myWebSiteName"].com/".What is Hashtable in ASP. such as Insert.Microsoft . • • • • • • • • • • • • • • • • • • • • • • • • By: Er. Advantage of Strongly Typed dataset It is faster than late-bound data retrieval expression.How to set a cookie? HttpCookie myCookie = new HttpCookie("myWebSiteName"). Items are added to the Hashtable with the Add() method. Its column name is shown in intellisense as you type code. 59. 60. It is faster than other ways of retriving a single value from DB.Cookies["myWebSiteName"] != null) { string myWebSiteUrl = Request.Gopabandhu Behera xii .Net? The Hashtable object contains items in key/value pairs.Cookies.Net success Kit • • • • (windows/Linux/Solaris. ExecuteScalar : Use for retriving 1 row 1 col. ExecuteNonQuery and ExecuteScalar? ExecuteReader : Use for accessing data.What is Strongly Typed Dataset Object? Strongly typed Dataset object allows you to create early-bound data retrieval expression.Expires = DateTime.) or. eg: for retriving aggregate function. connected recordset. i. The keys are used as indexes.Net? The Repeater control is used to display a repeated list of items that are bound to the control. Response. Single value.

Manual and Disabled. 62. Once a service is installed. like the Repeater control. or they can be started manually when required. the DataList control adds a table around the data items by default. Windows services can be configured to start when the operating system is booted and run in the background as long as Windows is running.What is DataList Control in ASP. use the FindControl method of the PreviousPage property to reference the data of the control in the first page. The DataList control may be bound to a database table.What is the "Window Service"? On Microsoft Windows operating systems. startup type. Specify service parameters. the form is submitted to a different page. or another list of items. Hence any mismatch in the column will generate compile time errors rather • • • • • • • • • • • By: Er. 63.What is typed dataset? A typed dataset is very much similar to a normal dataset.What is Cross Page Posting? How is it done? By default. Note: Windows Services is new name for NT Services you used to develop in previous versions of Visual Studio. an XML file. It enables users to: Start.Microsoft . a Windows Service is a longrunning executable that performs specific functions and which is designed not to require user intervention.Net submits a form to the same page. In the code-behind of the page to which the form has been posted. But the only difference is that the sehema is already present for the same. stop. In cross-page posting. This is done by setting the PostBackUrl property of the button(that causes postback) to the desired page.Net? The DataList control is. its current status. However.Net success Kit • • 61. ASP. Change the startup type which includes Automatic. it can be managed by launching "Services" from the Windows Control Panel -> Administrative Tools or typing "Services. pause or restart services. used to display a repeated list of items that are bound to the control. The "Services" management console provides a brief description of the service functions and displays the path to the service executable. 64. dependencies and the account under which the service is running.msc" in the Run command on Start menu.Gopabandhu Behera xiii .

Net namespace used to send email in . 65. ASP. MailAttachments .Redirect and Server.Web. Just use Session to access it.Web.Transfer is not working in Session_End? Session_End is fired internally by the server.Gopabandhu Behera xiv .Microsoft . but is never saved because it contains nothing.used for creating a mail attachment to be added to the mail message. 68.Why does the SessionID changes in every request? This may happen if your application has never stored anything in the session state. What does WSDL stand for? WSDL stands for Web Services Description Language. It is an XML representation of the web • • • • By: Er.used for creating and manipulating the mail message contents.Transferdoes not make sense and will not work.Net Framework applications.NET will save the session state even when it is empty.Web.How come Response.Redirect or Server. SmtpMail . In this case. More information on the System. it is not available because this event is not associated with any request. For HttpContext. If the Session_OnStart event is used. • • • • • • • • • • • • • 67. Also accessing the column value is much easier than the normal dataset as the column definition will be available in the schema. you will get the same session ID every time.Mail? System. 69.Mail (SWM) is the . do I have a valid HttpSessionState object and HttpContext object? You will have the HttpSessionState object available. there are two exceptions to this same session ID behavior: If the user has used the same browser instance to request another page that uses the session state.Net success Kit than runtime error as in the case of normal dataset.In Session_End.Mail Namespace can be found on MSDN here: 66.used for sending email to the relay mail server. SWM contains three classes: MailMessage . based on an internal timer. That is why Response. However. a new session state (with a new ID) is created in every request.What is System. And thus there is no HttpRequest associted when that happens.

71. it can be added to the base class without breaking code. and are frequently either partially implemented. One key difference between abstract classes and interfaces is that a class may implement an unlimited number of interfaces.are the ones which contain XML documents as input and output Result oriented operations -. There are two types of the operations specified in the WSDL file. expand by examples of using both. Abstract classes are useful when creating components because they allow you specify an invariant level of functionality in some methods. Document oriented operations -. but leave the implementation of other methods until a specific implementation of that class is needed. They also version well.Gopabandhu Behera xv .are the ones which contain input parameters as the input message and result as the output message 70.Net ? ADO.Microsoft . 73 . but rendered for every otherrow (alternating items) in the Repeater control. What is an interface and what is an abstract class? Please. but may inherit from only one abstract (or any other kind of) class.Net success Kit • • • • • • • service interface.NET features: Disconnected Data Architecture Data cached in Datasets Data transfer in XML format Interaction with the database is done through data commands 72. You can specify a different appearancefor the AlternatingItemTemplate element by setting its style properties. Explain why? Abstract classes are closely related to interfaces.What is reflection? • • • • • • • • • • • • • • • • • • • • • • • By: Er. or not at all implemented. They are classes that cannot be instantiated. because if additional functionality is needed in derived classes. How can you provide an alternating color scheme in a Repeater control? AlternatingItemTemplate Like the ItemTemplate element. What are the features of ADO. as represented by the <soap:binding> attribute of the file. A class that is derived from an abstract class may still implement interfaces.

Shared assemblies are usually libraries of code which many applications will find useful. or even create types dynamically at run-time (see System. The System. This normally doesn't matter. not on private assemblies.g.g. Versioning: The runtime enforces versioning constraints only on shared assemblies.TypeBuilder). that XmlSerializer is a poor choice for loading configuration settings during startup of a GUI application. and is stored in the application's directory. the . • • • • • • • • • By: Er.InvokeMember). 75.NET runtime. during remoting).e. or a subdirectory beneath. which is a repository of assemblies maintained by the .Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.NET class library XmlSerializer and SoapFormatter/BinaryFormatter.Emit.NET framework classes. Why is XmlSerializer so slow? There is a once-per-process-per-type overhead with XmlSerializer.Reflection. and uses SoapFormatter/BinaryFormatter for remoting. SoapFormatter and BinaryFormatter do not have this restriction.NET metadata is very similar to using ITypeLib/ITypeInfo to access type library data in COM. and can be accessed by a mechanism called reflection. to a file or database).g.Microsoft . Microsoft uses XmlSerializer for Web Services. there is a significant delay. • Using reflection to access . determining data type sizes for marshaling data across context/process/machine boundaries. or to persist objects (e. e.g. A shared assembly is normally stored in the global assembly cache.NET Framework have in-built support for serialization? There are two separate mechanisms provided by the .Type.NET compilers produce metadata about the types defined in the modules they produce. What is serialization? Serialization is the process of converting an object into a stream of bytes.Net success Kit • All . Deserialization is the opposite process of creating an object from a stream of bytes. 77. and it is used for similar purposes . Why do I get errors when I try to serialize a Hashtable? XmlSerializer will refuse to serialize instances of any class that implements IDictionary. What is the difference between a private assembly and a shared assembly? Location and visibility: A private assembly is normally used by a single application. • Reflection can also be used to dynamically invoke methods (see System.Gopabandhu Behera xvi . Both are available for use in your own code. for example.Does the . This metadata is packaged along with the module (modules in turn are packaged together in assemblies). but it may mean. So the first time you serialize or deserialize an object of a given type in an application. • • 74. e. 76 . 78.g. Serialization/Deserialization is mostly used to transport objects (e. Hashtable.

Gopabandhu Behera xvii .Net success Kit • • 79.Microsoft . By: Er. How do I find out what the problem is? Look at the InnerException property of the exception that is thrown to get a more specific error message. XmlSerializer is throwing a generic "There was an error reflecting MyClass" error.

DATEADD(dd. • • • • • • • • • By: Er. But by default primary key creates a clustered index on the column. It is used to describe a schema as well as to retrieve rows from table in descending order. every foreign key value must have a corresponding primary key value 6.Net success Kit • • • • • SQl Server 2005 1.Write a SQL Query to find first week day of the month? SELECT DATENAME(dw.DATEPART(dd.e.What is the row size in SQL Server 2000? 8060 bytes.What is the difference between a primary key and a unique key? Both primary key and unique enforce uniqueness of the column on which they are defined.Gopabandhu Behera xviii . primary key does not allow NULLs.What is the use of DESC in SQL Server Query? DESC has two purposes. GETDATE())) AS FirstWeekDayofMonth 4. where are unique key creates a non-clustered index by default. 5. GETDATE()) + 1. 7. but unique key allows one NULL only. Another major difference is that.How to find nth highest salary from Employee table in SQL Server?SELECT TOP 1 salary FROM (SELECT DISTINCT TOP n salary FROM employee ORDER BY salary DESC) a ORDER BY salary.How many Columns per SELECT statement is possible in SQL Server? 4096 2. 3. i.Microsoft .What is the Referential Integrity in SQL Server? Referential integrity refers to the consistency that must be maintained between primary and foreign keys. .

What is a View in SQL Server? A View is something like a virtual table in SQL Server. 17.What command is used to create a table by copying the structure of another table in SQL Server? CREATE TABLE NEWTABLE AS SELECT command 12.Net success Kit • • • • • • • • • • • • • 8. columns to be retrieved from one or more tables.Stored Procedures can have input. constraints super control data being entered in tables for permanent storage. but not necessarily all..Microsoft . 9. If the WHERE condition is true. When data redundancy is to be kept to the minimum while maintaining data security. DELETE FROM EMP. output parameters for it whereas functions can have only input parameters.What are the Stored procedures (sprocs) in SQL Server? Stored Procedures are logically grouped set of transect-SQL statement bundled up into a single unit that perform a specific task. . This query calls for data from some. 16. while functions returns only one value at a time. By: Er. Constraints are much like they sound. First one can not be rolled back but second one will be rolled back. 11. CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2.Rules which are enforced on data being entered. -What Will the outputs of the above two commands (Queries) in SQL Server? Both the statement delete all row from the table EMP.TRUNCATE TABLE EMP. 15. • • • • • • • • • • 14. A view is used just like a table. i. 18.The reason why views are created in SQL Server? When data security is required.e. Instead.Which system table contains information on constraints on all the tables created in SQL Server? USER_CONSTRAINTS table.Which function is used in SQL Server to find the largest integer less than or equal to a specific value? FLOOR.What is difference between function and stored procedure in sql server? Stored Procedures may return multiple values.What is a constraint in SQL Server? A constraint is an object that exists only within confines of a table. except that it does not contains any data of its own. 10. a view is merely a preplanned mapping and representations of the data stored in tables.Gopabandhu Behera xix . Thus.To copy only the structure. the WHERE clause of the SELECT command should contain a FALSE statement as in the following. The plan is stored in the database in the form of query. and prevents the users from entering invalid data into tables are called constraints. They allow for variables and parameters as well as selection and looping constructs. then all the rows or rows satisfying the condition will be copied to the new table. 13.

What is the difference between group by and order by? Group by controls the presentation of the rows. you will find the development cycle takes less time.Gopabandhu Behera xx . while functions are called from within another SQL statement. • • • • • • • • • • • 20. 21.Which function is used to find the smallest integer greater than or equal to a specific value in sql server? CEILING. Efficient reuse of code and programming abstraction.Net success Kit • • • • • • • • • Stored Procedure allows select as well as DML statement in it whereas function allows only select statement in it. Reduced client/server traffic. 19. Stored procedures can be used by multiple users and client programs. you will be happy to learn that stored procedures can reduce long SQL queries to a single line that is transmitted over the wire. SQL Server compiles each stored procedure once and then reutilizes the execution plan. Functions can be called from Stored Procedure whereas Stored Procedures cannot be called from function.What are the benefits of using Stored Procedures in SQL Server? OR Why should we use Stored Procedures? Precompiled execution. This results in tremendous performance boosts when stored procedures are called repeatedly.Which join gives the Cartesian product of two tables in sql server? Cross Join. 22. By: Er. Stored Procedures are called independently. Enhanced security controls.Microsoft .Explain an outer join? An outer join includes rows from tables when there are no matching values in the tables. using the EXEC command. order by controls the presentation of the columns for the results of the SELECT statement. 23. If network bandwidth is a concern in your environment. Exception can be handled by try-catch block in a Stored Procedure whereas try-catch block cannot be used in a function. Stored Procedures can not be utilized in a select statement whereas function can be embedded in a select statement. You can grant users permission to execute a stored procedure independently of underlying table permissions. If you utilize them in a planned manner.

Subqueries are generally used to fill one of couple of needs Break a query up into a series of a logical steps. 25. TO provide a lookup driven by each individual record in a parent query.What is a Subquery ? A Subquery is a normal T-SQL query that is nested inside another query.Microsoft .Net success Kit • • • • • • 24. SELECT SelectList FROM SomeTable WHERE SomeColumn = (SELECT SingleColumn FROM SomeTable WHERE Condition that results in only one row returned) • • • • • • By: Er.Gopabandhu Behera xxi . Provide a listing to be the target of a WHERE clause together with [IN| ESISTS|ANY|ALL]. 26. They are created using parentheses when you have a SELECT statement that serve as the basis for the either part of the data or the condition in another query.What keyword does an SQL SELECT statement use for a string search? The LIKE keyword allows for string searches.What is the DEADLOCK ? A deadlock is a situation in which two transactions conflict with each other and the only resolution is to cancel one transaction. The % and _ sign is used as a wildcard. Eg.

Sign up to vote on this title
UsefulNot useful