Datasets and Calendar binding
-
I need some help with Datasets. I have an asp page with a calendar control. On the calendar I want to display the total time that a project was worked on for a particular day. This information is held in: Db.project.ttime So this is the select statement that I have formed: Select Project.ttime, Project.Date From Projects where Uid = @Uid Since it is a big table I only want to hit the Db once per session, or if on another page new information is entered. I’ve been on msdn but all I’m getting is more confused. I can’t figure out where to put what code so that a DataSet is only loaded once. I think is should go in the page load event but then how does the Calendar1_DayRender(. . .) Give what day it is currently rendering to the dataset so that the right info is returned. Then I thought I should load the DataSet in the Calendar1_DayRender(. . .) But then I’m hitting the Db every day on the calendar. Please point me in the right direction. I’m almost temped to just go back to vbscript where the Record set at least worked for me. Thank you, Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
-
I need some help with Datasets. I have an asp page with a calendar control. On the calendar I want to display the total time that a project was worked on for a particular day. This information is held in: Db.project.ttime So this is the select statement that I have formed: Select Project.ttime, Project.Date From Projects where Uid = @Uid Since it is a big table I only want to hit the Db once per session, or if on another page new information is entered. I’ve been on msdn but all I’m getting is more confused. I can’t figure out where to put what code so that a DataSet is only loaded once. I think is should go in the page load event but then how does the Calendar1_DayRender(. . .) Give what day it is currently rendering to the dataset so that the right info is returned. Then I thought I should load the DataSet in the Calendar1_DayRender(. . .) But then I’m hitting the Db every day on the calendar. Please point me in the right direction. I’m almost temped to just go back to vbscript where the Record set at least worked for me. Thank you, Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Hi there, To fill data in the DataSet only once per session, you can provide your sample code in the handler of the
Session_Start
event in the Global.asax[^] file as this event is basically raised when a new session is created. Since the Calendar control does not support data binding, so you can provide an event handler for the DayRender[^] event of the Calendar control and modify the content of each day cell. -
Hi there, To fill data in the DataSet only once per session, you can provide your sample code in the handler of the
Session_Start
event in the Global.asax[^] file as this event is basically raised when a new session is created. Since the Calendar control does not support data binding, so you can provide an event handler for the DayRender[^] event of the Calendar control and modify the content of each day cell.OK so I should load the Dataset in the Sessioin_Start. That makes sense. I’m still unclear how to get the information out of the DataSet once I’m in my DayRender event. Also How can I reload the DataSet, when needed, with fresh data from the Db. Does any one know of a place where I can look at some code. I get the Theory But I'm having a hard time figuring out how to go from the Theoretical to the practical. Thanks, Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net