if you are having a table with the following fields
LID varchar(50)
date datetime
write stored procedure as following
-
CREATE PROCEDURE DISPLAYSCHEDULE
-
@LID varchar(50)
-
-
AS
-
select date from PSSDocShed
-
where LID=@LID
-
here PSSDocShed is the table name and DISPLAYSCHEDULE is the stored procedure name
in Bussiness class you need to write the following
-
public static DataTable displayschedule(string id)
-
{
-
-
DbCommand cmd = GenericData.CreateCommand();
-
cmd.CommandText = "DISPLAYSCHEDULE";
-
cmd.Parameters.Add(new SqlParameter("@LID", id));
-
return GenericData.ExecuteReader(cmd);
-
-
}
-
now come to our calender page click event DayRender
and type the following
-
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
-
{
-
string id = Request.Cookies["PSSuid"].Value;
-
DataTable tb = businessclass.displayschedule(id);
-
for (int i = 0; i < tb.Rows.Count; i++)
-
{
-
-
if (e.Day.Date == Convert.ToDateTime(tb.Rows[i][0]))
-
{
-
e.Cell.BackColor = System.Drawing.Color.Pink;
-
-
}
-
-
}
-
-
-
-
-
}
-
this will result in
change the background color of the selected dates from database
and other dates remains as such
Hope this will help you
if you are using stored procedures and Three -tier architecture