Applications in Microsoft Visual Studio access the SQL Server database (written in C)

Source: Internet
Author: User

In C #. net, use ADO. Net to obtain data and use ADO. Net to develop database applications.Program. The ADO. Net Class Library provides classes for data connection and data processing. System. the data namespace can communicate with the database through the data provider, ADO.. Net object allows you to connect to the database through components, search, edit, delete, and insert data in the database, and process data in the program.

Ado. Net has two important components: DataSet object and. NET data provider. A DataSet object is used to place a group of data in a program in the form of a table. It does not care about the data source. The data provider contains many components for the data source. Through these components, the designer can connect the program to the specified data source .. NET data provider mainly includes the connection object, command object, datareader object, and dataadapter object.

To create an ADO. NET database application, follow these steps:

1. Create a connection object to connect to the database. Create a command object and execute SQL commands.

2. Create a dataadapter object to exchange data between the data source and record set, and exchange data between the database and the memory.

3. Create a DataSet object, store the data obtained from the data source in the memory, and perform various operations on the data.

4. Create a Windows form, add necessary controls to it, and set properties of various controls.

5. Write events for main controlsCodeTo implement the functions of the program.

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.