Holidays: Calendar Control - Course ASP.NET 4 and Visual Studio 2010 - Lesson 21 | DevMedia .net courses
In this video we discuss the Calendar control in more detail. Specifically, we are going to retrieve some events (holidays) from the database and render those specific events differently on the calendar.
"
Duration: 21 minutes
Summary: In this video we discuss the Calendar control in more detail.
Specifically, we are going to retrieve some events (holidays) from the database
and render those specific events differently on the calendar. We start by
creating a database TestASPNET that we are going to use in this and upcoming
videos. We create one table named Holidays that contains the holidays’ dates
and their descriptions. Once we are done with that, we modify the page to read
the data from the Holidays table using ADO.NET. We read the data and put it in
2 generic lists (one for the holiday and one for the description). We handle
the DayRender event and for every day rendered, we look to see if it matches
one of our holidays. If it does, we change the background color of the day, we
disable it selection, and make its tooltip the description we retrieved from
the database. We will discuss ADO.NET in more details in upcoming videos.
Methodology
of the development of example: Good coding standard
and simplified design to illustrate the key points.
Technology
Used: ASP.NET and Visual Studio 2010
Keyword: ASP.NET 4, Visual Studio 2010, SqlDataReader, SqlCommand,
SqlConnection, DayRender, IsSelectable, ToolTip, BackColor, List, dateTime.
Add a comment!
[Fechar]
Este post é fechado - você precisa ter acesso ao post para incluir um comentário.
Andy
2/26/2012 10:43am
Problem creating SQLConnection in asp.net Website
Hi,I was following this Calendar Control Holidays Tutorial and I came across one issue that doesn't let me create a SqlConnection. I added System.Data and System.Data.SqlClient namespaces at the top in using statement. That is happening only when I am creating the asp.net Website. When I started the asp.net Application, it is all working fine.
I know that I am missing some references in Website but when I tried adding references to System.Data and System.Data.SqlClient, it says that System.Data is already being added. I don't see any references for System.Data.SqlClient in the list of references.
What exactly I will have to do to make the SqlConnection to work on my asp.net website?
Answer it
Ayad
2/26/2012 2:24pm
RE:
Hi Andy,
Remember, there are two things here:
1- Adding the "using" statement at the top. This is only to avoid writing the full name "System.Data.SqlClient...."
But this does not add the reference. This is only to bring the namespace in and save typing.
2- Adding the reference: This is when you add the dll by right-clicking on the "references" in the web site and adding the dll you need.
Try this first: drop a grid on the page and follow the grid's wizard to add a data source. Then test the page. Is the grid working properly (are you able to display data)?
Answer it
Help us to improve! Give us your feedback: