C# 클래스 OBeautifulCode.Database.Recipes.DatabaseHelper

파일 보기 프로젝트 열기: NaosProject/Naos.SqlServer

공개 메소드들

메소드 설명
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

메소드 상세

ExecuteReader() 공개 정적인 메소드

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.
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 ; a SQL text command.
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 ; the query may return multiple result sets and execution of the query may affect the database state. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
prepareCommand bool OPTIONAL value indicating whether to prepared (or compile) the command on the data source.
리턴 SqlDataReader

ExecuteReaderAsync() 공개 정적인 메소드

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.
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 ; a SQL text command.
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 ; the query may return multiple result sets and execution of the query may affect the database state. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
prepareCommand bool OPTIONAL value indicating whether to prepared (or compile) the command on the data source.
리턴 Task

ExecuteReaderAsync() 공개 정적인 메소드

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.
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 ; a SQL text command.
commandBehavior CommandBehavior OPTIONAL value providing a description of the results of the query and its effect on the database. DEFAULT is ; the query may return multiple result sets and execution of the query may affect the database state. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
prepareCommand bool OPTIONAL value indicating whether to prepared (or compile) the command on the data source.
sqlInfoMessageEventHandler SqlInfoMessageEventHandler OPTIONAL method that will handle the event.
리턴 Task