// Button 'Today' in the room section // Display room reservations for today private void buttonDisplayRoomDay_Click(object sender, EventArgs e) { // Find date for today DateTime today = DateTime.Today; // Fetch dataset DataSet roomreservationDS = DBGetData.GetRoomBookingDGVSpesificDate(today); if (roomreservationDS != null) { // No tables fetched if (roomreservationDS.Tables.Count == 0) { new StatusMessage("No datatable found, contact administrator."); return; } // No rows fetched else if (roomreservationDS.Tables[0].Rows.Count == 0) { new StatusMessage("No datarows found for today."); return; } // Clear labelStatus for previous messages else { new StatusMessage(""); } // Set the dataset as source for datagridview and make sure its displayed dataGridViewRoom.DataSource = roomreservationDS; dataGridViewRoom.DataMember = "Get_RR_SpesificDate"; LoadDataGridViewRoom(); } }