Making a datatable accessible from all subs in class

whitespire

Member
Joined
Nov 13, 2004
Messages
7
Programming Experience
Beginner
I love the way that the vb forum is php driven!!

Hi all,

I am currently writing a site for my school. I am trying to do a gallery for all the pics and sort them by category etc.

When a user selects a category, I want an in memory datatable to be built with all the names of the files for that category.

I have this so far:

PHP:
Imports System.IO
Imports System.Data
Partial Class gallery_view
Inherits System.Web.UI.Page
' Make the current position as 0
Public position As Integer = 0
Public dt As DataTable ' the datatable
Public tableMax As Integer = 0 ' count of rows
Dim fileLocation1 As String = "/stock/thumb/" ' location of thumbs
Dim fileLocation2 As String = "/stock/" ' location of photos
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack Then
' This page has been posted back
Else
' build the table 
buildTable(DropDownList1.SelectedValue.ToString)
' Fill the image boxes
redraw()
End If
End Sub
 
the buildtable quite happily builds the table called dt. When redraw tries to call it, it is null. Sm I declaring it wrong?
 
Back
Top