메소드 | 설명 | |
---|---|---|
ExecuteReader ( SqlConnection connection, string commandText, int commandTimeoutInSeconds = 30, IReadOnlyList commandParameters = null, CommandType commandType = CommandType.Text, SqlTransaction transaction = null, CommandBehavior commandBehavior = CommandBehavior.Default, bool prepareCommand = false ) : SqlDataReader |
Executes the commandText against the connection and builds an SqlDataReader. If an expected parameter type does not match an actual parameter value's type, ExecuteReader() does not throw SqlException. Instead, a reader with no rows is returned. Any attempt to Read() will throw an exception. |
|
ExecuteReaderAsync ( SqlConnection connection, string commandText, int commandTimeoutInSeconds = 30, IReadOnlyList commandParameters = null, CommandType commandType = CommandType.Text, SqlTransaction transaction = null, CommandBehavior commandBehavior = CommandBehavior.Default, bool prepareCommand = false ) : Task |
Executes the commandText against the connection and builds an SqlDataReader. If an expected parameter type does not match an actual parameter value's type, ExecuteReader() does not throw SqlException. Instead, a reader with no rows is returned. Any attempt to Read() will throw an exception. |
|
ExecuteReaderAsync ( string connectionString, string commandText, int commandTimeoutInSeconds = 30, IReadOnlyList commandParameters = null, CommandType commandType = CommandType.Text, CommandBehavior commandBehavior = CommandBehavior.CloseConnection, bool prepareCommand = false, SqlInfoMessageEventHandler sqlInfoMessageEventHandler = null ) : Task |
Opens a connection to the database, executes the commandText, and builds an SqlDataReader. If an expected parameter type does not match an actual parameter value's type, ExecuteReader() does not throw SqlException. Instead, a reader with no rows is returned. Any attempt to Read() will throw an exception. |
메소드 | 설명 | |
---|---|---|
ExecuteReader ( string connectionString, string commandText, int commandTimeoutInSeconds = 30, IReadOnlyList commandParameters = null, CommandType commandType = CommandType.Text, CommandBehavior commandBehavior = CommandBehavior.CloseConnection, bool prepareCommand = false, SqlInfoMessageEventHandler sqlInfoMessageEventHandler = null ) : SqlDataReader |
public static ExecuteReader ( SqlConnection connection, string commandText, int commandTimeoutInSeconds = 30, IReadOnlyList commandParameters = null, CommandType commandType = CommandType.Text, SqlTransaction transaction = null, CommandBehavior commandBehavior = CommandBehavior.Default, bool prepareCommand = false ) : SqlDataReader | ||
connection | SqlConnection | An open connection to the database. |
commandText | string | The SQL statement, table name, or stored procedure to execute at the data source. |
commandTimeoutInSeconds | int | OPTIONAL value with the wait time, in seconds, before terminating an attempt to execute the command and generating an error. DEFAULT is 30 seconds. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely). |
commandParameters | IReadOnlyList | OPTIONAL set of parameters to associate with the command. DEFAULT is null (no parameters). |
commandType | CommandType | OPTIONAL value that determines how the command text is to be interpreted. DEFAULT is |
transaction | SqlTransaction | OPTIONAL transaction within which the command will execute. DEFAULT is null (no transaction). |
commandBehavior | CommandBehavior | OPTIONAL value providing a description of the results of the query and its effect on the database. DEFAULT is |
prepareCommand | bool | OPTIONAL value indicating whether to prepared (or compile) the command on the data source. |
리턴 | SqlDataReader |
public static ExecuteReaderAsync ( SqlConnection connection, string commandText, int commandTimeoutInSeconds = 30, IReadOnlyList commandParameters = null, CommandType commandType = CommandType.Text, SqlTransaction transaction = null, CommandBehavior commandBehavior = CommandBehavior.Default, bool prepareCommand = false ) : Task |
||
connection | SqlConnection | An open connection to the database. |
commandText | string | The SQL statement, table name, or stored procedure to execute at the data source. |
commandTimeoutInSeconds | int | OPTIONAL value with the wait time, in seconds, before terminating an attempt to execute the command and generating an error. DEFAULT is 30 seconds. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely). |
commandParameters | IReadOnlyList | OPTIONAL set of parameters to associate with the command. DEFAULT is null (no parameters). |
commandType | CommandType | OPTIONAL value that determines how the command text is to be interpreted. DEFAULT is |
transaction | SqlTransaction | OPTIONAL transaction within which the command will execute. DEFAULT is null (no transaction). |
commandBehavior | CommandBehavior | OPTIONAL value providing a description of the results of the query and its effect on the database. DEFAULT is |
prepareCommand | bool | OPTIONAL value indicating whether to prepared (or compile) the command on the data source. |
리턴 | Task |
public static ExecuteReaderAsync ( string connectionString, string commandText, int commandTimeoutInSeconds = 30, IReadOnlyList commandParameters = null, CommandType commandType = CommandType.Text, CommandBehavior commandBehavior = CommandBehavior.CloseConnection, bool prepareCommand = false, SqlInfoMessageEventHandler sqlInfoMessageEventHandler = null ) : Task |
||
connectionString | string | String used to open a connection to the database. |
commandText | string | The SQL statement, table name, or stored procedure to execute at the data source. |
commandTimeoutInSeconds | int | OPTIONAL value with the wait time, in seconds, before terminating an attempt to execute the command and generating an error. DEFAULT is 30 seconds. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely). |
commandParameters | IReadOnlyList | OPTIONAL set of parameters to associate with the command. DEFAULT is null (no parameters). |
commandType | CommandType | OPTIONAL value that determines how the command text is to be interpreted. DEFAULT is |
commandBehavior | CommandBehavior | OPTIONAL value providing a description of the results of the query and its effect on the database. DEFAULT is |
prepareCommand | bool | OPTIONAL value indicating whether to prepared (or compile) the command on the data source. |
sqlInfoMessageEventHandler | SqlInfoMessageEventHandler | OPTIONAL method that will handle the |
리턴 | Task |