In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to use ADO.NET structure DataSet". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The ADO.NET structure is basically divided into two parts: DataSet and Managed Provider. The following is a brief overview of DataSet, its common approach. DataSet is an in-memory database that provides a consistent programming model, regardless of where it comes from. DataSet consists of a set of tables, columns, rows, constraints, and relationships. The object model for DataSet is as follows:
A data sheet (DataTable) refers to a memory data table. It contains a collection of columns (ColumnsCollection) that represent the schema of the table. A data table also contains a collection of columns (RowsCollection) that represents the data owned by the table. It remembers the original state as well as the current state and tracks the changes that have taken place.
To use a data table, the user must include a System.Data.
ADO.NET structure creates a data table
DataTable has two constructors:
Public DataTable () public DataTable (string tableName)
Add columns to the datasheet
DataTable contains a collection of DataColumn objects. This collection of columns defines the structure of the table. To add a new column to the collection, you can use the collection's Add method. In the following example, we use the Add method of the ColumnsCollection class to add three columns to a data table; this method specifies the ColumnName and DataType properties.
1 DataColumn dc = null; 2 DataTable dt = new DataTable ("test"); 3 dc = dt.Columns.Add ("CustID", System.Type.GetType ("System.Int32")); 4 dc = dt.Columns.Add ("CustomerNameLast", System.Type.GetType ("System.String")); 5 dc = dt.Columns.Add ("CustomerNameFirst", System.Type.GetType ("System.String")) 6 dc = dt.Columns.Add ("Purchases", System.Type.GetType ("System.Double")); the Add method of ColumnsCollection on DataTable has two overloaded (overload) functions: Public DataColumn Add (String columnname, Type type) Public DataColumn Add (String columnname) "how to use ADO.NET structure DataSet". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.