473,608 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error load meeting and time to datagridview

5 New Member
I have 2 table on api data: Booking{ Id, Status, Sort, CreatedDate,Upd atedAt, Title, ParticipatingLe aders, Content, UserCreatedName , UserCreatedEmai l, UserCreatedPhon eNumber, DepartmentId, Start, Stop, LocationId, Request,RoomId, Date, CancelAt, SuccessAt,HostU ser, LocationName, RoomName }

Room{ Id, Status, Sort, CreatedDate, CreatedAt, UpdatedAt, UpdatedBy, CodeNaame, Name, LocationId, Volumn, Items, Images }

After booking and save the meeting room, the data will be submitted to the Booking table. on form i create datagridview to view

meeting schedule and meeting room get the list of rooms in the Room api table and add new hour columns

add a new column that is the time and get the data to browse the Booking table to compare the start time and end time of the meeting

like code and picture. convert columns header is hour to compare and get the time range and load the color to know which room is meeting at which time

in the load event call the function: selectAreaColor () then got an error, but the load function does not call and book the room,

it can run and get the results as shown, but when starting to run and the load function calls, the error hope everyone can help, thanks a lot.

when adding new run debug, it browses from column header at 08:00 to the end of column and booking table data runs ok and the load event, it browses the data from the booking table to the columns on the datagridview, so it crashes


here is the code to get the display area of meeting time and meeting schedule

private void selectAreaColor ()

{

string starttime ;

string stoptime ;

string selectedRoom ;

string selectedId ;

QueryRQ query = CreateQuery();

BookingIndexRS result = apiBooking.getB ooking(query).R esult;

foreach (BookingDetail r in result.Data)

{

string idLocal = r.Id.ToString() ;

selectedId = idLocal + "";

string idroom = r.RoomId.ToStri ng();

selectedRoom = idroom + "";

string start = r.Start.ToStrin g();

starttime = start;

string stop = r.Stop.ToString ();

stoptime = stop;

string getDate =(r.Date.ToStri ng());

// Get the start time and end time inputs and the selected meeting room

DateTime startTime = DateTime.ParseE xact(starttime, "HH:mm", null);

DateTime stopTime = DateTime.ParseE xact(stoptime, "HH:mm", null);

foreach (DataGridViewRo w row in grdRoom.Rows)

{

if (row.Cells["Id"].Value.ToString () == selectedRoom)

{

int rowIndex = row.Index;

// Loop through the columns and compare the start and end times with the time slots

for (int i = 1; i < grdRoom.Columns .Count; i++)

{

DateTime columnTime = DateTime.ParseE xact(grdRoom.Co lumns[i].HeaderText, "HH:mm", CultureInfo.Inv ariantCulture);//event load here error

string _HeaderText = grdRoom.Columns[i].Name.ToString( );

if (startTime == columnTime)//|| endTime == columnTime

{

grdRoom.Rows[rowIndex].Cells[_HeaderText].Style.BackColo r = Color.Blue;

if (startTime == stopTime)

return;

else

startTime = startTime.AddMi nutes(30);

}

}

}

}

}

}
Mar 8 '23 #1
0 1145

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3989
by: Dave Smithz | last post by:
Hi, My PHP application for a client uses the publicly available "PHPMailer - PHP email class" which is very good. However, my client recently complained about the following error when sending out over 4000 emails. (Note that each email is customised so needs to be sent individually - not using Bcc). The application reported to have sent the 4000 emails successfully (it sends each one as part of a loop and then when completed gives a...
4
5266
by: Gary Davis | last post by:
Once a day or so, I receive an error on a fairly active website that calls this StrMixed.cs method constructor. 99% of the time there is no exception: System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.InvalidOperationException: Hashtable insert failed. Load factor too high. at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
1
2152
by: Mark | last post by:
I have .aspx code-behinds that inherit from the class below. The code runs just fine, but the form designer bombs at design time when trying to view the .aspx page in VS.NET 2003. If I comment out the single line of code below, then there is no error. I posted the error message below - it implies that this code is being run at design time, but it bombs due to the fact that it isn't run time. Is there a line of code I could add to only...
1
1596
by: Manuel Canas | last post by:
Hello there, I am using the VB.NET Standart Edition compiler and I would like to know if this is not supported on this edition. This is just a testing code from a book that I'm trying here and it builds with no problem, but when I run it I get and error. This is the code snipet;
2
6683
by: Henry J. | last post by:
When the user loads the data into a DataGridView, some error icons may be shown to indicate some errors like when uniqueness is violated. The user can go ahead modifying the data rows. Once the violation is fixed, I like to clear the error icons, but I could not do so. Any tips? Thanks a lot!
0
1369
by: mfareezaw | last post by:
dears i need an axample how to get time and how to load numbers from file in the disk i found this in the help but it is not printing #include <stdio.h> #include <dos.h> int main(void)
1
1733
by: Adam Porter | last post by:
First off, I've placed my very first webservice on the web and can access the .asmx file through my browser. Now, as I'm writing my Client App, I want to call these services. I'm getting a strange error at Compile-Time on all of my WebService calls. Here's some basic information. Have you seen anything like this before...and/or know how to fix it ? Declaring an Instance of the WebService:
10
3873
by: pooja8389 | last post by:
In this program there is error in processing time of last process..plz check the error... the program is as #include<stdio.h> #include<conio.h> void main() { float avgwt,avgtt; char pname,c; int wt,tt,bt,at,t,q,i,n,sum=0,sbt=0,ttime,j,ss=0; clrscr();
3
3727
by: agarwalsunitadhn | last post by:
Hi I have a problem that whenever i fetch a large amount of data from database then it shows the following error with a part of result: Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\fps\report7.php on line 95. and refreshing that page . we got the complete data. If you have any suggestion that how to fetch complete data at a time then please .. thanks
0
8067
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6820
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4030
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2477
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1336
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.