Database access Technology ADO
The data in the database is extracted into memory and presented to the user to see
It is also possible to write in-memory data to the database
is not the only database access technology, but it is the lowest level of database access technology
1. Create a database and set the primary foreign key relationship
2. Create a new C # project, create a database connection class and a database operation method
A. Reference database using System.Data.SqlClient; B. Creating a database connection class: First write the connection string, and in the instantiation of the connection class
C. Creating a Database action method (not an instantiated class here) d. Open database → perform action → close database
=====================================================================================================
(1) Delete information from the database
=====================================================================================================
(2) Adding information from a database
====================================================================================================
(3) Modify the information in the database
=====================================================================================================
(4) Query the information in the database, Br. Read () returns the type of object
① This method disadvantage: Br[n] do not know which data, need to modify the time required to index, so you can use the br["column name"], at this time, the modification does not need a number of indexes, you can clearly see which column
② This query out of the information, the male and female display is True or False, how can the normal display of male or female?
Because Br. Read () Returns the object type, and True or FALSE is a bool type, so a conversion is required
③ How to show birthday only date?
④ How to display nationalities and classes as corresponding Chinese characters
c#-Database access Technology ado.net--CREATE database connection class and database operation method and simple data add, delete, modify, view