A few simple objects for database interaction

Source: Internet
Author: User



I've written a couple of objects about. NET to SQL Server programming in the past, and found that the understanding is not very profound, here is a summary today.


Why do you summarize it?

Because imagine whether to do web development or desktop applications, are inseparable from dealing with the database (increase, delete, change, check). Nothing but these operations, the change is just the previous page, background and database interaction is always the same.

Either b/s or the so-called C/s background is one thing, so as long as the background database interactive part set up, the project completed the more than half.



Common objects

SqlConnection: represents an open connection to a SQL Server database. This class cannot be inherited.

ConnectionState: describes the current state of the connection to the data source.

SqlCommand: represents a Transact-SQL statement or stored procedure to be executed against a SQL Server database. This class cannot be inherited.

SqlParameter: represents the SqlCommand parameter.

SqlDataReader: Provides a way to read rows from a database in a forward-only flow.

DataSet: represents a data cache that is stored in memory.

SqlDataAdapter: represents A set of data commands and a database connection for populating a dataset and updating a SQL Server database.



So many objects, how to understand it? Take a look at the picture below.


We have divided the above part into two parts to understand, it is easy to understand.




A few simple objects for database interaction

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.