Private sub timereffectick (byval sender as system. Object, byval e as system. eventargs) handles timer1.tick
Dim SQL as string
Dim dT as new datatable
Time2 = "11:14:00" ': Set the scheduled time in the 24-hour format and place it in the loading program.
Timer1.interval = 1000 'sets the timer to run once every second, which should be placed in the loading program
Timer1.enabled = true' the timer starts to run and should be placed in the loading program due to an accident
Time1 = timeofday () 'Get the current time
Rownum. Text = time1
If time1 = time2 then
Dim age
If agetext. Text = "" then
Age = 0
Else
Age = Val (agetext. Text)
End if
SQL = "select * from student where Sid = '" & xuehaotext. Text &"'"
Conn = connect_db ()
Rs = new sqldataadapter (SQL, Conn)
'Conn. Close ()
Rs. Fill (DT) 'Fill table
Datagridview1.datasource = DT ': displays the data in the table in the datagridview control and binds the data.
Datagridview1.columns (0). headertext = "student ID" 'sets the column name.
Datagridview1.columns (1). headertext = "name"
Datagridview1.columns (2). headertext = "Age"
Datagridview1.columns (3). headertext = "score"
Rownum. Text = STR (datagridview1.rowcount )'
Xuehaotext. Text = maid (0). cells (0). Value 'Get a value in the dview
Nametext. Text = maid (0). cells (1). Value
If (maid (0). cells (2). value = 0) then
Agetext. Text = ""
Else
Agetext. Text = STR (maid (0). cells (2). value)
End if
If (maid (0). cells (3). value = 0) then
Scoretext. Text = ""
Else
Scoretext. Text = STR (maid (0). cells (3). value)
End if
End if
End sub