hi ill paste the code i have below...commented out bits are what i want to happen!
the database table looks like this:
Stu_Number Mod_code
101204 111111
101204 222222
101204 333333
so basically i want, 111111 in one textbox, 222222 in another and 333333 in another for any that have the same student number...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'i want this code upon page load to search the database table stu_module_exam, using a sessiong variable (but just hardcode 101204 in for now)
'so say as in the database theres one student against 3 modules, i want each module code corresponding to the
'student number into seperate text boxes, which are on the web page!
Dim connection1 As OleDbConnection
connection1 = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0 ;Data Source=E:\WebSite8\12STEPBase.accdb;")
connection1.Open()
Dim cmd As OleDbCommand
cmd = New OleDbCommand("select Stu_Mod_Module_Code_tbl from Stu_Module_Exam_tbl WHERE Stu_Mod_Stu_Number = '101204'", connection1)
Dim dr As OleDbDataReader
dr = cmd.ExecuteReader
While dr.Read()
TextBox1.Text = dr(0)
TextBox2.Text = dr(1)
TextBox3.Text = dr(2)
End While
dr.Close()
connection1.Close()
'These two calls, draw the module names and times into the appropriate labels.
'uncomment to see what i mean when you run the page
'Module1()
'Module2()
End Sub
Thanks!