LATEST ASP.NET Interview Questions & Answers | Freshers
Last updated on 11th Jun 2020, Blog, Interview Questions
ASP.NET is an open-source, server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services.An ASP.NET page is made up of a number of server controls along with HTML controls, text, and images.
1. What is ASP.NET?
ASP.NET Framework is the part of the NET framework used to create dynamic website, web application,and web services.It is the server-side technology that uses all.NET compatible languages like C#, VB.NET, J#, etc. ASP.NET uses the server control to develop the rapid and interactive application in easy way.
2. What are the Features of ASP.NET?
- It uses the C# and VB.NET languages to build website.
- It allows us to separate a HTML layout with the server-side code.
- It allows us to make same class name qualifying under different namespace.
- ASP.NET pages are the compiled, not interpreted.
- ASP.NET is the request processing engine. It takes an incoming request and passes it through internal pipeline to an endpoint where a developer can attach code to be process that request.
3. Describe state management in ASP.NET?
State management is the technique to manage a state of object on different request. The HTTP protocol is a fundamental protocol of the World Wide Web. HTTP is the stateless protocol means every request is from new user with respect to web server. HTTP protocol does not provide with any method of determining whether any two requests are made by a same person.
4. Explain client side state management system?
ASP.NET provides the several techniques for storing state information on client. These include the following:
view state : ASP.NET uses a view state to track values in controls between the page requests. It works within page only. cannot use a view state value in next page.
control state : It can persist information about control that is not part of view state. If view state is disabled for a control or page, the control state will still work.
hidden fields :It stores a data without displaying that control and data to user’s browser. This data is presented back to server and is available when the form is processed. Hidden fields data is available within page only (page-scoped data).
Cookies : Cookies are the small piece of information that server creates on browser. Cookies store a value in user’s browser that the browser sends with every page request to web server.
Query strings : In query strings, values are the stored at the end of the URL.
5. Explain server side state management system?
Application State : This object stores data that is accessible to all pages in the given Web application.
Cache Object : Caching is a process of storing data that is used frequently by user. Caching increases the application’s performance, scalability, and availability. Can catch the data on server or client.
Session State : Session object stores the user-specific data between individual requests. This object is same as application object but it stores a data about particular user.
6.Explain cookies with example?
A cookie is the small amount of data that server creates on client. When a web server creates cookie, an additional HTTP header is sent to browser when a page is served to browser. The HTTP header looks like this:
Set-Cookie: message=Hello. After the cookie has been created on a browser, whenever browser requests a page from same application in the future, the browser sends the header that looks like this:
7. What are the types of cookies?
Session cookies : A session cookie exists only in a memory. If a user closes a web browser, the session cookie delete permanently.
Persistent cookies : A persistent cookie, on other hand, can available for a months or even years. When create a persistent cookie, the cookie is stored permanently by user’s browser on the user’s computer.
8. Describe the disadvantage of cookies?
- Cookie can store only a string value.
- Cookies are the browser dependent.
- Cookies are not secure.
- Cookies can store a small amount of data.
9. What is the Session object?
HTTP is the stateless protocol; it can’t hold the user information on web page. If the user inserts a some information, and move to the next page, that data will be lost and user would not be able to retrieve information. For accessing that information have to store information. Session provides that facility to store information on a server memory. It can support any type of the object to store. For each user, Session data stores separately which means session is the user specific.
10. What are the Advantages of Session?
- It stores the user state and data that are accessible all over the application.
- It is an simple mechanism to implement and it can store any kind of object.
- It stores the every user data separately.
- Session is secured and transparent from the user because session object is stored on the server.
11. What are the Disadvantages of Session?
Performance overhead in case of a large number of user, because session data is stored in server memory.
Overhead involved in serializing and de-serializing session data. Because in case of StateServer and SQLServer session mode need to serialize a object before store.
12. Describe the Master Page?
Master pages in the ASP.NET works as a template that can reference this page in all other content pages. Master pages enable to define the look and feel of all the pages in the site in a single location. If have done changes in master page, then the changes will reflect in all the web pages that reference master pages. When users are request the content pages, they merge with master page to produce output that combines the layout of master page with the content from a content page.
13. How does one access the Properties and Controls of Master Pages from content pages?
Can access the Properties and Controls of a Master Pages from content pages. In many situations need User’s Name in different content pages. And can set this value inside master page and then make it available to the content pages as a property of the master page.
14. What is the different method of navigation in ASP.NET?
Page navigation means moving from a one page to another page in the web site and another. There are many ways to navigate from a one page to another in ASP.NET.
- Client-side navigation
- Cross-page posting
- Client-side browser redirect
- Client-Side Navigation.
15. What is Client-side navigation?
16.What does Client-side browser redirect?
The Page.Response object contains a Redirect method that can be used in the server-side code to instruct the browser to initiate the request for another Web page. The redirect is not a PostBack. It is similar to user clicking a hyperlink on the Web page.
17. What does Server-side transfer?
The Transfer method transfers an entire context of a Web page over to the another page. The page that receives a transfer generates the response back to user’s browser. In this mechanism the user’s Internet address in his browser does not show result of the transfer. The user’s address bar still reflects name of the originally requested page.
18. What does Orientation property do in a Menu control?
- Orientation property of Menu control sets the display of menu on the Web page to vertical or horizontal.
- Originally the orientation is set to be vertical.
19. Differentiate between client-side and server-side validations in web pages?
- Server-side validations occurs at a server side.
20. Differentiate between authentication and authorization ?
- Authentication is a process of verifying the identity of a user using some credentials like a username and password while authorization determines the parts of the system to which particular identity has access.
Authentication is required before an authorization.
Example : If an employee authenticates himself with his credentials on the system, authorization will determine if has the control over just publishing the content or also editing it.
21. Define Satellite Assemblies ?
Satellite Assemblies are special kinds of assemblies that exist as a DLL and contain a culture specific resources in a binary format. They store compiled localized application resources. They can be created using AL utility and can be deployed even after deployment of application. Satellite Assemblies encapsulate resources into the binary format and thus makes a resources lighter and consume lesser space on disk.
22. How does enable impersonation in web config file?
In order to enable impersonation in webconfig file, take the following steps:
element in web config file.
Set the impersonate attribute to true as below.
- identity impersonate = “true” /
23. What is CAS?
CAS is more important part of .Net security system which verifies if particular piece of code is allowed to be run. It also determines if piece of code have access rights to run a particular resource. .NET security system applies these features using the code groups and permissions. Each assembly of application is the part of code group with the associated permissions.
24. Differentiate between globalization and localization ?
- Globalization is the technique to identify the part of the Web application that is different for a different languages and separate it out from a web application.
- Localization are try to configure the Web application so that it can be supported for the specific language or locale.
25. Differentiate between a page theme and a global theme?
- Page theme applies to the particular web pages of the project. It is stored inside the subfolder of the App_Themes folder.
- Global theme applies to all web applications on a web server. It is stored inside a Themes folder on a Web server.
26. What do Web server controls in ASP.NET?
- These are objects on ASP.NET pages that run when a Web page is requested.
- Some of these Web server controls, like a button and text box, are similar to HTML controls.
- Some controls exhibit a complex behavior like the controls used to connect to the data sources and display data.
- Data Adapter provides a bridge to be connect command objects to the dataset object, It populates a table in the dataset from the data store and also pushes changes in the dataset back into a data store.
- An example of cookie abuse could be the case where a large cookie is stored affecting a network traffic.
28. How does Cookies work? Give an example of their abuse?
- The server directs a browser to put some files in a cookie. All the cookies are then sent for a domain in each request.
- An example of cookie abuse could be the case where a large cookie is stored affecting a network traffic.
29.What are Custom User Controls in ASP.NET?
- These are controls defined by the developers and work similar to the other web server controls.
- They are the mixture of custom behavior and predefined behavior.
30. What is Role-based security?
- Used in the almost all organization, the Role-based security assign a certain privileges to each role.
- Each user is assigned the particular role from the list.
- Privileges as per role restrict the user’s actions on system and ensure that a user is able to do only what is permitted to do on system.
Learn ASP Dot Net Training with Industry Standard Concepts By MNC Experts
- Instructor-led Sessions
- Real-life Case Studies
31. What do HTML server controls in ASP.NET?
- HTML server controls are similar to a standard HTML elements like those used in the HTML pages.
- They expose the properties and events for a programatical use.
- To make these controls programmatically accessible, can specify that the HTML controls act as the server control by adding the runat=”server” attribute.
32. How do you turn off cookies on one page of website?
- This can be done by using a Cookie.Discard property.
- It Gets or sets a discard flag set by the server.
- When set to true, this property instructs a client application not to save the Cookie on hard disk of the user at the end of session.
33. How does one create a permanent cookie?
- Permanent cookies are the stored on hard disk and are available until a specified expiration date is reached.
- To create the cookie that never expires set its Expires property equal to the DateTime.maxValue.
34. Explain Culture and UICulture values?
- Culture value determines a functions like Date and Currency used to be format data and numbers in the Web page.
- UICulture value determines a resources are strings or images loaded in the Web application for a Web page.
35. How do datasets and data readers differ in terms of their definitions, usage, and examples?
Structured collection of organized data
|Component/module for reading data from a source.|
|Usage||Common in machine learning, data analysis, databases||Used in software development for data processing|
|Content||Contains diverse types of data (text, numbers, images, etc.)||Processes data sequentially from a source.|
|Example||Database tables, CSV files, images, etc.||File readers, database query result processors.|
36. Explain ASP.NET Web Forms?
- Web Forms are extremely important part of the ASP.NET.
- They are User Interface (UI) elements which provide a desired look and feel to the web applications.
- Web Forms provide the properties, methods, and events for controls that are placed onto them.
37. What is event bubbling?
- When child control send events to the parent it is termed as an event bubbling.
- Server controls like a Data grid, Data List, and Repeater can have the other child controls inside them.
38.What are the various types of validation controls provided by ASP.NET?
RequiredFieldValidator : It is used when do not want the container to be empty.
RangeValidator : It checks if the value in the validated control is within a specified range or not.
CompareValidator : Checks if value in controls matches are some specific values or not.
RegularExpressionValidator : Checks if value matches a specific regular expression or not.
CustomValidator : Used to define the User Defined validation.
39. What is connection pooling and how to enable and disable connection pooling?
Connection pool is created when open connection first time. When new connection is created with the same connection string as first one, it reuses the same and existing connection object from a pool without creating a new one. If connection string is different then new connection pooling will be created, thus won’t use an existing connection object.
By default, have connection pooling enabled in .Net. To disable the connection pooling, set Pooling = false in a connection string.
40. Explain importance of Finalize method in .NET?
Clean up the activities are entrusted to .NET Garbage collector in .NET. But unmanaged resources are File, COM object etc. are beyond the scope of Garbage collector. For these type of objects, have Finalize method where clean up a code for unmanaged resources can be put.
41.What are different kinds of assemblies?
There can be a two types of assemblies.
Static assemblies : They are stored on a disk in the portable executable files. It includes .NET Framework types like the interfaces and classes, resources for assembly (bitmaps, JPEG files, resource files etc.).
Dynamic assemblies : They are not saved on a disk before execution rather they run directly from a memory. They can be saved to the disk after they have been executed.
42. Differentiate between Structure and Class?
- Structures are the value type while Classes are the reference type.
- Structures can not have a constructor or destructors while Classes can have them.
- Structures do not support the Inheritance while Classes do support Inheritance.
43. Explain ViewState ?
- It is .Net mechanism to store a posted data among post backs.
- It allows state of objects to be stored in the hidden field on the page, saved on a client side and transported back to the server whenever required.
44. What are the various types of Authentication?
Windows authentication : It uses a security features integrated in Windows NT and Windows XP OS to authenticate and authorize the Web application users.
Forms authentication : It allows to create a own list of users and validate their identity when they visit a Web site.
Passport authentication : It usesMicrosoft centralized authentication provider to the identify users. Passport allows the users to use a single identity across multiple Web applications. Passport SDK needs to be installed to use the Passport authentication in Web application.
45. Explain Server-side scripting and Client-side scripting?
- Server side scripting – All script are executed by a server and interpreted as needed
46. Why does object pool required?
To enhance a performance and reduce a load of creating new objects, instead re using existing objects stored in the memory pool. Object Pool is the container of objects that are for use and have already been created. Whenever object creation request occurs, the pool manager serves a request by allocating an object from pool. This minimizes a memory consumption and system’s resources by recycling and re-using objects.
47. Explain serialization and deserialization?
Serialization is the process of converting an object into stream of bytes Deserialization isa process of creating an object from the stream of bytes.
Both these processes are the usually used to the transport objects.
48. What are the various session state management options provided by ASP.NET?
- ASP.NET provides the two session state management options – In-Process and Out-of-Process state management.
- In-Process stores a session in memory on web server.
- Out-of-Process stores data in external data source. This data source may be SQL Server or a State Server service. Out-of-Process state management needs all the objects stored in session to be serializable.
49. Describe how Passport authentication works?
ASP.NET application with the Passport authentication implemented checks user’s machine for a current passport authentication cookie. If it is not available, ASP.NET directs user to a Passport sign-on page. The Passport service authenticates the user, stores an authentication cookie on user’s computer and direct the user to a requested page.
50. Explain the steps to be followed to use Passport authentication?
1. Install Passport SDK.
2. Set the application’s authentication mode to the Passport in Web config.
3. Set authorization to the deny unauthenticated users.
4. Use the PassportAuthentication_OnAuthenticate event to access user’s Passport profile to identify and authorize the user.
5. Implement a sign-out procedure to remove the Passport cookies from the user’s machine.
Best ASP.NET Training Course & Get Noticed By Top Hiring CompaniesWeekday / Weekend BatchesSee Batch Details
51. Explain advantages of Passport authentication?
- User doesn’t have to be remember separate user names and passwords for the various Web sites.
- User can maintain his or her profile information in the single location.
- Passport authentication also avail access to the various Microsoft services, such as Passport Express Purchase.
52.What is caching?
Caching is a technique of storing frequently used items in memory so that they can be accessed more quickly.By caching response, the request is served from a response already stored in memory. It’s important to choose the items to cache wisely as a Caching incurs overhead.A Web form that is frequently used and does not contain a data that frequently changes is good for caching.
53.Explain duration attribute of @OutputCache page directive?
- The @OutputCache directive’s Duration attribute determines how long page is cached.
- If duration attribute is set to 60 seconds, Web form is cached for 60 seconds; the server loads a response in memory and retains that response for 60 seconds.
- Any requests during that time receive a cached response.
- Once cache duration has expired, the next request generates the new response and cached for the another 60 seconds.
54. Explain how web application works?
A web application resides in a server and serves the client’s requests over internet. The client access a web page using the browser from his machine. When a client makes a request, it receives result in the form of HTML which are interpreted and displayed by browser.A web application on server side runs under the management of a Microsoft Internet Information Services (IIS). IIS passes request received from client to the application. The application returns a requested result in the form of HTML to IIS, which in turn, sends a result to the client.
55.Explain the advantages of ASP.NET?
- Web application exists in the compiled form on the server so the execution speed is faster as compared to interpreted scripts.,
- ASP.NET makes a development simpler and easier to maintain with the event-driven, server-side programming model.
- Being part of .Framework, it has access to all features of .Net Framework.
- Content and program logic are the separated which reduces inconveniences of program maintenance.
56. Explain different parts that constitute ASP.NET application?
Content, program logic and configuration file constitute the ASP.NET application.
Content files : Content files include the static text, images and can include an elements from database.
Program logic : Program logic files exist as a DLL file on the server that responds to user actions.
Configuration file : Configuration file offers the various settings that determine how application runs on server.
57. Describe the sequence of action takes place on server when ASP.NET application starts first time?
IIS starts the ASP.NET worker process – worker process loads assembly in memory – IIS sends the request to assembly – the assembly composes the response using program logic – IIS returns a response to the user in the form of HTML.
58. Explain the components of web form in ASP.NET?
Server controls : The server controls are the Hypertext Markup Language (HTML) elements that include the runat=server attribute. They provide an automatic state management and server-side events and respond to user events by executing event handler on server.
HTML controls : These controls also respond to user events but the events processing happen on client machine.
Data controls : Data controls allow to the connect to database, execute command and retrieve a data from database.
System components : System components provide the access to the system-level events that occur on server.
59. Describe in brief .NET Framework and its components?
NET Framework provides the platform for developing windows and web software. ASP.NET is the part of .Net framework and can access all the features implemented within it that was formerly available only through the windows API.
The .Net Framework has 2 main components :
Net Framework Class Library : It provides the common types like data types and object types that can be shared by all .Net compliant language.
The Common language Runtime : It provides the services like type safety, security, code execution, thread management, interoperability services.
60. What is an Assembly? Explain its parts ? Explain its parts?
An assembly exists as .DLL or .EXE that contains MSIL code that is executed by the CLR. An assembly contains the interface and classes, it can also contain the other resources like a bitmaps, files etc. It carries version details which are used by CLR during execution.
The four parts of assembly are :
- Assembly Manifest – It contains a name, version, culture, and information about referenced assemblies.
- Type metadata – It contains an information about types defined in assembly.
- Resources – Files are BMP or JPG file or any other files required by application.
61. Define Common Type System ?
.Net allows the developers to write program logic in at least 25 languages. The classes written in the one language can be used by other languages in .Net.This service of .Net is possible through the CTS which ensure the rules related to data types that all the language must follow.It provides the set of types that are used by all .NET languages and ensures.NET language type compatibility.
62. What is a round trip?
The trip of Web page from the client to the server and then back to client is known as a round trip. In ASP.NET Response.Redirect() causes the round trip. In other words, any web page that travels from client-side to the server-side will get processed on server and travels back to client, this whole process is called round trip.
63. Describe Events in the Life Cycle of a Web Application?
A web application starts when the browser requests a page of the application first time. The request is received by IIS which then starts ASP.NET worker process (aspnet_wp.exe). The worker process then allocates the process space to the assembly and loads it. An application_start event occurs followed by a Session_start. The request is then processed by ASP.NET engine and sends back response in form of HTML. The user receives a response in the form of page.
64. What does ways of preserving data on Web Form in ASP.NET?
ASP.NET has introduced the view state to preserve data between the postback events. View state can’t avail data to the other web form in an application. To provide data to the other forms, need to save data in a state variable in application or session objects.
65. Define application state variable and session state variable?
Application State : Data stored in application object can be shared by all sessions of the application. Application object stores data in key value pair.
Session State : Session State stores the session-specific information and the information is visible within session only. ASP.NET creates a unique sessionId for each session of the application. SessionIDs are maintained either by HTTP cookie or a modified URL, as set in application’s configuration settings. By default, SessionID values are stored in the cookie.
66.Describe application event handlers in ASP.NET ?
Application_Start : This event occurs when a first user visits the page of the application.
Application_End : This occurs at beginning of each request to server.
Application_EndRequest : Occurs at end of each request to server.
Session_Start : This event occurs in every time when any new user visit.
Session_End : Occurs when users stop requesting pages and session times out.
67. What are Web Form Events available in ASP.NET?
68. Describe Server Control Events of ASP.NET?
ASP.NET offers the many server controls like button, textbox, DropDownList etc. Each control can respond to user’s actions using events and event handler mechanism.
There are the three types of server control events:
Postback events : This events sends a web page to the server for processing. Web page sends data back to a same page on the server.
Cached events : These events are processed when the postback event occurs.
Validation events : These events occur just before the page is posted back to server.
69.How does the session time-out value?
The session time-out value is specified in web config file within sessionstate element. And can change the session time-out setting by changing the value of timeout attribute of the sessionstate element in web config file.
70. Describe ASP.NET maintains process isolation for each Web application?
In ASP.NET, when IIS receives the request, IIS uses aspnet_isapi dll to call ASP.NET worker process.The ASP.NET worker process loads the Web application’s assembly, allocating a one process space, called the application domain, for each application.This is how ASP.NET maintains a process isolation for an each Web application.
71. Define namespace ?
Namespaces are way to organize a programming code. It removes chances of name conflict. It is quite possible to have one name for an item accidentally in large projects those results into the conflict. By organizing the code into the namespaces, reduce the chance of these conflicts. can create a namespaces by enclosing a class in the Namespace…End Namespace block.
72. Define steps to set up validation control ?
- Drag the validation control on web form.
- Set ControlToValidate property to control to be validated.
- If using CompareValidator, have to specify a ControlToCompare property.
- Specify the error message want to display using the ErrorMessage property.
- And can use ValidationSummary control to show the errors at one place.
73. What are the navigation ways between the pages available in ASP.NET?
Ways to the navigate between pages are :
- Hyperlink control
- Response.Redirect method
- Server.Transfer method
- Server.Execute method
- Window.Open script method.
74. What does delegate ?
A delegate acts like strongly type function pointer. Delegates can invoke a methods that they reference without making explicit calls to those methods. It is type safe since it holds the reference of only those methods that match its signature. Unlike the other classes, the delegate class has signature. Delegates are used to implement an event programming model in .NET application. Delegates enable methods that listen for event, to be abstract.
75.Explain Exception handling in .Net ?
Exceptions or errors are the unusual occurrences that happen within the logic of an application. The CLR has provided a structured way to deal with exceptions using the Try/Catch block. ASP.NET supports some facilities to handling exceptions using events are suck as Page_Error and Application_Error.
76.What is impersonation ?
Impersonation means delegating a one user identity to the another user. In ASP.NET, the anonymous users can impersonate the ASPNET user account by default. And can use
- identity impersonate=”true”/
77. What is managed code in .Net?
The code that runs under guidance of common language runtime (CLR) is called the managed code. The versioning and registration problem which are formally handled by windows programming are solved in .Net with introduction of managed code. The managed code contains all versioning and type information that CLR use to run application.
78. What does Merge modules?
Merge modules are the deployment projects for a shared components. If the components are already installed, modules merge the changes rather than unnecessarily overwrite them. When components are no longer in use, they are removed safely from a server using Merge modules facility.
79. What does Global.asax file?
The Globalasax file has been derived from a HttpApplication class. The Globalasax file is used to be add application-level logic and processing. It does neither handle any UI-related processing, nor it does support the individual requests. It basically controls following events.
80. Define secured sockets layer?
Secured Socket Layer (SSL) ensures the secured web application by encrypting a data sent over internet. When an application is using the SSL facility, the server generates encryption key for a session and page is encrypted before it sent. The client browse uses this encryption key to decrypt requested Web page.
81. Define Tracing?
Tracing is the way to maintain events in the application. It is useful while the application is debugging or in the testing phase. The trace class in a code is used to diagnose problem. And can use trace messages to project to monitor events in released version of the application. The trace class is found in System.Diagnostics namespace. ASP.NET introduces a tracing that enables to write debug statements in the code, which still remain in code even after when it is deployed to the production servers.
81. What is the application domain?
It is the process space within which ASP.NET application can be runs. Every application has its own process space which isolates it from the other application. If one of the application domains throws error it does not affect other application domains.
83.List down sequence of methods called during the page load?
- Init() – Initializes a page.
- Load() – Loads the page in server memory.
- PreRender() – the brief moment before the page is displayed to user as HTML
- Unload() – runs just after page finishes the loading.
84.What is a Resource File?
ASP.NET provides a resource files to implement globalization and localization. The resource file is XML file having extension resx. Each resource in the resx file is in the form of key-value pair. For each culture that application needs to support create the separate resource file.
85. Define MSIL?
MSIL is a Microsoft Intermediate Language. All .Net languages’ executable exists as the MSIL which gets converted into the machine specific language using JIT compiler just before execution.
86. What is Response.Redirect vs Server.Transfer?
Server.Transfer is only applicable for the aspx files. It transfers page processing to the another page without making round-trip back to client’s browser. Since no round trips, it offers the faster response and doesn’t update client url history list.
Response.Redirect is used to redirect to the another page or site. This performs a trip back to client where the client’s browser is redirected to new page.
87. What does dependency injection?
Dependency injection represents the design pattern that assists to develop loosely coupled code. It is this pattern that is widely used in the ASP.NET. The purpose of using Dependency injection is to provide objects with what they need in particular object’s constructor instead of needing that object to construct them.Dependency injection decreases and usually removes the needless unnecessary dependencies between those objects that don’t require knowing one another. Also, it assists in testing by hitting out dependencies at runtime.
88.Explain login control and form authentication ?
Login controls encapsulate all features offered by the Forms authentication. Login controls internally use the FormsAuthentication class to implement security by prompting for the user credentials validating them.
89. Explain what order a destructors is called?
Destructors are called in the reverse order of constructors. Destructor of the most derived class is called followed by its parent’s destructor and so on till the topmost class in hierarchy.
90. What is break mode? What does options to step through code ?
Break mode lets to observe code line to line in order to be locate error. VS.NET provides the following option to step through code.
- Step Into
- Step Over
- Step Out
- Run To Cursor
- Set Next Statement.
91. Explain how does retrieve property settings from XML .config file?
Create an instance of the AppSettingsReader class, use GetValue method by passing a name of the property and the type expected. Assign a result to the appropriate variable.
92. Explain Global Assembly Cache?
Global Assembly Cache is the place holder for a shared assembly. If an assembly is installed to Global Assembly Cache, the assembly can be accessed by the multiple applications. In order to install assembly to the GAC, the assembly must have to be signed with the strong name.
93. Explain Managed code an Un-managed code?
Managed code runs under a safe supervision of common language runtime. Managed code carries a metadata that is used by the common language runtime to offer service like a memory management, code access security, and cross-language accessibility.
Unmanaged code doesn’t follow the CLR conventions and thus, can’t take advantages of .Framework.
94. Define Resource Files?
Resource files contains a non-executable data like strings, images etc that are used by application and deployed along with it. And can changes these data without recompiling a whole application.
95.What is reflection?
Reflection is the mechanism through which types defined in a metadata of each module can be accessed. The System.Reflection namespaces contains a classes that can be used to define types for an assembly.
96. Explain difference between dataset and datareader?
- Dataset is the disconnected architecture whereas a datareader is connected architecture
- Dataset is best choice when need to access data from more than one table.
- Dataset is handy when need to move back while reading records.
- Compare to datareader, using a dataset has an adverse affect on speed.