What is CLR?
What is CTS( common type system)
What is CLS
What is a IL:
What is a Assembly:
What is Manifest?
Metadata:
What is a Managed Code?
Unmanaged Code:
What are the different types of Assembly?
What is a Satellite Assembly?
What is GAC ?
What is a formatter?
What is Boxing and Unboxing?
What is Remoting? Give Example.
What is an Application Domain? How they get created?
What is Marshalling?
What is a Static class? What are its features?
What is Code Access security? What is CAS in .NET?
What is Ajax?
what is marshling?
What is the concept of strong names ?
What is garbage collection?
What is reflection
List the types of Authentication supported by ASP.NET.
Explain Web Services.
What is UDDI ?
What is DISCO
What is WSDL?
What is the purpose of Server.MapPath method in Asp.Net?
What is the purpose of Server.MapPath method in Asp.Net?
What is the purpose of Server.MapPath method in Asp.Net?
What is ViewState?
What are benefits and Limitation of using Viewstate for state management?
What are the different modes of storing an ASP.NET session?
How many types of validation controls are provided by ASP.NET ?
What’s the use of “GLOBAL.ASAX” file ?
What is Postback?
What is a .resx file?
How to pass values between pages?
What is Data Binding?
What is Difference between NameSpace and Assembly:
What are Value types and Reference types :
What is the difference between VB.NET and C# ?
What is the difference between Asp and Asp.net ?
What is the difference between Convert.toString and .toString() method ?
What is difference between abstract classes and interfaces?
What is the difference between Shadowing and Overriding ?
hat are similarities between Class and structure ?
What is the difference between Class and structure’s ?
What is the difference between Server.Transfer and response.Redirect ?
What is the difference between Authentication and authorization?
What is difference between dataset and datareader ?
Describe the difference between inline and code behind.
What’s the difference between Response.Write() andResponse.Output.Write()?
What is the difference between a session object and an application object?
Explain the differences between Server-side and Client-side code?
Whats the difference between web.config and app.config?
What is the difference between ExecuteScalar and ExecuteNonQuery? What is ExecuteReader?
Difference between Abstract Class and Interface
How’s method overriding different from overloading?
What’s the difference between System.String and System.StringBuilder classes?
What are the different exception-handling approaches that can be used in ASP.NET?
What is the difference between .Net Remoting and Asp.Net Web Services?
What are the different state management techniques used in asp.net for web applications?
What are the different modes for the sessionstates in the web.config file?
What is smart navigation?
Differences between Datagrid, Datalist and Repeater?
What methods are fired during the page load?
What is the difference between an EXE and a DLL?
Explain the difference between an ADO.NET Dataset and an ADO Recordset?
What’s a bubbled event?
What is Authentication and Authorization?
What are the types of Authentication?
What are the different types of Caching?
What are the layouts of ASP.NET Pages?
What are the different methods available under sqlcommand class to access the data?
What is Object Oriented Programming ?
What is a class?
What is an Object?
What is Encapsulation?
What is Abstraction?
What is Overloading?
What is Overriding?
What is Shadowing?
What is Inheritance?
What is an Abstract class?
What is an Interface?
What is Polymorphism?
What is serialization?
Association
What is a Delegate?
Write a query to select the second highest salary from a table.
What is a Stored Procedure? State its advantage.
What is a Trigger?
What is a FOREIGN KEY?
What is a VIEW?
What is cursors?
What's the difference between a primary key and a unique key?
What is difference between DELETE & TRUNCATE commands?
Difference between Function and Stored Procedure?
How to find 6th highest salary from Employee table
What types of Joins are possible with Sql Server?
What does the "EnableViewState" property do?
What is MSIL?
What are cookies?
What is Cache?
What is global assembly cache?
What is the purpose of Server.MapPath method in Asp.Net?
Answer:
Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace
What is CLR?
It is the execution engine for all .NET applications
The .NET Framework provides a Runtime environment called the Common Language Runtime or (CLR) that handles the execution of the code and provides useful services for the implementation of the application. Like
· memory management
· debugging
· security, etc.
The CLR is also known as Virtual Execution System (VES).
What is CTS( common type system):
The CTS defines the rules concerning data types.
The common type system defines how types are declared, used, and managed in the runtime, and is also an important part of the runtime's support for cross-language integration
The CTS defines the common data types used by .NET programming languages. The CTS tells you how to represent characters and numbers in a program
What is CLS:
It means Common Language Specification, it is a subset oh CTS and ensures interoperability between the languages in .NET environment
IL:
Intermediate Language is also known as MSIL (Microsoft Intermediate Language) All .NET source code is compiled to IL. This IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In- Time (JIT) compiler
(JIT) compiler:
(IL) is converted into machine code is done by Just-In- Time (JIT) compiler
What is a Assembly:
· Assembly is a basic building block in .net framework.
· Assembly is unit of deployment like EXE or a DLL
· An assembly consists of one or more files (dlls, exe’s, html files etc.), and represents a group of resources, type definitions, and implementations of those types.
· An assembly may also contain references to other assemblies. These resources, types and references are described in a block of data called a manifest.
· The manifest is part of the assembly, thus making the assembly self-describing.
· An assembly contains metadata information, which is used by the CLR for everything from type checking and security to actually invoking the components methods.
What is Manifest?
Assembly metadata is stored in Manifest The manifest describes the assembly itself, providing the logical attributes shared by all the modules and all components in the assembly. The manifest contains
· assembly name
· version number,
· locale and an optional strong name that uniquely identifying the assembly.
This manifest information is used by the CLR.
The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a stand-alone PE file that contains only assembly manifest information.
Metadata:
meta data is called as data about data . Metadata describes the contents in an assembly...assembly consists of metadata which has details about the assembly
· assembly name
· culture
· version number
· public key
What is a Managed Code?
The code runs inside the environment of CLR is called managed code. i.e. .NET runtime. In short all IL are managed code.
Unmanaged Code:
Code that is not controlled by the CLR is called Unmanaged Code.
you are using some third party software example VB6 or VC++ component they are unmanaged code as .NET runtime (CLR) does not have control over the source code execution of the language.
What are the different types of Assembly?
There are two types of assembly Private and Public assembly.
A private assembly is intended only for one application. The files of that assembly must be placed in the same folder as the application or in a sub folder. No other application will be able to make a call to this assembly. The advantage of having a private assembly is that, it makes naming the assembly very easy,.
A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. Crystal report classes which will be used by all application for Reports.
What is a Satellite Assembly?
Satellite assemblies contain resource files corresponding to a locale (Culture + Language) and these assemblies are used in deploying an application globally for different languages.
What is GAC ?
Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.
GAC stands for Global Assembly cache, which is a repository of all Shared Assemblies
GAC is used in the following situations :-
· If the application has to be shared among several application.
· If the assembly has some special security requirements like only administratorscan remove the assembly
· If the assembly is private then a simple delete ofassembly the assembly file will remove the assembly
What is a formatter?
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.
What is Boxing and Unboxing?
Boxing is the process where any value type can be implicitly converted to a reference type object .
Unboxing is the opposite of boxing process where the reference type is converted to a value type.
What is an Application Domain? How they get created?
An Application Domain can be thought of as a lightweight processes controlled by the .Net runtime. Application Domains are usually created by hosts like Windows Shell, ASP.NET and IE. When you run a .NET application from the command-line, the host is the Shell. The Shell creates a new Application Domain for every application.
What is Remoting? Give Example.
Remoting is a means by which one operating system process, or program, can communicate with another process. The two processes can exist on the same computer or on two computers connected by a LAN or the Internet. Web services are probably the best known type of remoting, but they are not the only option.
What is Marshalling?
Marshaling is a process of making an object in one process (the server) available to another process (the client).
What is a Static class? What are its features?
Static class is a class which can be used or accessed without creating an instance of the class.
Important Features:
i. Static class only contains static members and a private constructor.
ii. Static class cannot be instantiated.
iii. Static classes are sealed by default and therefore cannot be inherited.
What is Code Access security? What is CAS in .NET?
CAS is the feature of the .NET security model that determines whether an application or a piece of code is permitted to run and decide the resources it can use while running.
What is Ajax?
Asyncronous Javascript and XML - Ajax is a combination of client side technologies that sets up asynchronous communication between the user interface and the web server so that partial page rendering occur instead of complete page postbacks.
what is marshling?
Marshaling performs the necessary conversions in data formats between managed and unmanaged code.CLR allows managed code to interoperate with unmanaged code usining COM Marshaler(Component of CLR).
What is the concept of strong names ?
Strong name is assemblies Global name.
A name that consists of an assembly's identity—its simple text name, version number, and culture information (if provided)—strengthened by a public key and a digital signature generated over the assembly.
It Uses a public key encryption scheme to create a digital signature to ensure a truely unique strong name.
Strong Name is only needed when we need to deploy assembly in GAC. Strong Names helps GAC to differentiate between two versions.
What is garbage collection?
Garbage collection is a CLR feature which automatically manages memory. It is the process of allocation and deallocation of memory during runtime.
What is reflection
All .NET assemblies have metadata information stored about the types defined in modules. This metadata information can be accessed by mechanism called as “Reflection”.System. Reflection can be used to browse through the metadata information.
List the types of Authentication supported by ASP.NET.
· Windows (default)
· Forms
· Passport
Explain Web Services.
Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.
What is UDDI ?
Full form of UDDI is Universal Description, Discovery and Integration. It is a directory that can be used to publish and discover public Web Services
What is DISCO
DISCO is the abbreviated form of Discovery. It is basically used to club or group common services together on a server and provides links to the schema documents of the services
What is WSDL?
Web Service Description Language (WSDL)is a W3C specification which defines XML grammar for describing Web Services.XML grammar describes details such as:-
· Where we can find the Web Service (its URI)?
· Data type support.
· What are the methods and properties that service supports?
· Supported protocols
In short its a bible of what the webservice can do.Clients can consume this WSDL and build proxy objects that clients use to communicate with the Web Services
What is the purpose of Server.MapPath method in Asp.Net?
In Asp.Net Server.MapPath method maps the specified relative or virtual path to the corresponding physical path on the server. Server.MapPath takes a path as a parameter and returns the physical location on the hard drive.
What is the use of Master Pages in Asp.Net?
A master page in ASP.Net provides shared HTML, controls, and code that can be used as a template for all of the pages of a website.
Every master page has asp:contentplaceholder control that will be filled by the content of the pages that use this master page.
You can create a master page that has header and footer i.e. a logo, an image, left navigation bar etc and share this content on multiple pages. You need not to put these things on every aspx page.
What are different types of caching using cache object of ASP.NET:
You can use two types of output caching to cache information that is to be transmitted to and displayed in a Web browser:
Page Output Caching
Page output caching adds the response of page to cache object. Later when page is requested page is displayed from cache rather than creating the page object and displaying it. Page output caching is good if the site is fairly static.
Page Fragment Caching
If ts of the page are changing, you can wrap the static sections as user controls and cache the user controls using page fragment caching.
What is ViewState?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks
The ViewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a What’s the use of “GLOBAL.ASAX” file ?
It allows to executing ASP.NET application level events and setting application-level variables.
What is Postback?
When an action occurs (like button click), the page containing all the controls within the
What is a .resx file?
The .resx resource file format consists of XML entries, which specify objects and strings inside XML tags. This is useful for localization.
How to pass values between pages?
QueryString - The QueryString method of passing values between web pages is one of the oldest methods of passing values between pages
Context - The context object is used to send values between pages.
Session - The session object is used to persist data across a user session during the user's visit to a website.
Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.
What is Difference between NameSpace and Assembly:
· Assembly is physical grouping of logical units. Namespace logically groups
classes.
· Namespace can span multiple assembly
What are Value types and Reference types :
· Value types directly contain their data
· Value types are allocated on the stack.
· Value types may not contains null values
· Examples of values types are: integers, floating point numbers, character data, Boolean values, Enumerations and Structures
· Reference types store a reference to the value's memory address
· Reference types are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types.
· Reference types may contain null values
· Example of Reference type: classes, array, structure
· Variables that are value types each have their own copy of the data, and therefore operations on one variable do not affect other variables.
· Variables that are reference types can refer to the same object; therefore, operations on one variable can affect the same object referred to by another variable.
What is the difference between VB.NET and C# ?
Advantages VB.NET :-
· Has support for optional parameters which makes COM interoperability much easy.
· With Option Strict off late binding is supported.Legacy VB functionalities can be used by using Microsoft.VisualBasic namespace.
· Has the WITH construct which is not in C#.
· The VB.NET part of Visual Studio .NET compiles your code in the background. While this is considered an advantage for small projects, people creating very large projects have found that the IDE slows down considerably as the project gets larger.
Advantages of C#:
· XML documentation is generated from source code but this is now been incorporated in Whidbey.
· Operator overloading which is not in current VB.NET but is been introduced in Whidbey.
· Use of this statement makes unmanaged resource disposal simple.
· Access to Unsafe code. This allows pointer arithmetic etc, and can improve performance in some situations. However, it is not to be used lightly, as a lot of the normal safety of C# is lost (as the name implies).This is the major difference that you can access unmanaged code in C# and not in VB.NET.
What is the difference between Asp and Asp.net ?
· ASP is Interpreted. ASP.NET is Compiled.
· ASP.NET, code is written in two ways that is Code-Inline and Code-Behind. Code-Inline means writting the code in .aspx page itself. Code-Behind is writting code in .aspx.vb or .aspx.cs page
· ASP.NET page functions must be declared in blocks
· ASP.NET does not support page-render functions
· ASP the code is written in html page itself.
· In ASP, page functions could be declared within <% %> blocks:
· page-render functions could be declared with <% %> blocks
What is the difference between Convert.toString and .toString() method ?
The basic difference between them is “Convert” function handles NULLS while “i.ToString()” does not it will throw a NULL reference exception error. So as good coding practice using “convert” is always safe.
What is difference between abstract classes and interfaces?
· Abstract classes can have concrete methods while interfaces have no methods implemented.
· Interfaces do not come in inheriting chain, while abstract classes come in inheritance.
· In the interface no accessibility modifiers are allowed, which is ok in abstract classes.
What is the difference between Shadowing and Overriding ?
· Overriding redefines only the implementation while shadowing redefines the whole element.
· In overriding derived classes can refer the parent class element by using “ME” keyword, but in shadowing you can access it by “MYBASE”.
What are similarities between Class and structure ?
· Both can have constructors, methods, properties, fields, constants, enumerations, events, and event handlers.
· Structures and classes can implement interface.
· Both of them can have constructors with and without parameter.
· Both can have delegates and events.
What is the difference between Class and structure’s ?
· Structure are value types and classes are reference types. So structures use stack and classes use heap.
· Structures members can not be declared as protected, but class members can be. You can not do inheritance in structures.
· Structures do not require constructors while classes require.
· Objects created from classes are terminated using Garbage collector. Structures are not destroyed using GC.
What is the difference between Server.Transfer and response.Redirect ?
· Response.Redirect sends message to the browser saying it to move to some different page, while server.transfer does not send any message to the browser but rather redirects the user directly from the server itself. So in server.transfer there is no round trip while response.redirect has a round trip and hence puts a load on server.
· Using Server.Transfer you can not redirect to a different from the server itself. Example if your server is www.yahoo.com you can use server.transfer to move to www.microsoft.com but yes you can move to www.yahoo.com/travels, i.e. within websites. This cross server redirect is possible only using Response.redirect.
· With server.transfer you can preserve your information. It has a parameter called as “preserveForm”. So the existing query string etc. will be able in the calling page. In response.redirect you can maintain the state, but has lot of drawbacks.
What is the difference between Authentication and authorization?
· Authentication is verifying the identity of a user
· Authorization is process where we check does this identity have access rights to the system.
What is difference between dataset and datareader ?
· DataReader provides forward-only and read-only access to data, while the DataSet object can hold more than one table (in other words more than one rowset) from the same data source as well as the relationships between them.
· Dataset is a disconnected architecture while datareader is connected architecture.
· Dataset can persist contents while datareader can not persist contents, they are forward only.
Describe the difference between inline and code behind.
· Inline code is written along side the HTML in a page. There is no separate distinction between design code and logic code.
· Code-behind is code written in a separate file and referenced by the .aspx page
What’s the difference between Response.Write() andResponse.Output.Write()?
Response.Output.Write() allows you to write formatted output
What is the difference between a session object and an application object?
· A session object can persist information between HTTP requests for a particular user, whereas an application object can be used globally for all the users.
What is difference between dataset and datareader in ADO.NET?
· A DataReader provides a forward-only and read-only access to data, while the DataSet object can carry more than one table and at the same time hold the relationships between the tables.
· DataReader is used in a connected architecture whereas a Dataset is used in a disconnected architecture.
· The Dataset is an core of disconnected architecture.Disconnected architecture means once you have retriveed the data from the database the connect of the datasource is dropped.The disconnected data become very commonlyThe dataset for the disconnected data from the Dataset object.
What is the difference between Response.Redirect() and Server.Transfer().
Response.Redirect
· Tranfers the page control to the other page, in other words it sends the request to the other page.
· Causes the client to navigate to the page you are redirecting to. In http terms it sends a 302 response to the client, and the client goes where it's told.
Server.Transfer
· Only transfers the execution to another page and during this you will see the URL of the old page since only execution is transfered to new page and not control.
· Occurs entirely on the server, no action is needed by the client
Explain the differences between Server-side and Client-side code?
· Server side code will execute at server (where the website is hosted) end, & all the business logic will execute at server end
· client side code will execute at client side (usually written in javascript, vbscript, jscript) at browser end.
Whats the difference between web.config and app.config?
· Web.config is used for web based asp.net applications whereas app.config is used for windows based applications.
· machine.config File is for all the sites which are running under same server(Ex:IIS).
· Web.config is ment for to set common settings for all the forms under the same site.
· If you make any changes to the web.config, web application will immediately load the changed config. But in case of
· Web.config files specify configuration settings for a particular web application, and are located in the application's root directory; the machine.config file specifies configuration settings for all of the websites on the web server, and is located in $WINDOWSDIR$\Microsoft.Net\Framework\Version\CONFIG.
What is the difference between ExecuteScalar and ExecuteNonQuery? What is ExecuteReader?
ExecuteScalar - Returns only one value after execution of the query. It returns the first field in the first row. This is very light-weight and is perfect when all your query asks for is one item. This would be excellent for receiving a count of records (Select Count(*)) in an sql statement, or for any query where only one specific field in one column is required.
ExecuteNonQuery - This method returns no data at all. It is used majorly with Inserts and Updates of tables. It is used for execution of DML commands.
Difference between Abstract Class and Interface
1) A class may inherit only one abstract class, but may implement multiple number of Interfaces.
2) Members of an abstract class may have any access modifier, but members of an interface are public by default, and cant have any other access modifier.
How’s method overriding different from overloading?
· When overriding, you change the method behavior for a derived class.
· Overloading simply involves having a method with the same name within the class.
What’s the difference between System.String and System.StringBuilder classes?
· System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
· Using try, catch and finally block in the code.
· Using the Error event procedures at the Page, Application or Global levels
· Using the Server Object's GetLastError and ClearError methods
What is the difference between .Net Remoting and Asp.Net Web Services?
· ASP.NET Web Services Can be accessed only over HTTP but .Net Remoting Can be accessed over various protocols like TCP, HTTP, SMTP etc.
· Web Services are based on stateless service architecture but .Net Remoting support for both stateful and stateless environment.
· Web Services support heterogeneous environments means interoperability across platforms but .Net remoting requires .Net on both server and client end.
· .NET Remoting provides the fast communication than Web Services when we use the TCP channel and the binary formatter.
· Web services support only the objects that can be serialized but .NET Remoting can provide support to all objects that inherit MarshalByRefObject.
· Web Services are reliable than .Net remoting because Web services are always hosted in IIS.
· Web Services are ease to create and deploy but .Net remoting is bit complex to program.
What are the different state management techniques used in asp.net for web applications?
In ASP.Net the state can be maintained in following ways
Server-side state management
1.Application objects 2. Session Variables 3.Database
Client-side state management
1.Cookies 2. Hidden input fields 3. Query String 4. ViewState
What are the different modes for the sessionstates in the web.config file?
· Off: Indicates that session state is not enabled.
· Inproc: Indicates that session state is stored locally.
· StateServer: Indicates that session state is stored on a remote server.
· SQLServer: Indicates that session state is stored on the SQL Server.
What is smart navigation?
The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
Differences between Datagrid, Datalist and Repeater?
· Datagrid has paging while Datalist doesnt.
· Datalist has a property called repeat. Direction = vertical/horizontal. (This is of great help in designing layouts). This is not there in Datagrid.
· A repeater is used when more intimate control over html generation is required
What is the Global.asax used for?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events
What are the different types of Session state management options available with ASP. NET?
ASP. NET provides In-Process and Out-of-Process state management.
In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server.
Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable
What methods are fired during the page load?
Init() When the page is instantiated,
Load() - when the page is loaded into server memory,
PreRender () - the brief moment before the page is displayed to the user as HTML,
Unload() - when page finishes loading.
What is the difference between an EXE and a DLL?
An EXE can run independently, whereas DLL will run within an EXE. DLL is an in-process file and EXE is an out-process file
Explain the difference between an ADO.NET Dataset and an ADO Recordset?
· A DataSet can represent an entire relational database in memory, complete with tables, relations, and views, A Recordset can not.
· A DataSet is designed to work without any continuing connection to the original data source; Recordset maintains the contentious connection with the original data source.
· There’s no concept of cursor types in a DataSet, They are bulk loaded, while Recordset work with cursors and they are loaded on demand.
· DataSets have no current record pointer, you can use For Each loops to move through the data. Recordsets have pointers to move through them.
· Dataset can fetch source data from many tables at a time, for Recordset you can achieve the same only using the SQL joins.
What’s a bubbled event?
When a complex control like datalist or datagrid, which contains a child control, using an itemcommand can listen to the events raised by the child control in the main control. The process of listening to the child control in the main or parent control is called as event bubbling.
What is Authentication and Authorization?
Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password) and Authorization performs after authentication.
Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.
What are the types of Authentication?
There are 3 types of Authentication. Windows, Forms and Passport Authentication.
Windows authentication uses the security features integrated into the Windows NT and Windows XP operating systems to authenticate and authorize Web application users.
Forms authentication allows you to create your own list/database of users and validate the identity of those users when they visit your Web site.
Passport authentication uses the Microsoft centralized authentication provider to identify users. Passport provides a way to for users to use a single identity across multiple Web applications. To use Passport authentication in your Web application, you must install the Passport SDK.
What are the different types of Caching?
Output Caching: stores the responses from an asp.net page.
Fragment Caching: Only caches/stores the portion of page (User Control)
Data Caching: is Programmatic way to Cache objects for performance.
What are the layouts of ASP.NET Pages?
GridLayout and FlowLayout. GridLayout positions the form object on absolute x and y co-ordinates of the screen.
FlowLayout positions the form objects relative to each other.
What are the different methods available under sqlcommand class to access the data?
ExecuteReader –Used where one or more records are returned – SELECT Query.
ExecuteNonQuery – Used where it affects a state of the table and no data is being queried - INSERT, UPDATE, DELETE, CREATE and SET queries.
ExecuteScalar – Used where it returns a single record(a single value normally) – SQL Functions like MIN(), NAX()
What is Object Oriented Programming ?
It is a problem solving technique to develop software systems. It is a technique to think real world in terms of objects. Object maps the software model to real world concept. These objects have responsibilities and provide services to application or other objects.
What is a class?
Class is concrete representation of an entity. It represents a group of objects, which hold similar attributes and behavior. It provides Abstraction and Encapsulations.
It’s a comprehensive data type which represents a blue print of objects. It’s a template of object.
What is an Object? What is Object Oriented Programming?
It is a basic unit of a system. An object is an entity that has attributes, behavior, and identity. Objects are members of a class. Attributes and behavior of an object are defined by the class definition.
What is Encapsulation?
It is a process of hiding all the internal details of an object from the outside world.
Encapsulation is binding of attributes and behaviors. Hiding the actual implementation and exposing the functionality of any object. Encapsulation is the first step towards OOPS, is the procedure of covering up of data and functions into a single unit (called class). Its main aim is to protect the data from out side world.
What is Abstraction?
Hiding the complexity. It is a process of defining communication interface for the functionality and hiding rest of the things.
What is Overloading?
Adding a new method with the same name in same/derived class but with different number/types of parameters. It implements Polymorphism.
What is Overriding?
A process of creating different implementation of a method having a same name as base class, in a derived class. It implements Inheritance.
What is Shadowing?
When the method is defined as Final/sealed in base class and not override able and we need to provide different implementation for the same. This process is known as shadowing, uses shadows/new keyword.
What is Inheritance?
It is a process of acquiring attributes and behaviors from another object (normally a class or interface).
What is an Abstract class?
An abstract class is a special kind of class that cannot be instantiated. It normally contains one or more abstract methods or abstract properties. It provides body to a class.
What is an Interface?
An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body.
What is Polymorphism?
polymorphism is a generic term that means 'many shapes'. (from the Greek meaning "having multiple forms"). Polymorphism is briefly described as "one interface, many implementations." polymorphism is a characteristic of being able to assign a different meaning or usage to something in different contexts
There are two types of polymorphism one is compile time polymorphism and the other is run time polymorphism. Compile time polymorphism is functions and operators overloading. Runtime time polymorphism is done using inheritance and virtual functions.
What is serialization?
Serialization is the process of converting an object into a stream of bytes.
De-serialization is the opposite process of creating an object from a stream of bytes.
Association
This is the simplest relationship between objects. Example every customer has sales. So Customer object and sales object have an association relation between them.
What is a Delegate?
A delegate is a strongly typed function pointer object that encapsulates a reference to a method, and so the function that needs to be invoked may be called at runtime.
Delegate is a class that can hold a reference to a method or a function. Delegate class has a signature and it can only reference those methods whose signature is compliant with the class. Delegates are type-safe functions pointers or callbacks.
Write a query to select the second highest salary from a table.
SELECT max(salary) AS salary2 FROM orders WHERE salary < (SELECT max(salary) AS salary1 FROM orders)
Write a query to select the 5th highest salary from a table.
SELECT min(salary) AS high5 FROM employee WHERE salary IN(SELECT DISTINCT TOP 5 salary FROM orders ORDER BY salary DESC)
What is a Stored Procedure? State its advantage.
A stored procedure is a set of pre-compiled SQL commands (query statements), which are stored in the server. It is faster then the loose SQL statements processed on client, as it is pre-compiled. It can execute more then one SQL commands once as they are bundled in a single entity.
What is a Trigger?
Triggers are a special type of stored procedure, which gets invoked upon a certain event. They can be performed upon an INSERT, UPDATE and DELETE.
What is a FOREIGN KEY?
A FOREIGN KEY is one or more columns whose values are based on the PRIMARY or CANDITATE KEY values from the database.
What is a VIEW?
A View is a database object that is a logical representation of a table. It is derived from a table but has no storage space of its own and often may be used in the same manner as a table.
What is cursors?
Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time.
What's 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.
· default primary key creates a clustered index on the column
· default unique creates a nonclustered index on the column
· primary key doesn't allow NULLs,
· unique key allows one NULL only.
What is difference between DELETE & TRUNCATE commands?
· Delete command removes the rows from a table based on the condition that we provide with a WHERE clause.
· Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.
TRUNCATE
· TRUNCATE can not be Rolled back.
· TRUNCATE is DDL Command.
· TRUNCATE Resets identity of the table.
DELETE
· DELETE Can be Rolled back.
· DELETE is DML Command.
· DELETE does not reset identity of the table.
Difference between Function and Stored Procedure?
· UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section
· Stored procedures cannot be.
How to find 6th highest salary from Employee table
SELECT TOP 1 salary FROM (SELECT DISTINCT TOP 6 salary FROM employee ORDER BY salary DESC) a ORDER BY salary
What types of Joins are possible with Sql Server?
Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.
Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.
What is a join? Explain the different types of joins?
Join is a query, which retrieves related columns or rows from multiple tables.
Self Join - Joining the table with itself.
Equi Join - Joining two tables by equating two common columns.
Non-Equi Join - Joining two tables by equating two common columns.
Outer Join - Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.