Example #1
0
        ///<summary>
        ///Executes a stored procedure and returns the result as a DataTable.
        ///</summary>
        public static DataTable Execute(string ConnectionName, string Procedure, params object[] ParameterValues)
        {
            PSOQuery Q = new PSOQuery(ConnectionName, Procedure, ParameterValues.ToArray());

            return(Execute(Q));
        }
Example #2
0
        ///<summary>
        ///Executes a stored procedure and returns the result as a DataTable. In order to avoid confusion between the parameters and the timeout integer,
        ///the parameters must be "bundled" and passed in as some enumerable collection
        ///</summary>
        public static DataTable Execute(string ConnectionName, int TimeOutSeconds, string Procedure, IEnumerable <object> ParameterValues)
        {
            PSOQuery Q = new PSOQuery(ConnectionName, Procedure, TimeOutSeconds, CommandType.StoredProcedure, ParameterValues);

            return(Execute(Q));
        }
Example #3
0
        ///<summary>
        ///Executes a stored procedure and returns the result as a DataTable.
        ///</summary>
        public static DataTable Execute(PSOQuery Q)
        {
            var ds = Fetch.FetchTables(Q.ConnectionName, Q.CommandType, Q.TimeOutSeconds, Q.CommandString, Q.ParameterValues);

            return(ds.Tables.Count == 0 ? new DataTable() : ds.Tables[0]);
        }