|
When reading a class of information unconditionally and simply, the stored procedure without parameters can be satisfied. In the application, SqlDataReader can be used in conjunction with it. SqlDataReader can quickly obtain the results of the query and provide a read-only row stream from the database A way. Can also be used with SqlDataAdapter and DataSet.
SqlDataReader dr = myCommand.ExcuteReader (CommandBehavior.CloseConnection);
// Execute the database access command. When the command is executed, if the associated DataReader object is closed, the associated Connection object will also be closed. |
|