public bool IsClientAddresseeNameExists(Int32 clientId, string clientAddresseeName) { var isClientAddresseeNameExists = false; DbCommand dbCommand = null; try { using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.CheckClientAddressNameIsExists)) { database.AddInParameter(dbCommand, "@client_id", DbType.Int32, clientId); database.AddInParameter(dbCommand, "@client_address_name", DbType.String, clientAddresseeName); using (IDataReader reader = database.ExecuteReader(dbCommand)) { while (reader.Read()) { isClientAddresseeNameExists = DRE.GetBoolean(reader, "is_client_address_name_exists"); } } } } catch (Exception ex) { throw ex; } finally { dbCommand = null; } return(isClientAddresseeNameExists); }