VB.NET ADO

xiaoxiao2021-03-06  80

Recently, I have seen some netizens asking about ADO.NET and ADO's differences and bad problems. I think I really have this question when I just get in. Net, I will write my understanding and experience, I hope to be everyone Available! In fact, most things are still from MSDN! ! ADO For applications written in this codes, ADO provides COM-based application level interfaces for OLE DB data providers. Similar to ADO.NET, ADO supports a variety of development needs, including creation of front-end database clients and intermediate business objects using live connections to data in relational databases and other storage regions. Moreover, like ADO.NET, ADO can build client record sets, using loosely coupled record sets, and process OLE DB data shaping rows collection.

ADO also supports some behaviors that are not exposed by ADO.NET, such as rolling server-side cursors. However, because the server-side cursors need to save database resources, they can use them to have great negative impact on the performance and scalability of the application. In order to transfer the ADO record set through the firewall, you need to configure a firewall to enable COM to get requests, and consider the relevant security consequences. COM seal processing also limits data types to those data types defined by COM standards. You can choose to keep the ADO record set in an XML format and transfer XML text. ADO.NET is an important application-level interface for providing data access services in the Microsoft .NET platform. In ADO.NET, you can use the new .NET Framework data provider to access the data source. These data providers include:

SQL Server .NET Framework data provider. OLE DB .NET Framework data provider. ODBC .NET Framework data provider. Oracle .NET Framework data provider. These data providers can meet various development requirements, including intermediate business objects (they use active connections to data in relational databases and other storage regions).

ADO.NET is designed for messaging-based web applications, while also providing better features for other application structures. ADO.NET reduces the number of activities connected to the database by supporting the data of the data (that is, the possibility of reducing the limited resources on the database server), thereby achieving maximum data sharing.

ADO.NET provides several data access methods. In some cases, web applications or XML Web services requires data in multiple sources, or requires interoperability with other applications, including local and remote applications, or can benefit from maintaining and transmitting cache results. The use of the data set will be a wise choice. As an alternative method, ADO.NET provides data commands and data readers to communicate directly with the data source. Database operations directly using data commands and data readers include: Run queries and stored procedures, create database objects, direct update and delete using DDL commands.

ADO.NET also enables maximum data sharing based on XML-based persistence and transmission formats by supporting the Basic Objects of Distributed ADO.NET applications. The data set is a relational data structure that can be read, written, or serialized using XML. The ADO.NET data set makes it easy to generate applications that the application layer and multiple Web sites are unusally exchanged data exchange.

Because the dataset is processed as an XML form, any two components can share data and use an XML architecture to define the relationship structure of the data set. Moreover, because the serialization format of the data set is XML, the DataSet object can easily pass through the firewall without any restrictions. In addition to loading data from XML, the data set can also be filled with data in SQL Server and data in the data source disclosed by OLE DB, and changes to these data can be saved. One main feature of the data set is available in two ways to access and operate the data in the local data set:

As the table in the relational database ---- Data set can contain a collection of tables or tables. An important feature of the data set is that it tracks the relationship between the tables contained, as if it is a relational data store in memory. As an XML (Scalable Markup Language) Structure ---- Data in the data set can also be accessed in the form of XML data. The following methods are provided: read and write data in XML; read and write the structure of the data set in the form of an XML architecture. In addition, XMLDATADOCUMENT is associated with data sets in order to allow synchronous viewing, query, and modifying xml form. Select ADO.NET or ADO

ADO.NET and ADO have the following features: easy to program; unrelated to language; simple implementation process; use minimum network traffic; small number of layers needed between the application front and data sources. Both methods provide high performance data access.

Regardless of which of these two data access technologies, it will affect the design, scaife, interoperability, easy maintenance, and many other aspects. These aspects include:

Managed Code If your application is written with a managed code, ADO.NET should be used based on public language runtime build. If you write a non-hosting code with C (especially when maintaining an existing ADO application), ADO is still a nice choice. Data Structure ADO.NET dataset can include one or more tables and provide a table-based relational view and XML-based views. Data sets use standard public language run library types, which simplifies the programming process. The ADO record set is a single table that can only be accessed in the form of a recordset and does not contain a relationship. The ADO record set can be the result of multi-table JOIN queries, but it is still just a single result table. If Ado wants ADO to have multiple tables, you must have multiple Recordset objects. Due to its relationship between its integration, the ADO.NET dataset provides better features.

Data Sharing ADO.NET provides the basics between components and cross-layer data exchange: Data sets can be delivered on the INTE-RNET in XML and can pass through the firewall. You can view the dataset in your application in the form of a relational table, and view the same data set in the form of an XML data structure in other applications. The data set provides convenient two-way conversion: from the data set table to the XML document, and from the XML document to the data set table. If you use a COM blocking process to transfer the ADO record set, the target application must be written as a recordset data structure. Compared to only XML data, it is more difficult to programming. Alternatively, the ADO recordset can be kept to XML so that data can be more conveniently shared with other applications and services.

Scalability ADO.NET is the strongest solution of scaling. ADO.NET is designed to be a data access structure from the beginning, ie the best data access structure for scalable web applications with lower total ownership costs. If you don't need scalability and you don't have to write, you can continue to use ADO. The cursor position application can create result sets in any of the following two locations: within the application process (client game) or data storage area (server-side game). For any type of user and data, the client game is usually a good choice. The client game is supported by the DataSet object in ADO.NET, while in the ADO is supported by the ClientCursor Recordset object. Order, read-only server cursors are supported by data readers (such as SqlDataReader or OLEDBDataReader objects) in ADO.NET, while in ADOs are supported by only / read-only Recordset objects. Order, read-only cursor provides the fastest way to read data from the database. Scroll, updatable server-side cursors are supported by scrolling, updatable RECORDSET objects in ADO. The server-side game should be used with caution. The non-sequential scrolling and update operations for results through the server-side game will remain locked and resource contention, which will greatly limit the scaling of the application. The application usually benefits without using the process handleable to the results on the server.

Data Access Connection ADO.NET and ADO supports explicit connections to the database. In ADO.NET, developers can use the data reader while maintaining a locked state based on the current position, and requires a continuous connection to the database before reading data. Alternatively, the data can be placed in the data set. When using a dataset, developers can perform the following selections: keep the connection and transaction in the open state when data in the data set; or only open the connection and use the transaction only when you need to fill the data to the dataset and turn the change new to the database. When you are transferring, viewing, and modifying data in the data set, close the connection can release resources and lock for other users. In ADO, the recording set can use the open connection and keep the lock when the user reads the data in the database, or uses the client cursor record set, which can process data without retaining the database connection. Data scrolling ADO.NET and ADO can be browsed in sequential data or sequentially browse data. Using the ADO.NET dataset, you can easily browse from a line in a data table to a related line in another table. ADO records and ado.net data readers support high speed, only servers-side games that are only read-only. The ADO record set is only supportable, can be updatable server-side games, although this cursor uses server resources, and most cases can better implement logic in stored procedures, or to loosen coupled client games Realization. Use the Easy ADO.NET dataset to provide self-description data and eliminate the need for processing underlying data structures (such as columns, columns, constraints, and rows). Instead, using the data set, you can use the object to be accessed securely to the data. This makes the program more readily read, write and modify. Since the application layer can be exchanged with data sets in the XML format, new extended communications can be easily implemented in the life cycle of the application. When using ADO.NET, which language is used to perform data access. It is similar to that they are similar in grammar and use the same public language runtime service. Although ADO.NET and ADO support loosely coupled data access, there are differences in both. With ADO.NET, you can control the way to transfer to the database by modifying the statement used by the DataAdapter object or by inserting a custom code that can be updated responded to the run. Use this feature to optimize performance, modify verification checks, or add additional additional processing, all of which do not have to change your application. For more information, see the problem in the .NET application structure.

转载请注明原文地址:https://www.9cbs.com/read-94731.html

New Post(0)