[CODE=vb .net]
Private Data As OleDbDataReader
Private Command As New OleDbCommand
Friend Function Conflict(ByVal DayID As String, ByVal Room As String, ByVal _
NewTimeStarted As Date, ByVal NewTimeFinished As Date, ByVal SectionUnit As String, _
ByVal Semester As String) As Boolean
'Dim SectionUnit As String
'SectionUnit = Course & " " & Section
'Conflict = False 'Default Value
Main.SetConnect ion() 'Set Database Connection
'PHASE 1 | CHECK ROOM SCHEDULES
Command = New OleDbCommand("S elect * From LoadSchedules Where Rooms.Title='" & Room & _
"' And Not Rooms.Title='Fi eld' And Semester='" & Semester & "' And DayID='" _
& DayID & "'", dbConnection)
Command.Command Type = CommandType.Tex t
Data = Command.Execute Reader
If (Data("TimeStar ted") >= NewTimeStarted) And (Data("TimeStar ted") < NewTimeFinished ) Then
Conflict = True
'MsgBox "1 | Conflict sa 1st day. May nakaschedule na sa room na ito."
ShowConflict(Da ta("SectionUnit "), _
Data("Rooms.Tit le"), Data("DayID"), _
Data!TimeStarte d, Data!TimeFinish ed)
Exit Function
End If
Data.Close()
End Function[/CODE]
The bold text says "No data exists for the row/column" Please help :'(
Rey Sean
Private Data As OleDbDataReader
Private Command As New OleDbCommand
Friend Function Conflict(ByVal DayID As String, ByVal Room As String, ByVal _
NewTimeStarted As Date, ByVal NewTimeFinished As Date, ByVal SectionUnit As String, _
ByVal Semester As String) As Boolean
'Dim SectionUnit As String
'SectionUnit = Course & " " & Section
'Conflict = False 'Default Value
Main.SetConnect ion() 'Set Database Connection
'PHASE 1 | CHECK ROOM SCHEDULES
Command = New OleDbCommand("S elect * From LoadSchedules Where Rooms.Title='" & Room & _
"' And Not Rooms.Title='Fi eld' And Semester='" & Semester & "' And DayID='" _
& DayID & "'", dbConnection)
Command.Command Type = CommandType.Tex t
Data = Command.Execute Reader
If (Data("TimeStar ted") >= NewTimeStarted) And (Data("TimeStar ted") < NewTimeFinished ) Then
Conflict = True
'MsgBox "1 | Conflict sa 1st day. May nakaschedule na sa room na ito."
ShowConflict(Da ta("SectionUnit "), _
Data("Rooms.Tit le"), Data("DayID"), _
Data!TimeStarte d, Data!TimeFinish ed)
Exit Function
End If
Data.Close()
End Function[/CODE]
The bold text says "No data exists for the row/column" Please help :'(
Rey Sean
Comment