I
Intikhab Bashir
Hi,
I have the code below and for some reason when I run it, nothing shows
in the front end.
I put in a label and that does not show a value either.
Both pages are below; viewAccess.aspx (html) and viewAccess.aspx.vb
(code).
Please help, thanks in advance.
----------------------------------------------------------------------------
in viewAccess.aspx.vb:
Imports System.Data
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents myDataReader As
System.Web.UI.WebControls.DataGrid
Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs)
Dim connString As String
connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
_
"c:\inetpub\wwwroot\test\db\nap.mdb;"
Dim objConn As OleDbConnection
objConn = New OleDbConnection(connString)
objConn.Open()
Dim strSQL As String
strSQL = "select id, name from personDetail"
Dim dbCommand As OleDbCommand
dbCommand = New OleDbCommand(strSQL, objConn)
Dim objReader As OleDbDataReader
objReader = dbCommand.ExecuteReader(CommandBehavior.CloseConnection)
myDataReader.DataSource() = objReader
objReader.Close()
Label1.Text = "hello"
End Sub
End Class
---------------------------------------------------------------------------
in viewAccess.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="viewAccess.aspx.vb" %>
<HTML>
<HEAD>
<title>Untitled</title>
</HEAD>
<body>
<aspataGrid ID="myDataReader" Runat="server"></aspataGrid>
<asp:Label id="Label1" runat="server"></asp:Label>
</body>
</HTML>
I have the code below and for some reason when I run it, nothing shows
in the front end.
I put in a label and that does not show a value either.
Both pages are below; viewAccess.aspx (html) and viewAccess.aspx.vb
(code).
Please help, thanks in advance.
----------------------------------------------------------------------------
in viewAccess.aspx.vb:
Imports System.Data
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents myDataReader As
System.Web.UI.WebControls.DataGrid
Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs)
Dim connString As String
connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
_
"c:\inetpub\wwwroot\test\db\nap.mdb;"
Dim objConn As OleDbConnection
objConn = New OleDbConnection(connString)
objConn.Open()
Dim strSQL As String
strSQL = "select id, name from personDetail"
Dim dbCommand As OleDbCommand
dbCommand = New OleDbCommand(strSQL, objConn)
Dim objReader As OleDbDataReader
objReader = dbCommand.ExecuteReader(CommandBehavior.CloseConnection)
myDataReader.DataSource() = objReader
objReader.Close()
Label1.Text = "hello"
End Sub
End Class
---------------------------------------------------------------------------
in viewAccess.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="viewAccess.aspx.vb" %>
<HTML>
<HEAD>
<title>Untitled</title>
</HEAD>
<body>
<aspataGrid ID="myDataReader" Runat="server"></aspataGrid>
<asp:Label id="Label1" runat="server"></asp:Label>
</body>
</HTML>