Ver Mensaje Individual
  #6 (permalink)  
Antiguo 10/01/2005, 14:19
Avatar de univercity
univercity
 
Fecha de Ingreso: noviembre-2002
Mensajes: 681
Antigüedad: 22 años, 3 meses
Puntos: 0
si los codebehind, estan puestos...

<%@ Import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>


ahora el codigo compelto quedo ahroa así...

<%@ Import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<html>
<head>


</head>

<script language="VB" runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)
Dim strConexion As String
Dim DS As DataSet
Dim MyConnection As OleDbConnection
Dim MyOledbCommand As OleDbDataAdapter
strConexion = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("../bdwine/clientes.mdb")
MyConnection = New OleDbConnection(strConexion)
MyOledbCommand = New OleDbDataAdapter("select top 1 * from tabla1 ", MyConnection)

MyConnection.Open()
dim dr as OleDbDataReader = new OleDbDataReader()
dr = MyCommand.ExecuteReader()


'Dim dr As OleDbDataReader = MyOledbCommand.ExecuteReader()

MyDataGrid.DataSource = dr
MyDataGrid.DataBind()

MyConnection.Close()

End Sub

</script>


y me genera este error...


Compiler Error Message: BC30390: 'System.Data.OleDb.OleDbDataReader.Private Sub New(connection As System.Data.OleDb.OleDbConnection, command As System.Data.OleDb.OleDbCommand, depth As Integer, chapter As System.IntPtr)' is not accessible in this context because it is 'Private'.

Source Error:



Line 19:
Line 20: MyConnection.Open()
Line 21: dim dr as OleDbDataReader = new OleDbDataReader()
Line 22: dr = MyCommand.ExecuteReader()
Line 23:

error en linea 21
__________________
"Lo importante es nunca dejar de hacerse preguntas"
Albert Einstein