This article mainly introduces the use of Datatable,dataset, attribute summary type, so only throw emphasis. About Datatable,dataset Here is a brief description: The DataSet is a dataset, it can contain a DataTable, and the relationships between the data tables, the DataTable is a datasheet, a column of columns, rows, and so on. DataView is a view used to create different views of the data stored in a DataTable, typically for data binding, as follows:
DataView DV = ds. tables["table name"]. DefaultView;
DATAGRID1.DATASOURCE=DV;
The popular point is: DataSet: Datasets. Can contain multiple DataTable, such as dataset["table name" to get datatable;datatable: Data table. Usage Example One:
SqlDataAdapter Da=new SqlDataAdapter (CMD);
DataTable dt=new DataTable ();
Da. Fill (DT);
Put the data results directly into the DataTable. Usage Example two:
SqlDataAdapter Da=new SqlDataAdapter (CMD);
DataSet dt=new DataSet ();
Da. Fill (DT);
The data results are placed in the dataset, and to use that DataTable, you can do this: dataset[0], the following usage is also quite common:
SqlDataAdapter Da=new SqlDataAdapter (CMD);
DataSet Dt=new DataSet ();d A. Fill (DT, "table1");//Use the time: So take datatable:dataset["Table1"]
There is also the use of online collection: