TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十八(转)
/// <summary> /// Deep copy of cached SqlParameter array /// </summary> /// <param name="originalParameters"></param> /// <returns></returns> private static SqlParameter[] CloneParameters(SqlParameter[] originalParameters) { SqlParameter[] clonedParameters = new SqlParameter[originalParameters.Length]; for (int i = 0, j = originalParameters.Length; i < j; i++) { clonedParameters[i] = (SqlParameter)((ICloneable)originalParameters[i])
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十七(转)
/// <summary> /// SqlHelperParameterCache provides functions to leverage a static cache of procedure parameters, and the /// ability to discover parameters for stored procedures at run-time. /// </summary> public sealed class SqlHelperParameterCache { #region private methods, variables, and constructors //Since this class provides only static methods, make the default constructor private to prevent //instances from being created with "new SqlHelperParameterCache()" pri
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十六(转)
#region ExecuteXmlReaderTypedParams /// <summary> /// Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlConnection /// using the dataRow column values as the stored procedure's parameters 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. /// </summary> /// <param name="con
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十五(转)
#region ExecuteScalarTypedParams /// <summary> /// Execute a stored procedure via a SqlCommand (that returns a 1x1 resultset) against the database specified in /// the connection string using the dataRow column values as the stored procedure's parameters 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. /// </summary> /// <
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十四(转)
#region ExecuteReaderTypedParams /// <summary> /// Execute a stored procedure via a SqlCommand (that returns a resultset) against the database specified in /// the connection string using the dataRow column values as the stored procedure's parameters 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. /// </summary> /// <par
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十三(转)
/// <summary> /// Execute a stored procedure via a SqlCommand (that returns a resultset) against the specified SqlConnection /// using the dataRow column values as the store procedure's parameters 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 row values. /// </summary> /// <param name="connection">A valid SqlConnection obje
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十二(转)
/// <summary> /// Execute a stored procedure via a SqlCommand (that returns no resultset) against the specified /// SqlTransaction using the dataRow column values as the stored procedure's parameters 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 row values. /// </summary> /// <param name="transaction">A valid SqlTransaction
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十一(转)
return cmd; } #endregion #region ExecuteNonQueryTypedParams /// <summary> /// Execute a stored procedure via a SqlCommand (that returns no resultset) against the database specified in /// the connection string using the dataRow column values as the stored procedure's parameters 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 row values. /// <
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之二十(转)
#region CreateCommand /// <summary> /// Simplify the creation of a Sql command object by allowing /// a stored procedure and optional parameters to be provided /// </summary> /// <remarks> /// e.g.: /// SqlCommand command = CreateCommand(conn, "AddCustomer", "CustomerID", "CustomerName"); /// </remarks> /// <param name="connection">A valid SqlConnection object</param> /// <param name="spName">
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十九(转)
/// <summary> /// Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlConnection. /// </summary> /// <remarks> /// e.g.: /// FillDataset(conn, CommandType.StoredProcedure, "GetOrders", ds, new string[] {"orders"}); /// </remarks> /// <param name="connection">A valid SqlConnection</param> /// <param name="commandType">The CommandType (stored procedure, text, et
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十七(转)
/// <summary> /// 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. /// </summary> /// <remarks> /// This method provides no access to output parameters or the stored procedure's retur
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十八(转)
/// <summary> /// Execute a SqlCommand (that returns a resultset) against the database specified in the connection string /// using the provided parameters. /// </summary> /// <remarks> /// e.g.: /// FillDataset(connString, CommandType.StoredProcedure, "GetOrders", ds, new string[] {"orders"}, new SqlParameter("@prodid", 24)); /// </remarks> /// <param name="connectionString">A valid connection string for a SqlConn
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十六(转)
/// <summary> /// 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. /// </summary> /// <remarks> /// This method provides no access to output parameters or the stored procedure's return
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十五(转)
#region ExecuteXmlReader /// <summary> /// Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlConnection. /// </summary> /// <remarks> /// e.g.: /// XmlReader r = ExecuteXmlReader(conn, CommandType.StoredProcedure, "GetOrders"); /// </remarks> /// <param name="connection">A valid SqlConnection</param> /// <param name="commandType">The CommandType (stored procedure, te
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十三(转)
/// <summary> /// 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. /// </summary> /// <remarks> /// This method provides no access to output parameters or the stored procedure's re
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十四(转)
/// <summary> /// Execute a SqlCommand (that returns a 1x1 resultset) against the specified SqlTransaction /// using the provided parameters. /// </summary> /// <remarks> /// e.g.: /// int orderCount = (int)ExecuteScalar(trans, CommandType.StoredProcedure, "GetOrderCount", new SqlParameter("@prodid", 24)); /// </remarks> /// <param name="transaction">A valid SqlTransaction</param> /// <param name="commandType&q
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十二(转)
// Call the overload that takes an array of SqlParameters return ExecuteScalar(connectionString, CommandType.StoredProcedure, spName, commandParameters); } else { // Otherwise we can just call the SP without params return ExecuteScalar(connectionString, CommandType.StoredProcedure, spName); } } /// <summary> /// Execute a SqlCommand (that returns a 1x1 resultset and takes no parameters) against the provided SqlConnection. /// </summary> /// <remarks> /
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十一(转)
/// <summary> /// Execute a SqlCommand (that returns a resultset) against the specified SqlTransaction /// using the provided parameters. /// </summary> /// <remarks> /// e.g.: /// SqlDataReader dr = ExecuteReader(trans, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24)); /// </remarks> /// <param name="transaction">A valid SqlTransaction</param> /// <param name="commandType">Th
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之十(转)
/// <summary> /// Execute a SqlCommand (that returns a resultset and takes no parameters) against the provided SqlConnection. /// </summary> /// <remarks> /// e.g.: /// SqlDataReader dr = ExecuteReader(conn, CommandType.StoredProcedure, "GetOrders"); /// </remarks> /// <param name="connection">A valid SqlConnection</param> /// <param name="commandType">The CommandType (stored procedure, text, etc.)</param>
TREEVIEW只输入表名,父ID,节点ID,节点名就得到树型结构之八(转)
/// <summary> /// This enum is used to indicate whether the connection was provided by the caller, or created by SqlHelper, so that /// we can set the appropriate CommandBehavior when calling ExecuteReader() /// </summary> private enum SqlConnectionOwnership { /// <summary>Connection is owned and managed by SqlHelper</summary> Internal, /// <summary>Connection is owned and managed by the caller</summary> External } /// <summary> /// Cre