ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

any VB programmers fancy giving me a wee hand?



  Monaco 172
PM me if your interested, i think its pretty simply for a uni project but i cant figure it out..

cheers
 
  LY R26 230 F1 Team
wats the project mate pmp me i got some code from uni. also google vb forums they help you out loads!
literally copy paste code into your work!
 
  Monaco 172
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!
 


Top