public static DataSet getDataSet(string sproc, List <DbParameter> parameters, string sessionID)
        {
            lock (DDCommon.CommonRoutines._lockingObject) {
                DbCommand command = getCommandForSproc(sproc, sessionID);
                if (parameters != null)
                {
                    command.Parameters.AddRange(parameters.ToArray());
                }
                if (useSQLCommandLine())
                {
                    List <DbParameter> parmList = new List <DbParameter>();
                    foreach (DbParameter dbParm in command.Parameters)
                    {
                        parmList.Add(dbParm);
                    }
                    return(executeNonQueryCommandStatement(sproc, parmList, sessionID));
                }
                else
                {
                    if (!SqlServerAllowsSprocs)
                    {
                        StoredProcedureGetDataSet sp = (StoredProcedureGetDataSet)StoredProcedureGetDataSet.buildClassInstance(sproc, parameters);
                        return(sp.getDataSet(sessionID));
                    }
                    else
                    {
                        command.CommandTimeout = 11560;
                        DataAdapter da = getAdapter(command);
                        DataSet     ds = new DataSet();

                        da.Fill(ds);
                        return(ds);
                    }
                }
            }
        }
 public static DataSet getDataSet(string sproc, string selectString, string whereString, string orderByString, string sessionID)
 {
     lock (DDCommon.CommonRoutines._lockingObject) {
         DbCommand   command = getCommandForSproc(sproc, sessionID);
         DbParameter parm    = buildStringParm("SelectClause", selectString, ParameterDirection.Input);
         command.Parameters.Add(parm);
         parm = buildStringParm("WhereClause", whereString, ParameterDirection.Input);
         command.Parameters.Add(parm);
         parm = buildStringParm("OrderByClause", orderByString, ParameterDirection.Input);
         command.Parameters.Add(parm);
         if (useSQLCommandLine())
         {
             List <DbParameter> parmList = new List <DbParameter>();
             foreach (DbParameter dbParm in command.Parameters)
             {
                 parmList.Add(dbParm);
             }
             return(executeNonQueryCommandStatement(sproc, parmList, sessionID));
         }
         else
         {
             if (!SqlServerAllowsSprocs)
             {
                 StoredProcedureGetDataSet sp = StoredProcedureGetDataSet.buildClassInstance(sproc, selectString, whereString, orderByString);
                 return(sp.getDataSet(sessionID));
             }
             else
             {
                 DataAdapter da = getAdapter(command);
                 DataSet     ds = new DataSet();
                 da.Fill(ds);
                 return(ds);
             }
         }
     }
 }