3.939 messaggi dal 28 gennaio 2003
mi è sfuggito, prova a sostituire con

Dim p_img As String = Trim(System.Web.HttpContext.Current.Request.QueryString("p_img"))
254 messaggi dal 01 agosto 2003
ora mi da questo errore


Compiler Error Message: BC30451: 'gl' is not declared. It may be inaccessible due to its protection level.

Source Error:



Line 18: 
Line 19:     Private Sub LeggiImmagineCampoBlob()
Line 20:         Using con As New OleDbConnection(gl.StringaConnessioneTest)
Line 21:             con.Open()
Line 22:             Dim sql As String = "select immagine from Tabella1 where [id] = 0"

victor
3.939 messaggi dal 28 gennaio 2003
hai sostituito gl.StringaConnessioneTest con la tua stringa di connessione?
254 messaggi dal 01 agosto 2003
stesso errore continua a dire che gl non e' dichiarato (in effetti non lo vedo dichiarato)
questo e' il tuo codice

Dim objconn As new OleDbConnection   ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.MapPath("immagini.mdb"))

Private Sub prove_a_Load(sender As Object, e As EventArgs) Handles Me.Load



       Dim p_img As String = Trim(System.Web.HttpContext.Current.Request.QueryString("p_img"))
        If p_img = "l" Then
            LeggiImmagineCampoBlob()
        End If

    End Sub

    Private Sub LeggiImmagineCampoBlob()
  
  

        Using con As New OleDbConnection(gl.objconn)
            con.Open()
            Dim sql As String = "select immagine from Tabella1 where [id] = 0"
            Dim command As New OleDbCommand(sql, con)
            Dim buffer As Byte() = CType(command.ExecuteScalar(), Byte())

            If buffer IsNot Nothing Then
                Response.Clear()
                Response.ClearContent()
                Response.AddHeader("Content-Length", buffer.Length.ToString)
                If buffer.Length > 0 Then
                    Response.BinaryWrite(buffer)
                End If

                Response.Flush() : Response.End()

            End If

        End Using

    End Sub


ecco l'errore

Server Error in '/' Application.

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: BC30451: 'gl' is not declared. It may be inaccessible due to its protection level.

Source Error:



Line 23:   
Line 24: 
Line 25:         Using con As New OleDbConnection(gl.objconn)
Line 26:             con.Open()
Line 27:             Dim sql As String = "select immagine from Tabella1 where [id] = 0"

Modificato da victor8872 il 09 luglio 2020 17:50 -
Modificato da victor8872 il 09 luglio 2020 17:51 -

victor
1.495 messaggi dal 27 dicembre 2005
victor8872 ha scritto:
stesso errore continua a dire che gl non e' dichiarato (in effetti non lo vedo dichiarato)
questo e' il tuo codice

Dim objconn As new OleDbConnection   ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.MapPath("immagini.mdb"))

Private Sub prove_a_Load(sender As Object, e As EventArgs) Handles Me.Load



       Dim p_img As String = Trim(System.Web.HttpContext.Current.Request.QueryString("p_img"))
        If p_img = "l" Then
            LeggiImmagineCampoBlob()
        End If

    End Sub

    Private Sub LeggiImmagineCampoBlob()
  
  

        Using con As New OleDbConnection(gl.objconn)
            con.Open()
            Dim sql As String = "select immagine from Tabella1 where [id] = 0"
            Dim command As New OleDbCommand(sql, con)
            Dim buffer As Byte() = CType(command.ExecuteScalar(), Byte())

            If buffer IsNot Nothing Then
                Response.Clear()
                Response.ClearContent()
                Response.AddHeader("Content-Length", buffer.Length.ToString)
                If buffer.Length > 0 Then
                    Response.BinaryWrite(buffer)
                End If

                Response.Flush() : Response.End()

            End If

        End Using

    End Sub


ecco l'errore

Server Error in '/' Application.

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: BC30451: 'gl' is not declared. It may be inaccessible due to its protection level.

Source Error:



Line 23:   
Line 24: 
Line 25:         Using con As New OleDbConnection(gl.objconn)
Line 26:             con.Open()
Line 27:             Dim sql As String = "select immagine from Tabella1 where [id] = 0"

Modificato da victor8872 il 09 luglio 2020 17:50 -
Modificato da victor8872 il 09 luglio 2020 17:51 -


Scusa se mi permetto ma sembra che non hai mai programmato....non vedi che è un suo codice interno ?
Lo devi modificare utilizzando le tue classi.
254 messaggi dal 01 agosto 2003
Ciao totti240282
no tranquillo.
E' che io rispetto a voi sono proprio alle prime armi.

Mi faresti vedere il discorso delle classi. Ovvero come risolvere quel errore che mi da?
se vuoi ovviamente
grazie

victor
3.939 messaggi dal 28 gennaio 2003
Va beh! colpa mia che non ho controllato bene.
Lì ci va la stringa di connessione. Ripeto: stringa di connessione, la tua

ps.
comunque, facci sapere se funziona
254 messaggi dal 01 agosto 2003
ho inserito cosi (objconn e' la mia stringa di connessione)

Using con As New OleDbConnection(gl.objconn)

continua con questo errore

'gl' is not declared. It may be inaccessible due to its protection level.

cosa e' questo gl ?

grazie Pietro

victor

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.