Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/05/2004, 02:57
toral
 
Fecha de Ingreso: abril-2004
Ubicación: Murcia
Mensajes: 65
Antigüedad: 20 años
Puntos: 0
Separar VB de HTML...

Hola a todos/as, veris tengo un problemilla a la hora de separar el codigo de programacion, y acceso en a datos que esta en VB, del de html me da un error:

Error de servidor en la aplicación '/'.
--------------------------------------------------------------------------------

Error de compilación
Descripción: Error durante la compilación de un recurso requerido para dar servicio a esta solicitud. Revise los detalles de error específicos siguientes y modifique el código fuente en consecuencia.

Mensaje de error del compilador: BC30188: Se esperaba una declaración.

Error de código fuente:

Línea 1: Impots System
Línea 2: Impots System.Collections
Línea 3: Impots System.Web.UI
...

y este es el codigo:

HTML:


<%@ Page Language="VB" Inherits="grupos" Src="grupos.vb" %>
<HTML>
<HEAD>
<title>GRUPOS</title>

</HEAD>
<body bgColor="#ffffcc">

....................

VB:

Impots System
Impots System.Collections
Impots System.Web.UI
Impots System.Web.UI.WebControls
Public Class grupos
Inherits System.Web.UI.Page
Import Namespace="System.Data"
Import Namespace="System.Data.OleDb"

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents ListBox1 As System.Web.UI.WebControls.ListBox
Protected WithEvents Button3 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button4 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button5 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button6 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button7 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button8 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button9 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button10 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button11 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button12 As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents Button13 As System.Web.UI.HtmlControls.HtmlInputButton


Sub Page_Load(obj As object, e As eventargs)

Dim objConn As New OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("avisos.mdb"))

Dim objCmd As New OleDbCommand ("SELECT * FROM GRUPO;", objConn)

Dim objReader As OleDbDataReader

objConn.Open

objReader = objCmd.ExecuteReader
ListBox1.datasource = objReader
ListBox1.DataTextField = "Descripcion"
ListBox1.DataValueField = "Id"
ListBox1.DataBind()

objConn.Close

End sub

Un saludo y gracias a quien pueda ayudar.
__________________
A caballo regalado...........quitale el envoltorio.