当前位置: 首页>>代码示例>>C#>>正文


C# OracleCommand.PopulateParameters方法代码示例

本文整理汇总了C#中System.Data.OracleClient.OracleCommand.PopulateParameters方法的典型用法代码示例。如果您正苦于以下问题:C# OracleCommand.PopulateParameters方法的具体用法?C# OracleCommand.PopulateParameters怎么用?C# OracleCommand.PopulateParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.OracleClient.OracleCommand的用法示例。


在下文中一共展示了OracleCommand.PopulateParameters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteScalar

 /// <summary>
 /// Executes the SQL statement using <see cref="OracleConnection"/>, and returns the value in the first column 
 /// of the first row in the resultset.
 /// </summary>
 /// <param name="sql">The SQL statement to be executed.</param>
 /// <param name="connection">The <see cref="OracleConnection"/> to use for executing the SQL statement.</param>
 /// <param name="parameters">The parameters to be passed to the SQL stored procedure being executed.</param>
 /// <returns>Value in the first column of the first row in the resultset.</returns>
 public static object ExecuteScalar(this OracleConnection connection, string sql, params object[] parameters)
 {
     OracleCommand command = new OracleCommand(sql, connection);
     command.PopulateParameters(parameters);
     return command.ExecuteScalar();
 }
开发者ID:avs009,项目名称:gsf,代码行数:14,代码来源:DataExtensions.cs

示例2: RetrieveDataSet

        /// <summary>
        /// Executes the SQL statement using <see cref="OracleConnection"/>, and returns the <see cref="DataSet"/> that 
        /// may contain multiple tables, depending on the SQL statement.
        /// </summary>
        /// <param name="sql">The SQL statement to be executed.</param>
        /// <param name="connection">The <see cref="OracleConnection"/> to use for executing the SQL statement.</param>
        /// <param name="startRow">The zero-based record number to start with.</param>
        /// <param name="maxRows">The maximum number of records to retrieve.</param>
        /// <param name="parameters">The parameters to be passed to the SQL stored procedure being executed.</param>
        /// <returns>A <see cref="DataSet"/> object.</returns>
        public static DataSet RetrieveDataSet(this OracleConnection connection, string sql, int startRow, int maxRows, params object[] parameters)
        {
            OracleCommand command = new OracleCommand(sql, connection);
            command.PopulateParameters(parameters);
            OracleDataAdapter dataAdapter = new OracleDataAdapter(command);
            DataSet data = new DataSet("Temp");
            dataAdapter.Fill(data, startRow, maxRows, "Table1");

            return data;
        }
开发者ID:avs009,项目名称:gsf,代码行数:20,代码来源:DataExtensions.cs

示例3: ExecuteReader

 /// <summary>
 /// Executes the SQL statement using <see cref="OracleConnection"/>, and builds a <see cref="OracleDataReader"/>.
 /// </summary>
 /// <param name="sql">The SQL statement to be executed.</param>
 /// <param name="connection">The <see cref="OracleConnection"/> to use for executing the SQL statement.</param>
 /// <param name="behavior">One of the <see cref="CommandBehavior"/> values.</param>
 /// <param name="parameters">The parameters to be passed to the SQL stored procedure being executed.</param>
 /// <returns>A <see cref="OracleDataReader"/> object.</returns>
 public static OracleDataReader ExecuteReader(this OracleConnection connection, string sql, CommandBehavior behavior, params object[] parameters)
 {
     OracleCommand command = new OracleCommand(sql, connection);
     command.PopulateParameters(parameters);
     return command.ExecuteReader(behavior);
 }
开发者ID:avs009,项目名称:gsf,代码行数:14,代码来源:DataExtensions.cs


注:本文中的System.Data.OracleClient.OracleCommand.PopulateParameters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。