Example #1
0
        public DataSet Request(DataSet ds, IncludeSchema isEnum, string nombreProcedimiento, IDictionaryEnumerator parametros)
        {
            DB2Connection lc = OpenConnection();

            try
            {
                DB2Command comm = new DB2Command(nombreProcedimiento, lc);
                comm.CommandType = System.Data.CommandType.StoredProcedure;
                if (parametros != null)
                {
                    while (parametros.MoveNext())
                    {
                        comm.Parameters.Add(parametros.Key.ToString(), parametros.Value);
                    }
                }
                DB2DataAdapter adapter = new DB2DataAdapter(comm);
                if (isEnum == IncludeSchema.YES)
                {
                    adapter.FillSchema(ds, SchemaType.Mapped);
                    adapter.Fill(ds);
                }
                else
                {
                    adapter.Fill(ds, "result_ " + ds.Tables.Count.ToString());
                }
            }
            catch (Exception e)
            {
                exceptions  = "Error ejecutando SQL." + cambioLinea + cambioLinea;
                exceptions += e.ToString();
                AdministradorCarpetasRegistro.GrabarLogs(TipoRegistro.Error, nombreProcedimiento, e, exceptions);
            }
            CloseConnection(lc);
            return(ds);
        }
Example #2
0
        public DataSet Request(DataSet ds, IncludeSchema isEnum, string sql)
        {
            SqlConnection lc = OpenConnection();

            try
            {
                AdministradorCarpetasRegistro.GrabarLogs(TipoRegistro.Actividad, sql, null, string.Empty);
                sql = esquemaDB(sql);

                SqlDataAdapter adapter = new SqlDataAdapter(sql, lc);

                if (isEnum == IncludeSchema.YES)
                {
                    adapter.FillSchema(ds, SchemaType.Mapped);
                    adapter.Fill(ds);
                }
                else
                {
                    adapter.Fill(ds, "result_ " + ds.Tables.Count.ToString());
                }
            }
            catch { }
            CloseConnection(lc);


            return(ds);
        }
Example #3
0
        public DataSet RequestGlobal(DataSet ds, IncludeSchema isEnum, string dataBase, string sql)
        {
            DB2Connection lc;

            if (dataBase == "")
            {
                lc = OpenConnectionGlobal();
            }
            else
            {
                lc = OpenConnectionGlobal(dataBase);
            }

            try
            {
                AdministradorCarpetasRegistro.GrabarLogs(TipoRegistro.Actividad, sql, null, string.Empty);
                DB2DataAdapter adapter = new DB2DataAdapter(sql, lc);

                if (isEnum == IncludeSchema.YES)
                {
                    adapter.FillSchema(ds, SchemaType.Mapped);
                    adapter.Fill(ds);
                }
                else
                {
                    adapter.Fill(ds, "result_ " + ds.Tables.Count.ToString());
                }
            }
            catch { }
            CloseConnection(lc);

            return(ds);
        }
Example #4
0
        public DataSet Request(DataSet ds, IncludeSchema isEnum, string sql)
        {
            OleDbConnection con = this.OpenConnection();

            try
            {
                OleDbDataAdapter adapter = new OleDbDataAdapter(sql, con);
                if (isEnum == IncludeSchema.YES)
                {
                    adapter.FillSchema(ds, SchemaType.Mapped);
                    adapter.Fill(ds);
                }
                else
                {
                    adapter.Fill(ds, "result_ " + ds.Tables.Count.ToString());
                }
            }
            catch (Exception e)
            {
                exceptions  = "Error ejecutando SQL." + cambioLinea + cambioLinea;
                exceptions += e.ToString();
            }
            this.CloseConnection(con);
            return(ds);
        }
Example #5
0
        public DataSet Request(DataSet ds, IncludeSchema isEnum, string nombreProcedimiento, IDictionaryEnumerator parametros)
        {
            OdbcConnection lc = OpenConnection();

            try
            {
                OdbcCommand comm = new OdbcCommand(nombreProcedimiento, lc);
                comm.CommandType = System.Data.CommandType.StoredProcedure;
                if (parametros != null)
                {
                    while (parametros.MoveNext())
                    {
                        comm.Parameters.Add(parametros.Key.ToString(), parametros.Value);
                    }
                }
                OdbcDataAdapter adapter = new OdbcDataAdapter(comm);
                if (isEnum == IncludeSchema.YES)
                {
                    adapter.FillSchema(ds, SchemaType.Mapped);
                }
                adapter.Fill(ds, "result_" + (ds.Tables.Count + 1).ToString());
            }
            catch (Exception e)
            {
                exceptions  = "Error ejecutando SQL.<br><br>";
                exceptions += e.ToString();
            }
            CloseConnection(lc);
            return(ds);
        }
Example #6
0
        public static DataSet Request(DataSet ds, IncludeSchema isEnum, string nombreProcedimiento, IDictionaryEnumerator parametros)
        {
            ds         = func.Request(ds, isEnum, nombreProcedimiento, parametros);
            exceptions = func.Exceptions;

            return(ds);
        }
Example #7
0
        public static DataSet RequestGlobal(DataSet ds, IncludeSchema isEnum, string dataBase, string sql)
        {
            ds         = func.RequestGlobal(ds, isEnum, dataBase, sql);
            exceptions = func.Exceptions;

            return(ds);
        }
Example #8
0
        public DataSet RequestGlobal(DataSet ds, IncludeSchema isEnum, string dataBase, string sql)
        {
            DataSet ds2 = ws.RequestSQL(usr, pass, sql);

            ds.Tables.Add(ds2.Tables[0].Copy());

            return(ds);
        }
Example #9
0
        public DataSet Request(DataSet ds, IncludeSchema isEnum, string sql)
        {
            AdministradorCarpetasRegistro.GrabarLogs(TipoRegistro.Actividad, sql, null, string.Empty);
            DB2DataAdapter adapter = new DB2DataAdapter(sql, connection);

            if (isEnum == IncludeSchema.YES)
            {
                adapter.FillSchema(ds, SchemaType.Mapped);
                adapter.Fill(ds);
            }
            else
            {
                adapter.Fill(ds, "result_ " + ds.Tables.Count.ToString());
            }

            return(ds);
        }
Example #10
0
        public DataSet RequestGlobal(DataSet ds, IncludeSchema isEnum, string dataBase, string sql)
        {
            OdbcConnection lc = OpenConnection();

            try
            {
                OdbcDataAdapter adapter = new OdbcDataAdapter(sql, lc);
                if (isEnum == IncludeSchema.YES)
                {
                    adapter.FillSchema(ds, SchemaType.Mapped);
                }
                adapter.Fill(ds, "result_" + (ds.Tables.Count + 1).ToString());
            }
            catch (Exception e)
            {
                exceptions  = "Error ejecutando SQL.<br><br>";
                exceptions += e.ToString();
            }
            CloseConnection(lc);
            return(ds);
        }
Example #11
0
        public DataSet Request(DataSet ds, IncludeSchema isEnum, string sql)
        {
            DB2Connection lc = OpenConnection();

            try
            {
                AdministradorCarpetasRegistro.GrabarLogs(TipoRegistro.Actividad, sql, null, string.Empty);
                DB2DataAdapter adapter = new DB2DataAdapter(sql, lc);

                if (isEnum == IncludeSchema.YES)
                {
                    adapter.FillSchema(ds, SchemaType.Mapped);
                    adapter.Fill(ds);
                }
                else
                {
                    adapter.Fill(ds, "result_ " + ds.Tables.Count.ToString());
                }
            }
            catch (Exception z) { this.exceptions = z.Message; }
            CloseConnection(lc);

            return(ds);
        }
Example #12
0
 public DataSet Request(DataSet ds, IncludeSchema isEnum, string nombreProcedimiento, IDictionaryEnumerator parametros)
 {
     Exceptions = "Not Implemented";
     return(null);
 }