Database application

xiaoxiao2021-03-06  104

Author: Flying

We must learn about DataReader, Dataset, and DataGrid controls. DataGrid is a display control. Everyone has to look at it related applications, we are here, DataReader and DataSet can be used to store data content, but DataReader can only store queries. As a result, Dataset is relatively complicated. His function is very powerful. Let's take a step in step, we only tell the function of the storage database, huh, in order to explain with DataReader. Tell the database, first useful data Only, I am here casually, named Company, add a few data into it.

DataReader

DataReader looks at the name, it is to read the data, we can use the Command's Execute method to save the data into DataReader, DataReader has many methods and properties, often read, here I don't want to talk more. We are still Take a look at its specific application.

<% @ Page language = "c #"%>

<% @ Import namespace = "system.data"%>

<% @ Import namespace = "system.data.sql"%>