P. 1
11 Microsoft

11 Microsoft

|Views: 1|Likes:
Published by withrj

More info:

Published by: withrj on Aug 30, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





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


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


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

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

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

33. What is the transport protocol you use to call a Web service SOAP? Http is preferred for Soap while tcp for binary i. We perform it at the time of trans port an object in remoting. The derived class inherits some or everything of the base class. Differences between Datagrid. View State Maintains the UI State of a Page View State is base64encoded. 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.NET uses to keep track of server control state values that don't otherwise post back as part of the HTTP form.Net success Kit • • 32. HTTP is used in web services and tcp works well in remoting. 35. 34. Ex: Public Class Base ----End Class Public Class Derived Inherits Base --End Class 37. 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. 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. The old class is called the base class and the new class is called derived class. If you want to NOT maintain the View State. View State: View State is the mechanism ASP.Gopabandhu Behera vi . 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.Microsoft . What exactly is being serialized when you perform serialization? Serialization is the process of converting an object into stream of bytes. include the directive < %@ Page Enable View State="false" % > at the top of an .e. In Visual Basic we use the Inherits keyword to inherit one class from other.aspx page or add the attribute Enable View State="false" to any control. 36.

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

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

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

Unauthenticated users are redirected to the Passport site 4 NONE/CUSTOM AUTHENTICATION: If we don?t want ASP.NONE/CUSTOM AUTHENTICATION The authentication option for the ASP.WINDOWS AUTHENTICATION 2.NET? 1.NET to perform any authentication. 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.Microsoft . we can set the authentication mode to ?none?.Net? The Asp.NET application is specified by using the tag in the Web.FORMS AUTHENTICATION 3. as a Web application developer.NET Authentication Providers and IIS Security? ASP. We want to provide our own custom authentication. Why The JavaScript Validation Not Run on the Asp.config file.Gopabandhu Behera x . offers a single logon point for clients. are supposed to develop the Web page and authenticate the user by checking the provided user ID and password against some user database 3. 50. and our Web site is open for all to use.NET implements authentication using authentication providers. What is ASP. which are code modules that verify credentials and implement other security functionality such as cookie generation. ASP.Net success Kit • • The updates to the system will be automatically available to all its consumers.PASSPORT AUTHENTICATION 4. 51. What are the authentication methods in . 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. 49.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.NET supports the following three authentication providers: • • • • • • • • • • • • • • • • • • • • • • • • • • • • By: Er.PASSPORT AUTHENTICATION A centralized service provided by Microsoft.

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

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

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

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

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

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

Microsoft .Gopabandhu Behera xvii . 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.Net success Kit • • 79. XmlSerializer is throwing a generic "There was an error reflecting MyClass" error.

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

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

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

Gopabandhu Behera xxi . Subqueries are generally used to fill one of couple of needs Break a query up into a series of a logical steps. The % and _ sign is used as a wildcard.Microsoft . Provide a listing to be the target of a WHERE clause together with [IN| ESISTS|ANY|ALL]. TO provide a lookup driven by each individual record in a parent query. 25.What is a Subquery ? A Subquery is a normal T-SQL query that is nested inside another query.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.Net success Kit • • • • • • 24. 26. SELECT SelectList FROM SomeTable WHERE SomeColumn = (SELECT SingleColumn FROM SomeTable WHERE Condition that results in only one row returned) • • • • • • By: Er. 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. Eg.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->