i have medical database with some tables one of these tables is calendar table it has the fielsd as:
date
day name
day no of the week
flag // this flag indecate if this date is friday or holiday
the user enter the year to create the 12 months OR enter the month to create only the entred month
any idea
thanks
O. Abuzaid
how can i create calendar progrmmicly in c#

Sam HobbsPosted Mar 23, 2024, 7:19 PM
The day name, day number and the determinmation of the day being Friday can all be calculated. The holiday depends on your country of course and the doctor's office might decide that some days are holidays and some are not. Therefore I think it is good to have a table of holidays for the doctor's office.
You do not specify what else the calendar would be used for. For example, would the calendar be used to create appointments?
One possibility would be to use julian days. They begin at 1 for the first day of the year and go to 365 (or 366) for the last day of the year. The month and day and everything else can be calculated from the julian day. Based on the information you provided, the only thing you need is a table that lists the holidays and nothing else. If there are other requiremetns then you need to be specific.
Prasad RaveendranPosted Mar 23, 2024, 1:40 AM
check whether this code helps
In this code:
"your_connection_string_here"with your actual SQL Server connection string."YourCalendarTable"with the name of your calendar table in the database.This code will create the calendar for the specified year or month, inserting the relevant information into your database table.