Visualizzazione dei risultati da 1 a 3 su 3

Discussione: GuestBook

  1. #1

    GuestBook

    Ciao a tutti! Premetto che sono alle prime armi quindi abbiate un pò di pazienza...stavo provando a creare un guestbook con asp.net ma mi risulta sbagliato..ecco il codice:

    <%@ Page Language="Vb" %>
    <%@ Import Namespace="System.Data.OleDb" %>
    Partial Public Class _Default
    Inherits System.Web.UI.Page
    Dim rptGuestbook As Repeater
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
    & Server.MapPath("guestbook.mdb") & ";"
    Dim MySQL As String = "SELECT Name, EMail, URL, Comment FROM Guestbook"
    Dim MyConn As New OleDb.OleDbConnection(strConn)
    Dim Cmd As New OleDb.OleDbCommand(MySQL, MyConn)
    MyConn.Open()
    rptGuestbook.DataSource = _
    Cmd.ExecuteReader(System.Data.CommandBehavior.Clos eConnection)
    rptGuestbook.DataBind()

    End Sub

    Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
    & Server.MapPath("guestbook.mdb") & ";"
    Dim MySQL As String = "INSERT INTO Guestbook " & _
    "(Name, EMail, URL, Comment) VALUES " & _
    "('" & TextBox1.Text & "','" & TextBox2.Text & "','" _
    & TextBox3.Text & "','" & TextBox4.Text & "')"
    Dim MyConn As New OleDb.OleDbConnection(strConn)
    Dim cmd As New OleDb.OleDbCommand(MySQL, MyConn)
    MyConn.Open()
    cmd.ExecuteNonQuery()
    MyConn.Close()
    Response.Redirect("guestlog.aspx")
    End Sub



    Più precisamente l'errore me lo da qua:
    <%@ Page Language="Vb" %>
    <%@ Import Namespace="System.Data.OleDb" %>


    Mi sapreste spiegare xkè non va bene questo carattere % ??
    Grazie mille!

  2. #2
    Moderatore di ASP.net L'avatar di djciko
    Registrato dal
    Nov 2002
    Messaggi
    6,887
    la parte dove ti da errore dovrebbe stare nel file 'aspx'

  3. #3
    Ah...ops! Ho capito! Beh si vede proprio che sono all'inizio!
    Va bene! Grazie mille!

    Ciao!

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.