0.2 Common ADO.net Objects Flashcards

1
Q

What are the common objects used in ADO.net?

A
  1. SqlConnection object
  2. SqlCommand object
  3. SqlDataReader object
  4. DataSet object
  5. SqlDataAdapter object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the role of the SqlConnection object?

A

Identifies information like the database server name, database name, user name and password, and any other parameters required to connect to the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the role of the SqlCommand Object? *

A

It is used to send SQL commands to the data source, and uses the SqlConnection object to know which database to send the commands to, to gether with a database query to know what command to send to the data source.

string cmd = “Select * from users” ;
SqlCommand = new SqlCommand(cmd, conn) .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the role of the SqlDataReader Object?

A

It is used to read data as a result of SQL SELECT commands in a read-only, forward-only manner, which means the data is read in order to maximize the speed of reading the data, but it is not suitable for data manipulation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the role of the DataSet Object?

A

They are in-memory representations of data that contain DataTable objects with rows and columns, which represent database tables. It supports relationships between tables, constraints, and can be used to work with data offline, making it suitable for disconnected scenarios.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why does the DataSet Object not have a prefix?

A

Because it can be used by any data provider.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the role of the SqlDataAdapter Object?

A

It is used to read data and make changes to the data source, and contains objects for SELECT, INSERT, UPDATE, and DELETE commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly