示例#1
0
        public IDbCommand GetDbCommand()
        {
            IDbCommand comando = (IDbCommand)HlpFuncoes.getObjeto(sDriverBaseDados,
                                                                  sClasseDbCommandBaseDados);

            return(comando);
        }
示例#2
0
        public IDbDataAdapter GetDataAdapter()
        {
            IDbDataAdapter da = (IDbDataAdapter)HlpFuncoes.getObjeto(sDriverBaseDados,
                                                                     sClasseDbDataAdapterBaseDados);

            return(da);
        }
示例#3
0
        private static IDbCommand GetObjetoDbCommand(IDbConnection conexao,
                                                     string sBibliotecaDll, string sClasseDbCommand, string sExpressaoSql)
        {
            IDbCommand comando = (IDbCommand)HlpFuncoes.getObjeto(sBibliotecaDll,
                                                                  sClasseDbCommand);

            if (conexao.State != ConnectionState.Open)
            {
                conexao.Open();
            }
            comando.Connection  = conexao;
            comando.CommandText = sExpressaoSql;
            return(comando);
        }
示例#4
0
        private IDataReader GetDataReaderExistenciaObjeto(StringBuilder strExpressao,
                                                          IDbConnection conexao)
        {
            IDbCommand comando = (IDbCommand)HlpFuncoes.getObjeto(
                GetDriverBaseDados(),
                GetClasseDbCommandBaseDados());

            comando.Connection  = conexao;
            comando.CommandText = strExpressao.ToString();

            IDataReader dr = comando.ExecuteReader();

            return(dr);
        }
示例#5
0
文件: Tabela.cs 项目: dramosti/Web
        public void ConfigurarConectarBase(string sservidor, string sbanco,
                                           bool MantemConexaoAberta)
        {
            //Rotina implementada por Renato - 22/03/2006 - OS 14461
            EfetuarFechamentoConexao(objConexao);
            if (objConexao == null)
            {
                objConexao = (IDbConnection)HlpFuncoes.getObjeto(
                    objFuncoesBanco.GetDriverBaseDados(),
                    objFuncoesBanco.GetClasseConexaoBaseDados());
            }
            string sPorta = WebConfigurationManager.AppSettings["PORT"];

            objConexao.ConnectionString = objFuncoesBanco.GetStringConexao(sservidor,
                                                                           sbanco, MS_USERNAME, MS_SENHA, sPorta);
            objConexao.Open();
            if (!MantemConexaoAberta)
            {
                objConexao.Close();
            }
        }
示例#6
0
        public static DataTable QrySeekRet(IDbConnection conexao,
                                           string sBibliotecaDll, string sClasseDataAdapter, string sClasseDbCommand,
                                           string sExpressaoSql, bool bFechaConexao)
        {
            DbDataAdapter da = (DbDataAdapter)HlpFuncoes.getObjeto(sBibliotecaDll,
                                                                   sClasseDataAdapter);

            da.SelectCommand = (DbCommand)GetObjetoDbCommand(conexao, sBibliotecaDll,
                                                             sClasseDbCommand, sExpressaoSql);
            if (conexao.State != ConnectionState.Open)
            {
                conexao.Open();
            }
            DataSet ds = new DataSet("dadoshlp");

            da.Fill(ds, "registro");
            DataTable dt = ds.Tables[0];

            if (bFechaConexao)
            {
                conexao.Close();
            }
            return(dt);
        }