I often hear this question: "should I use the DataReader class or the DataSet class in ASP. NET Web applications ?" I often see this misunderstanding in many articles and newsgroups, that is, the DataReader (abbreviation of SqlDataReader or OleDbDataReader) is better than DataSet. Sometimes I see the opposite. In fact, Microsoft has created these two data access classes because they are all what we need. Ea
I. disadvantages of weak DataSet:1. It can only be referenced by column names, dataset. tables [0]. rows [0] ["Age"]. If the column name is incorrectly written and compiled, no error is found. Therefore, you must remember the column name during development.2. int age = Convert. toInt32 (dataset. rows [0] ["Age"]), the value of the obtained field is of the object
Dataset and datatable
Each dataset is a collection of one or more able objects (datatable is equivalent to a table in the database). These objects are composed of datarow, datacolumn, and columnname) item, and the relationship (Relations) related to the data in the datatable object and the data display sorting (dataview) information.
Difference between dataset a
[Size = x-large] using system;
Using system. Collections. Generic;
Using system. text;
Using system. Data;
Using system. Windows. forms;
Using system. reflection;
Namespace DMS{/// /// C # Excel operations/// Class exceloperate{// Method 1 // Public bool datasettoexcel (Dataset dataset, bool isshowexcle)//{// Datatable = dataset. Tables [0];// Int rownumber = d
HTML5 Description of custom attributesThe "28 HTML5 features, tricks and techniques you must know" article in the previous translation of the custom legal attributes in HTML5 data- has been introduced, that is, in HTML5 we can use data- the prefix to set the custom properties we need to do some data storage, For example, we want to store the corresponding ID on a text button:TestThe data- prefix is called data属性 , which can be defined by a script, or the CSS property selector can be applied to s
1. Dataset
ObjectL
And sqldatareader
Object comparisonSqldatareader is a fast and efficient structure for obtaining query results. It only supports Reading query results one way forward and the data is read-only. Dataset allows you to view query results cyclically and cyclically, and supports sorting, searching, and caching and modifying data. L DataSet object me
LINQ to Dataset
In addition. net integration, through ADO. net to obtain data, and then query the data through LINQ, so as to implement complex query of the Data. To be understood as querying the data saved in dataset through LINQ, generally, den provides the following steps:
1.Obtain the dataset or datatable Data Source, LINQ to
I often hear people ask this question: "Should I use a DataReader class or a DataSet class in a ASP.net Web application?" "I often see this misconception in many articles and newsgroup postings that DataReader (SqlDataReader or OleDbDataReader abbreviations) are better than datasets. Sometimes I also see the opposite story. In fact, Microsoft created the two data access classes because they were all we needed. Each class has its advantages and disadva
Simple data binding of a commonly used control for Winform development-code binding of DataSet, able, IList, SqlDataReader, and datagridviewilist
The previous section describes the automatic data binding feature provided by Winform for the DataGridView. The following section describes how to bind data using code.
1. Use DataSet and DataTable to provide data sources for the DataGridView
Code first
Private vo
Simple data binding of the DataGridView for developing common controls in Winform -- code binding DataSet, DataTable, IList, and datagridviewilist
The previous section describes the automatic data binding feature provided by Winform for the DataGridView. The following section describes how to bind data using code.
1. Use DataSet and DataTable to provide data sources for the DataGridView
Code first
Private v
About DataSet transaction processing and SqlDataAdapter usage, sqldataadapter usage
If the SQL statement is executed directly, the transaction is well processed. For most Erp applications, SQL cannot be used to process data. Therefore, it is more common to update DataSet and update a single DataSet, no transaction processing is required. Adding transactions to mu
DataSet contains multiple able and constraints between DataTable.If you do not need to map the relationship between your data, it is more efficient to directly use DataTable. If a relational query such as 1: N or N: M is required, fill in all the corresponding datatables in DataSet, and then use the relational query data.The DataSet data source can be viewed as a
Create a temporary dataset in C # For temporary data storage
Dataset temp_ds = new dataset () outside pageload
# Region temporary storage new dataset
// Dataset temp_ds = new
Dataset and datatable can be used to export data to: http://www.cnblogs.com/pauline/archive/2011/04/11/2012593.html# :paine
Each dataset is a collection of one or more able objects (datatable is equivalent to a table in the database). These objects are composed of datarow, datacolumn, and column name) item, and the relationship (Relations) related to the data in the datatable object and the data display sor
Suppose there is such a method in index. CS,
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->[Ajaxpro. ajaxmethod]
Public dataset getdataset ()
{
Dataset DS = new dataset ();
Sqldataadapter sap = new sqldataadapter ("select * from jobs", DB. getconn ());
Sap. Fill (DS, "Jobs ");
Return Ds;
}
How can we set the va
In my projects, dataset is used a lot, which leads to fast development and low training costs. In addition, dataset itself works well with the development of gridview, and many clever methods use dataset to bind them for better processing. For example, dynamic fields and metadata fields. If the generic type is used, the modification of the object class may occur.
ExampleThe above is a string, how to load it to Dataset---------------------------------------------------------------Dataset. readxml ()Base on. NET 2.0---------------------------------------------------------------Something likeString S = ".........";System. Io. stringreader reader = new system. Io. stringreader (s );Dataset DS = new
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.