Hi, im trying to get the "aObject" into the"aVar" variable so that it can then be put into a label but I am unsure of how to do this. I cant get the data from the "calculationSub" into the "aVar" variable. I'm pretty new to vb, can anyone help?




Imports System.Data.SqlClient
Imports System.Data

Partial Class CIT_Project_pages_Default
Inherits System.Web.UI.Page

'Declaring variable
Dim aVar As String

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

aLabel.Text = aVar

End Sub

Private Sub calculationSub(ByVal dataSet As DataSet)

'Create datatable from module
Dim aTable As DataTable
aTable = dataSet.Tables("module")


'Computing the average of the column "grades" from the datatable
Dim aObject As Object
aObject = aTable.Compute("Avg(grades)", "module_ID = 2031")

'changing the aObject into a string so that it can be displayed within a label
aVar = CType(minObject, String)


End Sub


End Class