本文整理汇总了C#中FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader方法的典型用法代码示例。如果您正苦于以下问题:C# FbCommand.ExecuteReader方法的具体用法?C# FbCommand.ExecuteReader怎么用?C# FbCommand.ExecuteReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FirebirdSql.Data.FirebirdClient.FbCommand
的用法示例。
在下文中一共展示了FbCommand.ExecuteReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buscarCod_Equipe
public Equipe buscarCod_Equipe(String cod_equipe)
{
SigletonConexaoFB.carregaStrcnx();
Equipe resultado = new Equipe();
FbCommand command = new FbCommand();
FbDataReader reader;
try
{
command.Connection = SigletonConexaoFB.getConexao();
command.CommandText = "SELECT A.EQUIPE,A.NOME,A.COD_PERFIL_EQUIPE,B.NOME as NOME_PERFIL FROM TB_EQUIPE A " +
"LEFT OUTER JOIN TB_PERFIL_EQUIPE B ON (B.COD_PERFIL_EQUIPE=A.COD_PERFIL_EQUIPE) WHERE EQUIPE='" + cod_equipe + "'";
command.Connection.Open();
reader = command.ExecuteReader();
if (reader.Read())
{
resultado.Cod_Equipe = reader["EQUIPE"].ToString();
resultado.Nome = reader["NOME"].ToString();
resultado.Perfil.Cod_Perfil_Equipe = int.Parse(reader["COD_PERFIL_EQUIPE"].ToString());
resultado.Perfil.Nome = reader["NOME_PERFIL"].ToString();
}
reader.Close();
}
catch (Exception ex)
{
throw new Exception("Erro na busca da equipe pelo código: " + ex.Message);
}
finally
{
command.Connection.Close();
}
return resultado;
}
示例2: buscarCodmat
public Produto buscarCodmat(String codmat)
{
SigletonConexaoFB.carregaStrcnx();
Produto resultado = new Produto();
FbCommand command = new FbCommand();
FbDataReader reader;
try
{
command.Connection = SigletonConexaoFB.getConexao();
command.CommandText = "SELECT CODMAT,DESCRICAO,UNID FROM TB_MATERIAL " +
"WHERE CODMAT='" + codmat + "'";
command.Connection.Open();
reader = command.ExecuteReader();
if (reader.Read())
{
resultado.Codmat = reader["CODMAT"].ToString();
resultado.Descricao = reader["DESCRICAO"].ToString();
resultado.Unid = reader["UNID"].ToString();
}
reader.Close();
}
catch (Exception ex)
{
throw new Exception("Erro na busca de produto pelo código: " + ex.Message);
}
finally
{
command.Connection.Close();
}
return resultado;
}
示例3: DestinoObtener
public Destino DestinoObtener(int AClave){
Destino pResult = null;
string pSentencia = "SELECT CLAVE, DESTINO FROM DRASDEST WHERE CLAVE = @CLAVE";
FbConnection con = _Conexion.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
com.Parameters.Add("@CLAVE", FbDbType.Integer).Value = AClave;
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
if (reader.Read()){
pResult = ReaderToEntidad(reader);
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open){
con.Close();
}
}
return pResult;
}
示例4: fNIP
public string fNIP(string sNIP)
{
string sReturn = "0";
string query = "select count(*) from ad_firms where (UPPER(TAXID) = UPPER('" + sNIP + "'));";
//Open connection
if (this.OpenConnection() == true)
{
//Create Command
FbCommand cmd = new FbCommand(query, connection);
//Create a data reader and Execute the command
FbDataReader dataReader = cmd.ExecuteReader();
//MessageBox.Show(query, "qry", MessageBoxButtons.OK);
//Read the data and store them in the list
while (dataReader.Read())
{
sReturn = dataReader[0].ToString() + "";
}
//close Data Reader
dataReader.Close();
//close Connection
this.CloseConnection();
return sReturn;
}
else
{
return sReturn;
}
}
示例5: ObtenerCajasAplicadasCorte
public int ObtenerCajasAplicadasCorte(string AFecha, int ACamara, string AEmbarcado)
{
string pSentencia = "SELECT COUNT(*) FROM DRASCORT WHERE "+
"FECHA = @FECHA "+
"AND CAMARA = @CAMARA "+
"AND EMBARCADO = @EMBARCADO "+
"AND ENTRADA_APLICADA = 'Si'";
FbConnection con = _Conexion.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
com.Parameters.Add("@FECHA", FbDbType.TimeStamp).Value = AFecha;
com.Parameters.Add("@CAMARA", FbDbType.Integer).Value = ACamara;
com.Parameters.Add("@EMBARCADO", FbDbType.VarChar).Value = AEmbarcado;
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
if (reader.Read())
{
return (int)reader["COUNT"];
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return 0;
}
示例6: RettcDadosConstrucaoCivil
public tcDadosConstrucaoCivil RettcDadosConstrucaoCivil(FbConnection Conn, string sNota)
{
try
{
StringBuilder sQuery = new StringBuilder();
sQuery.Append("select coalesce(clifor.cd_art,'') Art, coalesce(clifor.cd_obra,'')CodigoObra {0}");
sQuery.Append("from nf inner join clifor on nf.cd_clifor = clifor.cd_clifor {0}");
sQuery.Append("where nf.cd_nfseq = '{1}' and nf.cd_empresa = '{2}' {0}");
string sQueryEnd = string.Format(sQuery.ToString(), Environment.NewLine, sNota, belStatic.codEmpresaNFe);
FbCommand cmd = new FbCommand(sQueryEnd, Conn);
Conn.Open();
FbDataReader dr = cmd.ExecuteReader();
objtcDadosConstrucaoCivil = new tcDadosConstrucaoCivil();
while (dr.Read())
{
objtcDadosConstrucaoCivil.Art = dr["Art"].ToString();
objtcDadosConstrucaoCivil.CodigoObra = dr["CodigoObra"].ToString();
}
}
catch (Exception)
{
throw;
}
finally { Conn.Close(); }
return objtcDadosConstrucaoCivil;
}
示例7: ExisteClasificacionCorte
public bool ExisteClasificacionCorte(ClasificacionCorte AClasificacionCorte)
{
string pSentencia = "SELECT ID FROM CLASIFICACIONCORTES WHERE UPPER(TRIM(DESCRIPCION)) = @DESCRIPCION";
FbConnection con = _Conexion.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
com.Parameters.Add("@DESCRIPCION", FbDbType.VarChar).Value = AClasificacionCorte.Descripcion.ToUpper().Trim();
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
if (reader.Read())
{
if ((int)reader["ID"] == AClasificacionCorte.Id)
return false;
else return true;
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return false;
}
示例8: obtener_lista
//SELECT T0.*, T1.DESCRIPCION FROM DRASSOBRANTESD T0 JOIN DRASPROD T1 ON T1.CLAVE = T0.PRODUCTO WHERE ID_SOBRANTE = ?
public List<SobrantesD> obtener_lista(int Aid)
{
List<SobrantesD> pResult = new List<SobrantesD>();
string pSentencia = "SELECT T0.*, T1.DESCRIPCION FROM DRASSOBRANTESD T0 JOIN DRASPROD T1 ON T1.CLAVE = T0.PRODUCTO WHERE ID_SOBRANTE = @ID_SOBRANTE";
FbConnection con = _Conexiones.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
com.Parameters.Add("@ID_SOBRANTE", FbDbType.Integer).Value = Aid;
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
while (reader.Read())
{
SobrantesD pSobrandesD = new SobrantesD();
pSobrandesD.id = (reader["ID"] != DBNull.Value) ? (int)reader["ID"] : -1;
pSobrandesD.id_sobrante = (reader["ID_SOBRANTE"] != DBNull.Value) ? (int)reader["ID_SOBRANTE"] : -1;
pSobrandesD.producto = (reader["PRODUCTO"] != DBNull.Value) ? (string)reader["PRODUCTO"] : "";
pSobrandesD.descripcion = (reader["DESCRIPCION"] != DBNull.Value) ? (string)reader["DESCRIPCION"] : "";
pResult.Add(pSobrandesD);
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return pResult;
}
示例9: ListaCostosMaquila
//Retorna la lista de Costos Maquila
public List<CostoMaquilaM> ListaCostosMaquila()
{
List<CostoMaquilaM> pResult = new List<CostoMaquilaM>();
string pSentencia = "SELECT * FROM DRASCOSTOSMAQUILAM";
FbConnection con = _Conexiones.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
while (reader.Read())
{
CostoMaquilaM pCostoMaquila = new CostoMaquilaM();
pCostoMaquila.Id = reader.GetInt32(0);
pCostoMaquila.Fecha = reader.GetString(1);
pCostoMaquila.FechaFinal = reader.GetString(2);
pCostoMaquila.Descripcion = reader.GetString(3);
pCostoMaquila.Activo = reader.GetString(4);
pCostoMaquila.FechaHoraSistema = reader.GetString(5);
pResult.Add(pCostoMaquila);
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return pResult;
}
示例10: ObtenerEmpaques
public List<Empaque> ObtenerEmpaques(string AOrderBy)
{
List<Empaque> pResult = new List<Empaque>();
Empaque pEmpaque = null;
string pSentencia = "SELECT * FROM DRASEMPAQUE ORDER BY "+AOrderBy;
FbConnection con = _Conexion.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia,con);
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
while (reader.Read()){
pEmpaque = new Empaque();
pEmpaque.Clave = (int)reader["ID"];
pEmpaque.IdTipoEmpaque = (int)reader["ID_TIPOEMPAQUE"];
pEmpaque.Nombre = (reader["NOMBRE"] != DBNull.Value) ? (string)reader["NOMBRE"] : "";
pEmpaque.CodigoSAP = (reader["CODIGOSAP"] != DBNull.Value) ? (string)reader["CODIGOSAP"] : "";
pEmpaque.Costo = (reader["COSTO"] != DBNull.Value) ? (decimal)reader["COSTO"] : 0;
pResult.Add(pEmpaque);
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return pResult;
}
示例11: listaProductosFechaEliminados
public List<Producto> listaProductosFechaEliminados(string AFecha)
{
List<Producto> pResult = new List<Producto>();
Producto pProducto = null;
string pSentencia = "SELECT DISTINCT(PRODUCTO) AS CLAVE, (SELECT DESCRIPCION FROM DRASPROD WHERE CLAVE = PRODUCTO) FROM DRASELIM WHERE FECHA = @FECHA AND CODIGOALTA IS NOT NULL";
FbConnection con = _Conexion.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
com.Parameters.Add("@FECHA", FbDbType.TimeStamp).Value = AFecha;
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
while (reader.Read())
{
pProducto = new Producto();
pProducto.Clave = reader["DESCRIPCION"] != DBNull.Value ? (string)reader["DESCRIPCION"] : "";
pResult.Add(pProducto);
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return pResult;
}
示例12: ExisteEmpaque
public bool ExisteEmpaque(Empaque AEmpaque)
{
string pSentencia = "SELECT ID FROM DRASEMPAQUE WHERE UPPER(TRIM(NOMBRE)) = @NOMBRE";
FbConnection con = _Conexion.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
com.Parameters.Add("@NOMBRE", FbDbType.VarChar).Value = AEmpaque.Nombre.ToUpper().Trim();
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
if (reader.Read())
{
if ((int)reader["ID"] == AEmpaque.Clave)
return false;
else return true;
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return false;
}
示例13: PopulaDadosCancelamento
public void PopulaDadosCancelamento(string sCodConhecimento, string sJustificativa)
{
try
{
StringBuilder sQuery = new StringBuilder();
sQuery.Append("Select ");
sQuery.Append("conhecim.cd_chavecte chCTe, ");
sQuery.Append("conhecim.cd_nprotcte nProt ");
sQuery.Append("from conhecim ");
sQuery.Append("where conhecim.cd_conheci ='" + sCodConhecimento + "' ");
sQuery.Append("and conhecim.cd_empresa = '" + belStatic.CodEmpresaCte + "'");
FbCommand fbConn = new FbCommand(sQuery.ToString(), cx.get_Conexao());
cx.Open_Conexao();
fbConn.ExecuteNonQuery();
FbDataReader dr = fbConn.ExecuteReader();
dr.Read();
objBelCancelaCte.versao = "1.03";
objBelCancelaCte.Id = "ID" + dr["chCTe"].ToString();
objBelCancelaCte.tpAmb = belStatic.TpAmb.ToString();
objBelCancelaCte.xServ = "CANCELAR";
objBelCancelaCte.chCTe = dr["chCTe"].ToString();
objBelCancelaCte.nProt = dr["nProt"].ToString();
objBelCancelaCte.xJust = sJustificativa;
}
catch (Exception)
{
throw;
}
finally { cx.Close_Conexao(); }
}
示例14: ObtenerLista
public List<EstimacionEmpaqueM> ObtenerLista()
{
List<EstimacionEmpaqueM> pResult = new List<EstimacionEmpaqueM>();
EstimacionEmpaqueM estimacionEmpM;
string pSentencia = "SELECT * FROM DRASESTIEMPAQUEM";
FbConnection con = _Conexiones.ObtenerConexion();
FbCommand com = new FbCommand(pSentencia, con);
try
{
con.Open();
FbDataReader reader = com.ExecuteReader();
while (reader.Read())
{
estimacionEmpM = new EstimacionEmpaqueM();
estimacionEmpM.Id = (int)reader["ID"];
estimacionEmpM.Descripcion = reader["DESCRIPCION"] != DBNull.Value ? (string)reader["DESCRIPCION"] : "";
estimacionEmpM.FechaHoraSistema = reader["FECHAHORASISTEMA"] != DBNull.Value ? (DateTime?)reader["FECHAHORASISTEMA"] : null;
pResult.Add(estimacionEmpM);
}
}
finally
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
}
return pResult;
}
示例15: DeletaTramite
public void DeletaTramite(int idTramite)
{
string query = "select datarecebimento , usuariorecebimento from webtramite where id = " + idTramite;
var connection = Persist.GetConn.getConn();
var cmd = new FbCommand(query, connection);
var datarecebimento = string.Empty;
var usuariorecebimento = string.Empty;
using (connection)
{
connection.Open();
var dr = cmd.ExecuteReader();
while (dr.Read()) {
datarecebimento = dr["datarecebimento"].ToString();
usuariorecebimento = dr["usuariorecebimento"].ToString();
}
}
if (string.IsNullOrEmpty(datarecebimento) && string.IsNullOrEmpty(usuariorecebimento))
{
string sql = "delete from webtramite where id = " + idTramite;
AcessoDados.AcessoDados.executar(sql);
}
}