0% found this document useful (0 votes)
26 views1 page

Questions IMP

Ado.net questions IMP

Uploaded by

Mohammad basha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Questions IMP

Ado.net questions IMP

Uploaded by

Mohammad basha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. What is ADO.NET and why is it used?

ADO.NET is like a bridge that connects applications to databases. It helps retrieve


and manipulate data from databases in a .NET environment.

2. Explain the difference between Dataset and DataReader in ADO.NET.

A DataSet is like a virtual table that holds data retrieved from a database. It can
work offline and store multiple tables. A DataReader is like a read-only cursor
that fetches data one row at a time from a database, and is efficient for large
datasets.

3. What is the purpose of Connection Pooling in ADO.NET?

Connection Pooling is like a reuse strategy for database connections. Instead of


opening a new connection every time, it helps re-use existing ones, which improves
performance and reduces the overhead of opening/closing connections.

4. What is Data Adapter in ADO.NET?

A DataAdapter is like a bridge between a DataSet and a database. It fills a DataSet


with data from a database, and can also update the database with changes made in
the DataSet.

5. Explain the role of SqlCommand and SqlParameter in ADO.NET.

SqlCommand is like an instruction to the database. It specifies what operation


(like SELECT, INSERT, UPDATE, DELETE) to perform. SqlParameter is like a parameter
placeholder in a SQL query. It helps prevent SQL injection and ensures safe data
handling.

6. What are DataSets and DataTables in ADO.NET?

A DataSet is like a container that holds multiple tables. A DataTable is like a


table within a DataSet. They help organize and work with data retrieved from a
database.

7. Explain the difference between ExecuteNonQuery(), ExecuteScalar(), and


ExecuteReader() methods in ADO.NET.

ExecuteNonQuery() is like a command to execute SQL queries that don't return data
(like INSERT, UPDATE, DELETE). ExecuteScalar() is like a command that returns a
single value (like the result of an aggregate function). ExecuteReader() is like a
command for fetching a set of records.

8. What is Data Binding in ADO.NET?

Data binding is like linking a UI control (like a textbox) directly to a data


source. This means that changes in the UI are automatically reflected in the data
source, and vice versa.

9. What is the purpose of Data Access Layer (DAL) in ADO.NET applications?

The Data Access Layer is like a barrier between the application and the database.
It encapsulates the logic for interacting with the database, making it easier to
manage and maintain database operations.

You might also like