Crystal translation-yesky
Perhaps the most interesting thing about the new controls is the DataGrid. The Datagrid is a multi-column data binding grid, through which you can easily and easily
Place the data in it. It also provides paging, sorting, and other functions you want. Let's look at a Datagrid example.
Note: We will introduce the properties and methods of the Datagrid in another article.
<% @ Page language = "C #" src = "DataGrid. cs" inherits = "Samples. DataGridPage" %>
...
<Asp: DataGrid runat = server id = "titlesGrid">
</Asp: DataGrid>
The above. aspx file is displayed and declared without setting any properties of the DataGrid Control.
DataGrid. cs:
Namespace Samples {
...
Public class DataGridPage: Page {
Protected DataGrid titlesGrid;
Public ICollection GetTitlesList (){
// Retrieve the title list from the DataSet cached in the application state.
DataSet titlesDataSet = (DataSet) Application ["TitlesDataSet"];
If (titlesDataSet! = Null ){
Return titlesDataSet. Tables ["Title"]. DefaultView;
}
Else {
Return null;
}
}
Private void LoadTitlesGrid (){
// Retrieve data from the database
ICollection titlesList = GetTitlesList ();
// Set the Control Data Source
TitlesGrid. DataSource = titlesList;
// Use this data source to build its project
TitlesGrid. DataBind ();
}
Protected override void OnLoad (EventArgs e ){
Base. OnLoad (e );
If (! IsPostBack ){
// Request this page for the first time
LoadTitlesGrid ();
}
}
}
}
The loss of records is very serious for programmers. In the new system, the central object is Dataset. Similar to recordset
A copy of data stored in memory. Dataset is the center of your development, but now, I can only say that it is close to XML, so that the program is simple
The process of integration and unification is relatively simple. You can still use what you used in the past to handle everything... (Except for server-side cursors )...