Visualizzazione dei risultati da 1 a 10 su 10
  1. #1

    come si fa a fare IF???

    Buonasera, vorrei sapere come si fa a fare IF, cioè se nella riga del db si trova "N" e nella pagina asp potrebbe apparire "Disabilitato", invece se nel db risulta "S" e nella pagina appare "Abilitato", ho provato a scrivere in questo modo:
    ------------------------------------------------------------------
    <%
    if Y <> (matricola.Fields.Item("abilita").Value) then
    response.write "Abilitato"
    else
    if N <>(matricola.Fileds.Item("abilita").Value) then response.write "Disabilitato"
    end if
    %>
    ------------------------------------------------------------------

    E si appare sempre "abilitato" anche nella riga si era risultato "N", come mai? Sinceramente per me è importante IF così da oggi in poi potrei sapere come usare IF, grazie , ah anche per le immagini, come si fa a inserire nel SQL2000?? binary o sbaglio?? e poi nelle pagine asp come farei a farla visualizzare? Mi piacerebbe di imparare anche questo
    Grazie molto
    Gabry
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  2. #2
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    codice:
    if matricola.Fields.Item("abilita").Value = "Y" then 
       response.write "Abilitato" 
    else 
       response.write "Disabilitato" 
    end if
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  3. #3
    Scusa ma non è che il Campo ha sempre quel valore??

    Comunque

    codice:
    If var = "N" then
         Response.Write "Abilitato"
    ElseIf var = "M" Then
         Response.Write "Disabilitato"
    End If
    ...

  4. #4
    Originariamente inviato da Sypher
    codice:
    if matricola.Fields.Item("abilita").Value = "Y" then 
       response.write "Abilitato" 
    else 
       response.write "Disabilitato" 
    end if
    Perfetto Ti ringrazio molto!
    Poi su quell'immagine? che tipo devo mettere nel sql? Scusami per il disturbo!
    Gabriele
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  5. #5
    poi per separare la tabella per il giorno e l'ora, in sql ho messo tipo datetime, e default value(getdate()), ma visualizza il giorno e l'ora, ma io vorrei separare una tabella per giorno e altra tabella per l'ora, come si fa?
    Gabriele
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  6. #6
    Originariamente inviato da Sypher
    codice:
    if matricola.Fields.Item("abilita").Value = "Y" then 
       response.write "Abilitato" 
    else 
       response.write "Disabilitato" 
    end if
    e invece quelle immagini?

    --------------------
    <%
    if matricola.Fields.Item("abilita").Value = "Y" then
    response.write "[img]abilitato.gif[/img]"
    else
    response.write "[img]disabilitato.gif[/img]"
    end if
    %>
    ---------------------
    E giusto?
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  7. #7
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    prova così con gli apicetti
    codice:
    <%
    if matricola.Fields.Item("abilita").Value = "Y" then 
       response.write "[img]abilitato.gif[/img]" 
    else 
       response.write "[img]disabilitato.gif[/img]" 
    end if
    %>
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  8. #8
    Originariamente inviato da Sypher
    prova così con gli apicetti
    codice:
    <%
    if matricola.Fields.Item("abilita").Value = "Y" then 
       response.write "[img]abilitato.gif[/img]" 
    else 
       response.write "[img]disabilitato.gif[/img]" 
    end if
    %>
    ecco perfetto, e invece come si fa nel sql2000 per inserire nella tabella con valore ora e data? (getdate()) visualizza tutto, invece vorrei separare soltanto visualizzare il giorno e altra solo per l'ora. Grazie
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  9. #9
    as
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  10. #10
    per IF, vorrei inserire una tabella, se nel db è vuoto, non inserisce nella tabella. come si fa??
    Grazie mille
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.