Looks like u are not adding the table rows to the table control ...
Anyways, I would bind the data to a control such as the Repeater, DataList, or DataGrid.
: Hi, I created a page to populate data from an Access database. Everything looks fine except the page is blank. What am I missing? See the code below. default.aspx.vb
:
: Imports System.Data.OleDb
: Partial Class _Default
: Inherits System.Web.UI.Page
:
: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
: Dim strconnection As String
: Dim cn As New OleDbConnection
: strconnection = "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("app_data\forms.mdb")
: cn.ConnectionString = strconnection
: cn.Open()
: Dim cm As New OleDbCommand
: cm.CommandText = "select * from forms"
: cm.CommandType = Data.CommandType.Text
: cm.Connection = cn
: Dim dr As OleDbDataReader
: dr = cm.ExecuteReader
: While dr.Read
: Dim trrow As New HtmlTableRow
: Dim tddata As HtmlTableCell
: tddata = New HtmlTableCell
: tddata.InnerHtml = dr("form_path").ToString
: trrow.Cells.Add(tddata)
: tddata = New HtmlTableCell
: tddata.InnerHtml = dr("form_name").ToString
: trrow.Cells.Add(tddata)
: tddata = New HtmlTableCell
: tddata.InnerHtml = dr("Form_wordpath").ToString
: trrow.Cells.Add(tddata)
:
:
: End While
: cn.Close()
: End Sub
: End Class
:
: How come when I run the code, it opens a blank page? Do I need any control in the default.aspx page? Thanks for your help in advance!
:
:
: