BaiRong.Core.Data.DbHelper.ExecuteDataset(System.Data.IDbCommand)

Here are the examples of the csharp api class BaiRong.Core.Data.DbHelper.ExecuteDataset(System.Data.IDbCommand) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

1. Example

Project: cms
Source File: DbHelper.cs
public virtual DataSet ExecuteDatasetTypedParams(IDbCommand command, DataRow dataRow)
        {
            DataSet ds;

            // Clean Up Parameter Syntax
            CleanParameterSyntax(command);

            // If the row has values, the store procedure parameters must be initialized
            if (dataRow != null && dataRow.ItemArray.Length > 0)
            {
                // Set the parameters values
                AssignParameterValues(command.Parameters, dataRow);


                ds = ExecuteDataset(command);
            }
            else
            {
                ds = ExecuteDataset(command);
            }

            return ds;
        }

2. Example

Project: cms
Source File: DbHelper.cs
public virtual DataSet ExecuteDataset(IDbTransaction transaction, string commandText,
            params IDataParameter[] commandParameters)
        {
            if (transaction == null) throw new ArgumentNullException(nameof(transaction));
            if (transaction != null && transaction.Connection == null)
                throw new ArgumentException(
                    "The transaction was rolled back or commited, please provide an open transaction.",
                    nameof(transaction));

            // Create a command and prepare it for execution
            var cmd = transaction.Connection.CreateCommand();
            bool mustCloseConnection;
            PrepareCommand(cmd, transaction.Connection, transaction, commandText, commandParameters,
                out mustCloseConnection);
            CleanParameterSyntax(cmd);

            return ExecuteDataset(cmd);

        }

3. Example

Project: cms
Source File: DbHelper.cs
public virtual DataSet ExecuteDataset(IDbConnection connection, string commandText,
            params IDataParameter[] commandParameters)
        {
            if (connection == null) throw new ArgumentNullException(nameof(connection));

            // Create a command and prepare it for execution
            var cmd = connection.CreateCommand();
            bool mustCloseConnection;
            PrepareCommand(cmd, connection, null, commandText, commandParameters, out mustCloseConnection);
            CleanParameterSyntax(cmd);

            var ds = ExecuteDataset(cmd);

            if (mustCloseConnection)
                connection.Close();

            // Return the DataSet
            return ds;
        }