473,287 Members | 1,659 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Calendar Help

Hi all. I'm populating using a dataset to highlight dates in a calendar
control. The code i'm using is:

if (!e.Day.IsOtherMonth)
{
foreach (DataRow dr in _ds.Tables[0].Rows)
{
if ((dr["startdate"].ToString() != DBNull.Value.ToString()))
{
DateTime dtEvent = (DateTime)dr["startdate"];
if (dtEvent.Equals(e.Day.Date))
{
e.Cell.BackColor = System.Drawing.Color.PaleVioletRed;
e.Cell.ID = dr["idcourse"].ToString();
}
}
}
}

The dates are coloured in correctly, but the programmatically set ID
seems to always contain "Cal" regardless of what I put into it. What am
i doing wrong? I could use the selected date to find the records
holding the coloured date, but I'm curious as to why the ID function is
not working.
Also, at the moment I am pulling all the records out of the database,
would it be more efficient to only pull out the dates of the month
currently displayed on the calendar?

paul

May 18 '06 #1
0 830

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: cg_news | last post by:
In short, what I am trying to do is, based on a date, calculate the week of year (as described in ISO 8601), then calculate the first and last date in this week period and return them in the format...
0
by: GFro | last post by:
I have a calendar page that returns a date to a textbox on the parent page. It is returning the wrong format on the deployment server. On the development server the calendar returns to textbox in...
3
by: Peter | last post by:
Is there anyway to make the System.Web.UI.WebControls.Calendar to display only Month Name and Year, like: January, 2006 February, 2006 ..... .... .... ....
6
by: Mike9900 | last post by:
Hello, I want to view the calendar in another culture, for example let it show in Arabic. I use this code in the Main, but the calendar is still in the same culture: CultureInfo sa = new...
3
by: brianwolters | last post by:
Hello, I have a calendar and a textbox right below it on my webpage. I need help with creating some code to display information about the date the user clicked in the text box below it. For...
12
cassbiz
by: cassbiz | last post by:
I downloaded this calendar off the web and am trying have it show twice, once as calendar.php and the second time as calendar1.php I need the visitor to be able to select a beginning date and an...
3
by: thorpk | last post by:
I posted this problem earlier in the month and some one decided it was better to change the subject and ask a completely different question. I am therefore reposting. I am hoping some one can...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
4
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters...
7
by: William (Tamarside) | last post by:
Please, if you have the time and knowledge to help me I'd truly appreciate it! I need to build a calendar page that displays available/unavailable info from a DB and colour a cell according to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.