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