Tell and talk about connection objects

Source: Internet
Author: User
Tags ole

Can improve performance by maintaining record caching in the dataset locally. For example, you can store 10 of pages of data in a local connection object, query the data source for new data only when the user navigates beyond the first or last page, but still require the ability to write the correct connection string, using the following method:

1, a new file, such as Test.udl double-click Test.udl, opens a Data Link Properties dialog box, which defaults to the Connection property page.

2. Click the tab to go to the Provider property page and select the data you want to connect to by default Microsoft OLE DB Provider for ODBC Drivers

3. If you use a SQL Server server, you can choose Microsoft OLE DB Provider for SQL server to go to the Connection property page, where you can specify a data source name or server name and other connection information.

4, click the "Test Connection" button, you can check the configuration is correct, whether you can connect to the server. (If the server is remote and cannot be connected by name, you can use an IP address in the server name)

5. If the test passes, press OK to close the dialog box. Rename the test.udl to Test.txt, or open the file directly in Notepad.

6. Copy a line of the file representing the connection string and paste it into your program.

Ado. NET enables datasets and DataReader to extract data from a data source. The former is a cached memory, and you can access it from any direction and make changes at will. The latter is a highly optimized object, which moves forward only in a read-only recordset. Note: The DataSet looks like a static cursor, but actually, in. NET, the DataReader object corresponds to the ADO read-only cursor.

In the connection object, although there is no support for server-side cursors, this does not mean that you cannot use cursors. In fact, the steps you need to take are in. NET, you can run the local connection object in your own program simply by right-clicking on References node.

But I personally think that when you want to turn. NET, please consider carefully. First, be sure to completely enter the connection object, which does not take much time and effort, which is to. NET take the first step,. However, this is only the first step of long march and it leads to. NET must be a step. . NET's true added value is based on a uniform, consistently stable interface and the wide application of local classes. About COM libraries can be supported, reasonable, but not encouraged, because it is only a short-term solution, or a transitional step.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

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.