Torna al Thread
[CODE]
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Page.Title = Resources.ResourceMaster.PageTitle & "; " & Resources.ResourcePagesTitle.titleHomePage
Dim clsConn As New ClassConnessione
Dim clsGen As New ClassGenerali
Try
'verifica connessione aperta o chiusa '
Call clsConn.VerificaConnessione(clsConn.ConnettiGenerale, DBGenerali)
Call clsConn.EstraiDati("SELECT ImageSpot,ImageSpotProssimamente FROM SpotGraficiHome WHERE DtFineValidita >='" & clsGen.FormattaDataITAMySQL(System.DateTime.Today) & "' ORDER BY DtFineValidita ASC LIMIT 1", clsConn.ConnettiGenerale)
If IsNothing(clsConn.Dati) = False And clsConn.Dati.HasRows = True Then
strImageSpotHome = ImgPath & clsConn.Dati("ImageSpot")
strImageSpotHomeProssimamente = ImgPath & clsConn.Dati("ImageSpotProssimamente")
Else
strImageSpotHome = ImgPath & "ImgHomeDefault.jpg"
strImageSpotHomeProssimamente = ImgPath & "ImgHomeProssimamenteDefault.jpg"
End If
Dim imgHome As Image = TableImgHome.FindControl("ImgHome")
Dim ImgHomeProssimamente As Image = TableProssimamente.FindControl("ImgHomeProssimamente")
imgHome.ImageUrl = strImageSpotHome
ImgHomeProssimamente.ImageUrl = strImageSpotHomeProssimamente
Catch ex As Exception
If ViewMsgDebug = True Then clsGen.MostraMessaggio(HttpContext.Current.Handler, Resources.ResourceMsg.Errore, ex.Message)
'SEND MAIL CON ERRORE ESTESO
Call clsGen.ScriviLog("Default.aspx.vb_Load", ex.Message)
Finally
'+++ chiusura oggetto dati +++
If Not IsNothing(clsConn.Dati) Then
If clsConn.Dati.HasRows = True Then
If clsConn.Dati.IsClosed = False Then clsConn.Dati.Close()
clsConn.Dati = Nothing
End If
End
If IsNothing(clsConn) = False Then clsConn.Dispose()
If IsNothing(clsGen) = False Then clsGen = Nothing
End Try
[/CODE]