473,385 Members | 1,570 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,385 software developers and data experts.

how to bring data's in calendar control in asp.net 2.0 .

23
Hi, i dunno how to use calendar control . i need to bring data to the calendar on the respective date , whether calendar control will work both server side and client side. coz if i disable the javascript in mozilla , i couldnt able to scroll through the month , why so . ?

Want to display , data's from the table on the respective date in that control.. .

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE [dbo].[table1](
  2.     [fid] [int] IDENTITY(1,1) NOT NULL,
  3.     [Shows] [varchar](100) NULL,
  4.     [frmdate] [datetime] NULL,
  5.     }
i need to display the shows on the calender , .
Plz suggest...how to use the calender....?
Jan 30 '09 #1
4 3200
Frinavale
9,735 Expert Mod 8TB
What kind of Calendar control are you using?
Are you using the pure ASP.NET Calendar control or are you using an Ajax calendar control?
Jan 30 '09 #2
sureshl
23
pure asp.net calendar tool ..
my code behind is c#

I am trying to build a calendar that loads the fields from a SQL database. I have a asp:calendar control on my web form.

The database has one table :
I need to know how to load the items from db to appear on a calendar . I'm using Visual Studio 2005, code behind is in C#.
Jan 30 '09 #3
Frinavale
9,735 Expert Mod 8TB
Please check out the following articles for information on how to connect to and read information from a database:
Once you've retrieved the data from the database, set the calendar's date.
Jan 30 '09 #4
if you are having a table with the following fields
LID varchar(50)
date datetime

write stored procedure as following

Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE DISPLAYSCHEDULE
  2.     @LID varchar(50)
  3.  
  4. AS
  5.     select date from PSSDocShed
  6.     where LID=@LID
  7.  
here PSSDocShed is the table name and DISPLAYSCHEDULE is the stored procedure name

in Bussiness class you need to write the following

Expand|Select|Wrap|Line Numbers
  1. public static DataTable displayschedule(string id)
  2.         {
  3.  
  4.             DbCommand cmd = GenericData.CreateCommand();
  5.             cmd.CommandText = "DISPLAYSCHEDULE";
  6.             cmd.Parameters.Add(new SqlParameter("@LID", id));
  7.             return GenericData.ExecuteReader(cmd);
  8.  
  9.         }
  10.  
now come to our calender page click event DayRender
and type the following

Expand|Select|Wrap|Line Numbers
  1. protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
  2.     {
  3.         string id = Request.Cookies["PSSuid"].Value;
  4.         DataTable tb = businessclass.displayschedule(id);
  5.         for (int i = 0; i < tb.Rows.Count; i++)
  6.         {
  7.  
  8.             if (e.Day.Date == Convert.ToDateTime(tb.Rows[i][0]))
  9.             {
  10.                 e.Cell.BackColor = System.Drawing.Color.Pink;
  11.  
  12.             }
  13.  
  14.         }
  15.  
  16.  
  17.  
  18.  
  19.     }
  20.  
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
Oct 4 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: tom | last post by:
Hi, I want a listbox below a hidden calendar control. The problem is that the listbox will shadow the calendar when the calendar is visible. How can I bring the calendar from back to front? ...
2
by: Trint Smith | last post by:
My calendar control erases my upload file control data... The control that allows you to select a file for upload???, well after I do that, I click on the calendar day and when the screen recovers...
5
by: Miguel Dias Moura | last post by:
Hello, i am trying to create a .css file with several styles and apply them to the calendar control so i can change the look of: 1. Text Type and Format (Bold, Underline, etc) 2. Background...
1
by: bill yeager | last post by:
I would like to place the currently selected date (retrieved from the database) on a calendar control which is embedded inside a datagrid. However, I can't find the ID of the control to do so....
2
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
4
by: SAL | last post by:
I'm sorry if this has been answered before but I didn't see it in a quick scan of the list. The following code is causing an error when the field is null: Error text: Conversion from type...
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...
11
by: gan | last post by:
hi dear all please help me im using the calander control from a form just i paste here the problem, the problem is when i click the calander button the calander is opening at the same time...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.