-
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.SetConnection() 'Set Database Connection
-
-
'PHASE 1 | CHECK ROOM SCHEDULES
-
Command = New OleDbCommand("Select * From LoadSchedules Where Rooms.Title='" & Room & _
-
"' And Not Rooms.Title='Field' And Semester='" & Semester & "' And DayID='" _
-
& DayID & "'", dbConnection)
-
Command.CommandType = CommandType.Text
-
Data = Command.ExecuteReader
-
-
If (Data("TimeStarted") >= NewTimeStarted) And (Data("TimeStarted") < NewTimeFinished) Then
-
Conflict = True
-
'MsgBox "1 | Conflict sa 1st day. May nakaschedule na sa room na ito."
-
ShowConflict(Data("SectionUnit"), _
-
Data("Rooms.Title"), Data("DayID"), _
-
Data!TimeStarted, Data!TimeFinished)
-
Exit Function
-
End If
-
-
Data.Close()
-
End Function
The bold text says "No data exists for the row/column" Please help :'(
Rey Sean
2 1308
You need to make sure you reader is actually pulling data.
Sounds like its not which means either your query is not right, or the database doesn't have the data you are expecting it to have. -
-
If Data.Read then
-
'your data is there
-
else
-
'your data is not there
-
end if
-
-
You need to make sure you reader is actually pulling data.
Sounds like its not which means either your query is not right, or the database doesn't have the data you are expecting it to have. -
-
If Data.Read then
-
'your data is there
-
else
-
'your data is not there
-
end if
-
-
You are a little bit right. I've change the query - [color=#222222]
- [font='Courier New',Courier,monospace]Private Data As OleDbDataReader[/font]
-
- [font='Courier New',Courier,monospace]Private Command As New OleDbCommand[/font]
-
- [font='Courier New',Courier,monospace] [/font]
-
- [font='Courier New',Courier,monospace]Friend Function Conflict(ByVal DayID As String, ByVal Room As String, ByVal _[/font]
-
- [font='Courier New',Courier,monospace] NewTimeStarted As Date, ByVal NewTimeFinished As Date, ByVal SectionUnit As String, _[/font]
-
- [font='Courier New',Courier,monospace] ByVal Semester As String) As Boolean[/font]
-
- [font='Courier New',Courier,monospace] 'Dim SectionUnit As String[/font]
-
- [font='Courier New',Courier,monospace] 'SectionUnit = Course & " " & Section[/font]
-
- [font='Courier New',Courier,monospace] 'Conflict = False 'Default Value[/font]
-
- [font='Courier New',Courier,monospace] [/font]
-
- [font='Courier New',Courier,monospace] [/font]
-
- [font='Courier New',Courier,monospace] Main.SetConnection() 'Set Database Connection[/font]
-
- [font='Courier New',Courier,monospace] 'PHASE 1 | CHECK ROOM SCHEDULES[/font]
-
- [font='Courier New',Courier,monospace] Command = New OleDbCommand("Select * From LoadSchedules Where Rooms.Title='" & Room & _[/font]
-
- [font='Courier New',Courier,monospace] "' And Not Rooms.Title='Field' And Semester='" & Semester & "' And DayID='" _[/font]
-
- [font='Courier New',Courier,monospace] & DayID & "'", dbConnection)[/font]
-
- [font='Courier New',Courier,monospace] Command.CommandType = CommandType.Text[/font]
-
- [font='Courier New',Courier,monospace] Data = Command.ExecuteReader[/font]
-
- [font='Courier New',Courier,monospace] [/font]
-
- [font='Courier New',Courier,monospace] If Data.Read Then[/font]
-
- [font='Courier New',Courier,monospace] Conflict = True[/font]
-
- [font='Courier New',Courier,monospace] 'MsgBox "1 | Conflict sa 1st day. May nakaschedule na sa room na ito."[/font]
-
- [font='Courier New',Courier,monospace] ShowConflict(Data("SectionUnit"), _[/font]
-
- [font='Courier New',Courier,monospace] Data("Rooms.Title"), Data("DayID"), _[/font]
-
- [font='Courier New',Courier,monospace] Data!TimeStarted, Data!TimeFinished)[/font]
-
- [font='Courier New',Courier,monospace] Exit Function[/font]
-
- Else
-
- Conflict = False
-
- [font='Courier New',Courier,monospace] End If[/font]
-
- [font='Courier New',Courier,monospace] [/font]
-
- [font='Courier New',Courier,monospace] Data.Close()[/font]
-
- [font='Courier New',Courier,monospace]End Function[/font]
-
[/color]
Thanks : )
Rey Sean
Sign in to post your reply or Sign up for a free account.
Similar topics
by: LJ |
last post by:
I have been getting this message and can't resolve the problem. I have
checked the AntiVirus software and added the application directory to
the exculsion list. The application is on a web farm,...
|
by: Tony |
last post by:
Dear All,
When I run an example program on the
http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/data/datagrid1.src&file=VB\datagrid1.aspx&font=3
...
|
by: Curious |
last post by:
Hi,
I am trying to use the following code to send data over a Message
Queue. The following error is being given:
"An unhandled exception of type 'System.InvalidOperationException'
occurred in...
|
by: vijayalakshmi.venkataraman |
last post by:
Hello,
I have a .NET client that accesses a Java webservice.
Let me first say that the client stub I got generated from the wsdl was
incomplete and had to make changes to it manually to make it...
|
by: Sharon |
last post by:
I have a DataGrid control on a Form. The data of the control is added by
another application by Remoting.
It means that a worker thread is invoking a UI thread. Therefore I used a
delegate in the...
|
by: banduraj |
last post by:
I get an System.InvalidOperationException when trying to Serialize a
struct that has a type refrenced from another library.
The exception is:
System.InvalidOperationException was unhandled...
|
by: snowie |
last post by:
I have a simillar problem to what others have had before me. I just can't find the solution in any earlier post here at the scripts (or any other forum).
I am calling a web service that returns a...
|
by: Joseph Geretz |
last post by:
System.InvalidOperationException: WebServiceBindingAttribute is required on
proxy classes.
My environment: Visual Studio 2005, targeting FX 2.0; I've developed a Web
Service which uses DIME to...
|
by: John H |
last post by:
Hi,
Strange error with serialisaation on .net 1.1 Sp1 when a the assembly
containing the type is in the Gac as well as on e.g c:\customdlls.
ObjValue in below code is populated with and array of...
|
by: Tenowg |
last post by:
Hey everyone... Firstly let me tell you this is a project that is probably alittle over my head... I have played with programming most of my life, but I have only been doing VB 2005 for about 2...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |