Introduction to ADO. NET
About ADO. NET
ADO. NET is a database access method provided by Microsoft. He enables. NET programmers to use the same access method for different databases.
Connection
Connection is a database Connection class. It is responsible for opening and closing the database Connection.
To interact with a database, you must connect to it. It allows subsequent objects to know which data source to execute the command!
Command
Command is a tool used to execute SQL statements. The addition, deletion, modification, and query operations are all executed by Command.
After establishing a database connection, you can use the Command object to execute commands such as adding, deleting, modifying, and querying.
Commonly used methods include ExecuteReader (), ExecuteScalar (), and ExecuteNonQuery ().
DataReader Reader
After an SQL statement is executed, the result set formed by the SQL statement is stored in the memory of the database server.
It can be displayed in the application only after it is retrieved.
DataReader is such a read-only reader.
DataAdapter Adapter
The returned value of DataReader has only one row. When we want to obtain an entire table.
You need to use the DataAdapter to obtain it.
Adatper is an adapter (refer to the adapter mode in design mode). What is its adaptation?
DataAdapter is applicable to the return values of DataTable and DataReader.
DataSet
DataSet is a small local database, which is stored in the memory of the client in the form of several tables.