Please help i would want to convert this code to ASP.Net
Pplease help
Public Function divisionedd52016()
'Set dbs = CurrentDb
Dim tp As New ADODB.Recordset
tp.Open("temp"), CurrentProject.Connection, adOpenStatic, adLockOptimistic
'Set trap = dbs.OpenRecordset("classnames")
'If tp!class = trap!class Then
If tp.EOF Then
Exit Function
Else
tp.MoveLast
tp.MoveFirst
Do Until tp.EOF
'tp.Edit
If tp!missed2 <> 0 Then
tp!totalgrades = tp!totalgrades + missed2 * 9
End If
If IsNull(tp!engrade) Then
tp!engscore = Null
tp!Division = "X"
tp!totalgrades = Null
End If
If IsNull(tp!engscore) Then
tp!engrade = Null
tp!Division = "X"
tp!totalgrades = Null
End If
If IsNull(tp!sstscore) Then
tp!sstgrade = Null
tp!Division = "X"
tp!totalgrades = Null
End If
If IsNull(tp!iregrade) Then
tp!ire = Null
tp!Division = "X"
tp!totalgrades = Null
End If
If IsNull(tp!ire) Then
tp!iregrade = Null
tp!Division = "X"
tp!totalgrades = Null
End If
'If IsNull(tp!engrade) Then
'tp!engrade = "9"
'End If
If tp!totalgrades = Null Then
tp!Division = "X"
End If
'If IsNull(tp!mathsgrade) Then
'tp!mathsgrade = "9"
'End If
If tp!missed2 <> 0 Then
tp!totalgrades = tp!totalgrades + missed2 * 9
End If
Select Case tp!totalgrades
Case 4 To 12
If (tp!engrade = 9 Or tp!mathsgrade = 9 Or iregrade = 9 Or tp!sstgrade = 9) Then
tp!Division = "2"
Else
tp!Division = "1"
End If
Case 13 To 24
If (tp!engrade = 9 Or tp!mathsgrade = 9 Or iregrade = 9 Or tp!sstgrade = 9) Then
tp!Division = "3"
Else
tp!Division = "2"
End If
Case 25 To 28
If (tp!engrade = 9 Or tp!mathsgrade = 9 Or iregrade = 9 Or tp!sstgrade = 9) Then
tp!Division = "4"
Else
tp!Division = "3"
End If
Case 29 To 34
If (tp!engrade = 9 Or tp!mathsgrade = 9 Or iregrade = 9 Or tp!sstgrade = 9) Then
tp!Division = "4"
Else
tp!Division = "4"
End If
Case 35 To 36
tp!Division = "U"
End Select
tp.Update
tp.MoveNext
Loop
End If
End Function