[Link] and ASP.
NET Interview Questions and Answers
[Link] Interview Questions:
1. What is [Link] and how does it work?
[Link] is a part of the .NET framework used for data access. It allows applications to connect to
databases, execute commands, and retrieve data. It supports both connected (DataReader) and
disconnected (DataSet) architectures.
2. What are the main components of [Link]?
The main components are:
- Connection: Establishes a connection to the database.
- Command: Executes SQL queries.
- DataReader: Retrieves data in a forward-only, read-only manner.
- DataSet: Stores data in memory.
- DataAdapter: Bridges DataSet and the database.
3. What is the difference between connected and disconnected architecture in [Link]?
Connected Architecture uses DataReader for fast, live database connections. Disconnected
Architecture uses DataSet, which loads data once and works offline, allowing data manipulation
without a constant connection.
4. What are the key classes used in [Link] for connecting to a database?
Key classes include:
- SqlConnection: Manages the database connection.
- SqlCommand: Executes SQL commands.
- SqlDataAdapter: Fills DataSet and updates the database.
- DataSet: Stores data in a disconnected mode.
[Link] Interview Questions:
1. What is [Link]?
[Link] is a web framework by Microsoft used to build dynamic websites, web applications, and
web services. It supports Web Forms, MVC, Web API, and Blazor for creating various types of
applications.
2. What is the difference between [Link] Web Forms and [Link] MVC?
- Web Forms: Event-driven, uses ViewState for state management, drag-and-drop interface, tightly
coupled with UI.
- MVC (Model-View-Controller): Separates UI, business logic, and data, offers better control over
HTML, and supports test-driven development.
3. What are the different types of applications that can be created using [Link]?
[Link] can be used to create:
- Web Applications: Dynamic websites using Web Forms or MVC.
- Web APIs: For RESTful services.
- Single-Page Applications (SPAs): Using Blazor or integrating with frameworks like Angular.
- Enterprise Applications: Complex systems with authentication, authorization, and data
management.
4. Explain the page lifecycle in [Link].
The page lifecycle includes:
- Page Request: Checks cache or processes the page.
- Start: Initializes properties like IsPostBack.
- Initialization: Initializes controls.
- Load: Loads control data.
- Postback Event Handling: Executes event handlers.
- Rendering: Converts page to HTML.
- Unload: Cleans up resources.