Retrieve data in MySQL and display it in calendar

2019-09-02 21:08发布

I am targeting to create a Scheduling System in VB.Net and I am using Calendar Control, before I will ask my question, Let me explain to you first what scenario I would like to happen.

I have a form in VB.Net and it looks like this.

enter image description here

and here is my database

enter image description here

and fields of the table above are.

RefID
PersonName
DateSchedule (DateField)

Now here is my question. How can I display those data in my Calendar Control? like this (Example)

enter image description here

How can I achieve this kind of output? Regardless of how many data I will input it will Group the Data by Date and display it in the Calendar.

Lets say I will input data in Jun 6 so the calendar will Display Data from Jun 4 and 6.

1条回答
乱世女痞
2楼-- · 2019-09-02 21:52

Hope you need not grouping the data. Apply where clause and fetch all the data and based on the result, you can load the data into the calendar control

SELECT @TestDate := '2016-06-06';

SELECT PersonName, DateSchedule
FROM TestingTable
WHERE DATE(DateSchedule) <= DATE(@TestDate)

SQL Fiddle: http://sqlfiddle.com/#!9/28fbd/7

查看更多
登录 后发表回答