Note that there are some explanatory texts on larger screens.

plurals
  1. POI need to use datagridview to book clinic appointment
    primarykey
    data
    text
    <p>i have a problem in my datagridview code. i need to use it to book an apointment . im able to add to database but my problem is in the retriving the data from database while im using a table to schedule the time of the doctors (Below is the code) . now i need to fill the cells from database from another table containing the patients name . i can't do it . im thinking alot but i couldnt do it </p> <pre><code>Private Sub Appointment_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AppSlot.RowTemplate.Height = 65 Call AccessConnection() ' below code is to retrive the time of each doctor SqlQuery = "select * from DTest" comnd = New OleDbCommand(SqlQuery, Conn) Dim dr As OleDbDataReader Dim starttime As New DateTime Dim endtime As New DateTime Dim duration As New TimeSpan Dim SlotDuration As Integer dr = comnd.ExecuteReader If dr.HasRows Then While dr.Read endtime = dr.Item("ToT") starttime = dr.Item("FromT") SlotDuration = dr.Item("Duration") End While duration = TimeValue(endtime) - TimeValue(starttime) Dim Dur As Integer = duration.Hours Dur = (Dur * 60) / SlotDuration For i As Integer = 0 To Dur - 1 Me.AppSlot.Rows.Add(starttime.ToString("hh:mm")) starttime = starttime.AddMinutes(SlotDuration) Next ' below code is to set the coulmn header which i add it manually AppSlot.Columns(1).HeaderText = Today.ToString("dddd dd/MM/yyyy") AppSlot.Columns(2).HeaderText = Today.AddDays(1).ToString("dddd dd/MM/yyyy") AppSlot.Columns(3).HeaderText = Today.AddDays(2).ToString("dddd dd/MM/yyyy") AppSlot.Columns(4).HeaderText = Today.AddDays(3).ToString("dddd dd/MM/yyyy") AppSlot.Columns(5).HeaderText = Today.AddDays(4).ToString("dddd dd/MM/yyyy") AppSlot.Columns(6).HeaderText = Today.AddDays(5).ToString("dddd dd/MM/yyyy") AppSlot.Columns(7).HeaderText = Today.AddDays(6).ToString("dddd dd/MM/yyyy") AppSlot.Columns(0).Width = 40 AppSlot.Columns(0).DefaultCellStyle.BackColor = Drawing.Color.AliceBlue Dim fon As Font fon = New Font(AppSlot.Font, FontStyle.Bold) AppSlot.Columns(0).DefaultCellStyle.Font = fon End If End Sub </code></pre> <p>the first query in the above code is getting the time schedule for the doctors i dont know how to do another query from the patient appointment table and fill the cells for the booked appointment and leave the free cells blank.</p> <p>For example, below is the table which contain the schedule of doctor 1. </p> <pre><code>ID FromT ToT Duration Doctor 1 9:00 11:00 20 1 </code></pre> <p>So, now the first query will add rows in the datagridview according the time in the above table.</p> <p>Grid view is showing as below . now i couldn't fill the free cell from database</p> <pre><code>Time Sat Sun Mon Tue Wed Thu Fri </code></pre> <p>9:00<br> 9:20<br> 9:40<br> 10:00<br> 10:20<br> 10:40 </p> <p>i hope i gave you a clear idea about what i need</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload