public IDbCommand GetDbCommand() { IDbCommand comando = (IDbCommand)HlpFuncoes.getObjeto(sDriverBaseDados, sClasseDbCommandBaseDados); return(comando); }
public IDbDataAdapter GetDataAdapter() { IDbDataAdapter da = (IDbDataAdapter)HlpFuncoes.getObjeto(sDriverBaseDados, sClasseDbDataAdapterBaseDados); return(da); }
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); }
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); }
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(); } }
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); }