Click here to Skip to main content
15,897,273 members

Comments by aida1986 (Top 20 by date)

aida1986 30-Apr-18 10:14am View    
Deleted
I use this method :
public int MiseAJourDynamique(string requete, string[] parametres = null, object[] valeurs = null)
{
int retour = 0;

if (!requete.Contains("BEGIN"))
{
requete = @"BEGIN " + requete + @" END;";
}


using (DbCommand cmd = this.Context.Database.Connection.CreateCommand())
{
if (cmd.Connection.State != ConnectionState.Open)
cmd.Connection.Open();

cmd.CommandText = requete;
cmd.CommandType = System.Data.CommandType.Text;
if (cmd is OracleCommand)
{
((OracleCommand)cmd).BindByName = true;
}

if (parametres != null)
{
for (int i = 0; i < parametres.Length; i++)
{
var par1 = cmd.CreateParameter();
par1.ParameterName = parametres[i];
par1.Value = valeurs[i];
par1.Direction = ParameterDirection.Input;
cmd.Parameters.Add(par1);
}
}

retour = cmd.ExecuteNonQuery();

}
return retour;
}
aida1986 30-Apr-18 10:10am View    
I want to return the number of rows deleted in Oracle Database
aida1986 30-Apr-18 10:09am View    
   string RTmpSys = string.Empty;
             RTmpSys = "DELETE FROM HPRELEV "
             + "WHERE HPRELEV.EXE_COD = :EXE_COD "
           + "AND HPRELEV.MOI_COD = :MOI_COD "
           + "AND HPRELEV.TPA_COD = :TPA_COD "
          + "AND HPRELEV.EMP_MAT IN (SELECT EMPLOYE.EMP_MAT FROM EMPLOYE WHERE " + OrdEmp
        + " ); ";
aida1986 30-Apr-18 10:03am View    
The problem is with Oracle database ExuteNonQuery doesn't return the number of rows but it is always -1
aida1986 23-Nov-17 12:03pm View    
At least I want to know what is the algorithm that give the similar hexadecimal result