Метод | Описание | |
---|---|---|
ExecuteDataset ( SqlConnection connection, CommandType commandType, string commandText ) : DataSet |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlConnection. e.g.: DataSet ds = ExecuteDataset(conn, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteDataset ( SqlConnection connection, string spName ) : DataSet |
Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlConnection using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: DataSet ds = ExecuteDataset(conn, "GetOrders", 24, 36); |
|
ExecuteDataset ( |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlTransaction. e.g.: DataSet ds = ExecuteDataset(trans, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteDataset ( |
Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: DataSet ds = ExecuteDataset(trans, "GetOrders", 24, 36); |
|
ExecuteDataset ( string connectionString, CommandType commandType, string commandText ) : DataSet |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the database specified in the connection string. e.g.: DataSet ds = ExecuteDataset(connString, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteDataset ( string connectionString, string spName ) : DataSet |
Execute a SqlCommand (that returns a resultset) against the database specified in the connection string using the provided parameters. e.g.: DataSet ds = ExecuteDataset(connString, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24)); |
|
ExecuteFillDataset ( DataSet dataSet, SqlConnection connection, CommandType commandType, string commandText ) : int |
Execute a SqlCommand (that returns a resultset) against the specified SqlConnection using the provided parameters. e.g.: ExecuteFillDataset(DataSet dataSet, conn, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24)); |
|
ExecuteFillDataset ( DataSet dataSet, |
Execute a SqlCommand (that returns a resultset) against the specified SqlConnection and SqlTransaction using the provided parameters. e.g.: ExecuteFillDataset(DataSet dataSet, conn, trans, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24)); |
|
ExecuteFillDataset ( DataSet dataSet, string connectionString, CommandType commandType, string commandText ) : int |
Execute a SqlCommand (that returns a resultset) against the database specified in the connection string using the provided parameters. e.g.: ExecuteFillDataset(alias, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24)); |
|
ExecuteFillDataset ( DataSet dataSet, string tableName, SqlConnection connection, CommandType commandType, string commandText ) : int |
Execute a SqlCommand (that returns a resultset) against the specified SqlConnection using the provided parameters. e.g.: ExecuteFillDataset(dataSet, tableName, conn, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24)); |
|
ExecuteFillDataset ( DataSet dataSet, string tableName, |
Execute a SqlCommand (that returns a resultset) against the specified SqlConnection and SqlTransaction using the provided parameters. e.g.: ExecuteFillDataset(dataSet, tableName, conn, trans, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24)); |
|
ExecuteFillDataset ( DataSet dataSet, string tableName, string connectionString, CommandType commandType, string commandText ) : int | ||
ExecuteNonQuery ( SqlConnection connection, CommandType commandType, string commandText ) : int |
Execute a SqlCommand (that returns no resultset and takes no parameters) against the provided SqlConnection. e.g.: int result = ExecuteNonQuery(conn, CommandType.StoredProcedure, "PublishOrders"); |
|
ExecuteNonQuery ( SqlConnection connection, |
||
ExecuteNonQuery ( SqlConnection connection, string spName ) : int |
Execute a stored procedure via a SqlCommand (that returns no resultset) against the specified SqlConnection using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int result = ExecuteNonQuery(conn, "PublishOrders", 24, 36); |
|
ExecuteNonQuery ( |
Execute a SqlCommand (that returns no resultset and takes no parameters) against the provided SqlTransaction. e.g.: int result = ExecuteNonQuery(trans, CommandType.StoredProcedure, "PublishOrders"); |
|
ExecuteNonQuery ( |
Execute a stored procedure via a SqlCommand (that returns no resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int result = ExecuteNonQuery(conn, trans, "PublishOrders", 24, 36); |
|
ExecuteNonQuery ( |
Execute a stored procedure via a SqlCommand (that returns no resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int result = ExecuteNonQuery(conn, trans, "PublishOrders", 24, 36); |
|
ExecuteNonQuery ( string connectionString, CommandType commandType, string commandText ) : int |
Execute a SqlCommand (that returns no resultset and takes no parameters) against the database specified in the connection string. e.g.: int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders"); |
|
ExecuteNonQuery ( string connectionString, string spName ) : int |
Execute a SqlCommand (that returns no resultset) against the database specified in the connection string using the provided parameters e.g.: int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24)); |
|
ExecuteReader ( SqlConnection connection, CommandType commandType, string commandText ) : System.Data.SqlClient.SqlDataReader |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlConnection. e.g.: SqlDataReader dr = ExecuteReader(conn, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteReader ( SqlConnection connection, |
||
ExecuteReader ( SqlConnection connection, string spName ) : System.Data.SqlClient.SqlDataReader |
Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlConnection using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: SqlDataReader dr = ExecuteReader(conn, "GetOrders", 24, 36); |
|
ExecuteReader ( |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlTransaction. e.g.: SqlDataReader dr = ExecuteReader(trans, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteReader ( |
Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: SqlDataReader dr = ExecuteReader(trans, "GetOrders", 24, 36); |
|
ExecuteReader ( string connectionString, CommandType commandType, string commandText ) : System.Data.SqlClient.SqlDataReader |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the database specified in the connection string. e.g.: SqlDataReader dr = ExecuteReader(connString, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteReader ( string connectionString, string spName ) : SqlDataReader |
Execute a stored procedure via a SqlCommand (that returns a resultset) against the database specified in the connection string using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: SqlDataReader dr = ExecuteReader(connString, "GetOrders", 24, 36); |
|
ExecuteScalar ( SqlConnection connection, CommandType commandType, string commandText ) : object |
Execute a SqlCommand (that returns a 1x1 resultset and takes no parameters) against the provided SqlConnection. e.g.: int orderCount = (int)ExecuteScalar(conn, CommandType.StoredProcedure, "GetOrderCount"); |
|
ExecuteScalar ( SqlConnection connection, SqlTransaction transaction, CommandType commandType, string commandText ) : object | ||
ExecuteScalar ( SqlConnection connection, string spName ) : object |
Execute a stored procedure via a SqlCommand (that returns a 1x1 resultset) against the specified SqlConnection using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int orderCount = (int)ExecuteScalar(conn, "GetOrderCount", 24, 36); |
|
ExecuteScalar ( SqlTransaction transaction, CommandType commandType, string commandText ) : object |
Execute a SqlCommand (that returns a 1x1 resultset and takes no parameters) against the provided SqlTransaction. e.g.: int orderCount = (int)ExecuteScalar(trans, CommandType.StoredProcedure, "GetOrderCount"); |
|
ExecuteScalar ( SqlTransaction transaction, string spName ) : object |
Execute a stored procedure via a SqlCommand (that returns a 1x1 resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int orderCount = (int)ExecuteScalar(trans, "GetOrderCount", 24, 36); |
|
ExecuteScalar ( SqlTransaction transaction, string connectionString, string spName ) : object |
Execute a stored procedure via a SqlCommand (that returns a 1x1 resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int orderCount = (int)ExecuteScalar(trans, "GetOrderCount", 24, 36); |
|
ExecuteScalar ( string connectionString, CommandType commandType, string commandText ) : object |
Execute a SqlCommand (that returns a 1x1 resultset and takes no parameters) against the database specified in the connection string. e.g.: int orderCount = (int)ExecuteScalar(connString, CommandType.StoredProcedure, "GetOrderCount"); |
|
ExecuteScalar ( string connectionString, string spName ) : object |
Execute a stored procedure via a SqlCommand (that returns a 1x1 resultset) against the database specified in the connection string using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int orderCount = (int)ExecuteScalar(connString, "GetOrderCount", 24, 36); |
|
ExecuteXmlReader ( SqlConnection connection, CommandType commandType, string commandText ) : XmlReader |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlConnection. e.g.: XmlReader r = ExecuteXmlReader(conn, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteXmlReader ( SqlConnection connection, string spName ) : XmlReader |
Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlConnection using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: XmlReader r = ExecuteXmlReader(conn, "GetOrders", 24, 36); |
|
ExecuteXmlReader ( SqlTransaction transaction, CommandType commandType, string commandText ) : XmlReader |
Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlTransaction. e.g.: XmlReader r = ExecuteXmlReader(trans, CommandType.StoredProcedure, "GetOrders"); |
|
ExecuteXmlReader ( SqlTransaction transaction, string spName ) : XmlReader |
Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlTransaction using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order. This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: XmlReader r = ExecuteXmlReader(trans, "GetOrders", 24, 36); |
Метод | Описание | |
---|---|---|
AssignParameterValues ( |
This method assigns an array of values to an array of SqlParameters.
|
|
AttachParameters ( SqlCommand command, |
This method is used to attach array of SqlParameters to a SqlCommand. This method will assign a value of DbNull to any parameter with a direction of InputOutput and a value of null. This behavior will prevent default values from being used, but this will be the less common case than an intended pure output parameter (derived as InputOutput) where the user provided no input value.
|
|
ExecuteReader ( SqlConnection connection, |
Create and prepare a SqlCommand, and call ExecuteReader with the appropriate CommandBehavior. If we created and opened the connection, we want the connection to be closed when the DataReader is closed. If the caller provided the connection, we want to leave it to them to manage. |
|
PrepareCommand ( SqlCommand command, SqlConnection connection, SqlTransaction transaction, CommandType commandType, string commandText, SqlParameter commandParameters ) : void |
This method opens (if necessary) and assigns a connection, transaction, command type and parameters to the provided command.
|
|
SqlHelper ( ) : System |
public static ExecuteDataset ( SqlConnection connection, CommandType commandType, string commandText ) : DataSet | ||
connection | SqlConnection | a valid SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | DataSet |
public static ExecuteDataset ( SqlConnection connection, string spName ) : DataSet | ||
connection | SqlConnection | a valid SqlConnection |
spName | string | the name of the stored procedure |
Результат | DataSet |
public static ExecuteDataset ( |
||
transaction | a valid SqlTransaction | |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | DataSet |
public static ExecuteDataset ( |
||
transaction | a valid SqlTransaction | |
spName | string | the name of the stored procedure |
Результат | DataSet |
public static ExecuteDataset ( string connectionString, CommandType commandType, string commandText ) : DataSet | ||
connectionString | string | a valid connection string for a SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | DataSet |
public static ExecuteDataset ( string connectionString, string spName ) : DataSet | ||
connectionString | string | A valid connection string for a SqlConnection |
spName | string | The stored procedure name |
Результат | DataSet |
public static ExecuteFillDataset ( DataSet dataSet, SqlConnection connection, CommandType commandType, string commandText ) : int | ||
dataSet | DataSet | a valid dataSet to fill in |
connection | SqlConnection | a valid SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteFillDataset ( DataSet dataSet, |
||
dataSet | DataSet | a valid dataSet to fill in |
transaction | a valid SqlTransaction associated with the connection | |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteFillDataset ( DataSet dataSet, string connectionString, CommandType commandType, string commandText ) : int | ||
dataSet | DataSet | a valid dataSet to fill in |
connectionString | string | connection string |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteFillDataset ( DataSet dataSet, string tableName, SqlConnection connection, CommandType commandType, string commandText ) : int | ||
dataSet | DataSet | a valid dataSet to fill in |
tableName | string | a table name to fill in |
connection | SqlConnection | a valid SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteFillDataset ( DataSet dataSet, string tableName, |
||
dataSet | DataSet | a valid dataSet to fill in |
tableName | string | a table name to fill in |
transaction | a valid SqlTransaction associated with the connection | |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteFillDataset ( DataSet dataSet, string tableName, string connectionString, CommandType commandType, string commandText ) : int | ||
dataSet | DataSet | |
tableName | string | |
connectionString | string | |
commandType | CommandType | |
commandText | string | |
Результат | int |
public static ExecuteNonQuery ( SqlConnection connection, CommandType commandType, string commandText ) : int | ||
connection | SqlConnection | a valid SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteNonQuery ( SqlConnection connection, |
||
connection | SqlConnection | |
transaction | ||
commandType | CommandType | |
commandText | string | |
Результат | int |
public static ExecuteNonQuery ( SqlConnection connection, string spName ) : int | ||
connection | SqlConnection | a valid SqlConnection |
spName | string | the name of the stored procedure |
Результат | int |
public static ExecuteNonQuery ( |
||
transaction | a valid SqlTransaction | |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteNonQuery ( |
||
transaction | a valid SqlTransaction | |
spName | string | the name of the stored procedure |
Результат | int |
public static ExecuteNonQuery ( |
||
transaction | a valid SqlTransaction | |
connectionString | string | |
spName | string | the name of the stored procedure |
Результат | int |
public static ExecuteNonQuery ( string connectionString, CommandType commandType, string commandText ) : int | ||
connectionString | string | a valid connection string for a SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | int |
public static ExecuteNonQuery ( string connectionString, string spName ) : int | ||
connectionString | string | A valid connection string for a SqlConnection |
spName | string | The stored procedure name |
Результат | int |
public static ExecuteReader ( SqlConnection connection, CommandType commandType, string commandText ) : System.Data.SqlClient.SqlDataReader | ||
connection | SqlConnection | a valid SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | System.Data.SqlClient.SqlDataReader |
public static ExecuteReader ( SqlConnection connection, |
||
connection | SqlConnection | |
transaction | ||
commandType | CommandType | |
commandText | string | |
Результат | System.Data.SqlClient.SqlDataReader |
public static ExecuteReader ( SqlConnection connection, string spName ) : System.Data.SqlClient.SqlDataReader | ||
connection | SqlConnection | a valid SqlConnection |
spName | string | the name of the stored procedure |
Результат | System.Data.SqlClient.SqlDataReader |
public static ExecuteReader ( |
||
transaction | a valid SqlTransaction | |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | System.Data.SqlClient.SqlDataReader |
public static ExecuteReader ( |
||
transaction | a valid SqlTransaction | |
spName | string | the name of the stored procedure |
Результат | System.Data.SqlClient.SqlDataReader |
public static ExecuteReader ( string connectionString, CommandType commandType, string commandText ) : System.Data.SqlClient.SqlDataReader | ||
connectionString | string | a valid connection string for a SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | System.Data.SqlClient.SqlDataReader |
public static ExecuteReader ( string connectionString, string spName ) : SqlDataReader | ||
connectionString | string | a valid connection string for a SqlConnection |
spName | string | the name of the stored procedure |
Результат | SqlDataReader |
public static ExecuteScalar ( SqlConnection connection, CommandType commandType, string commandText ) : object | ||
connection | SqlConnection | a valid SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | object |
public static ExecuteScalar ( SqlConnection connection, SqlTransaction transaction, CommandType commandType, string commandText ) : object | ||
connection | SqlConnection | |
transaction | SqlTransaction | |
commandType | CommandType | |
commandText | string | |
Результат | object |
public static ExecuteScalar ( SqlConnection connection, string spName ) : object | ||
connection | SqlConnection | a valid SqlConnection |
spName | string | the name of the stored procedure |
Результат | object |
public static ExecuteScalar ( SqlTransaction transaction, CommandType commandType, string commandText ) : object | ||
transaction | SqlTransaction | a valid SqlTransaction |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | object |
public static ExecuteScalar ( SqlTransaction transaction, string spName ) : object | ||
transaction | SqlTransaction | a valid SqlTransaction |
spName | string | the name of the stored procedure |
Результат | object |
public static ExecuteScalar ( SqlTransaction transaction, string connectionString, string spName ) : object | ||
transaction | SqlTransaction | a valid SqlTransaction |
connectionString | string | |
spName | string | the name of the stored procedure |
Результат | object |
public static ExecuteScalar ( string connectionString, CommandType commandType, string commandText ) : object | ||
connectionString | string | a valid connection string for a SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command |
Результат | object |
public static ExecuteScalar ( string connectionString, string spName ) : object | ||
connectionString | string | a valid connection string for a SqlConnection |
spName | string | the name of the stored procedure |
Результат | object |
public static ExecuteXmlReader ( SqlConnection connection, CommandType commandType, string commandText ) : XmlReader | ||
connection | SqlConnection | a valid SqlConnection |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command using "FOR XML AUTO" |
Результат | XmlReader |
public static ExecuteXmlReader ( SqlConnection connection, string spName ) : XmlReader | ||
connection | SqlConnection | a valid SqlConnection |
spName | string | the name of the stored procedure using "FOR XML AUTO" |
Результат | XmlReader |
public static ExecuteXmlReader ( SqlTransaction transaction, CommandType commandType, string commandText ) : XmlReader | ||
transaction | SqlTransaction | a valid SqlTransaction |
commandType | CommandType | the CommandType (stored procedure, text, etc.) |
commandText | string | the stored procedure name or T-SQL command using "FOR XML AUTO" |
Результат | XmlReader |
public static ExecuteXmlReader ( SqlTransaction transaction, string spName ) : XmlReader | ||
transaction | SqlTransaction | a valid SqlTransaction |
spName | string | the name of the stored procedure |
Результат | XmlReader |