473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

23 New Member
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 3217
Frinavale
9,735 Recognized Expert Moderator Expert
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 New Member
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 Recognized Expert Moderator Expert
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
11093
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? Thanks in advance.
2
1166
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 from that, the directory and file are gone!! Any help is appreciated. Thanks, Trint .Net programmer trintsmith@hotmail.com
5
4599
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 Color 3. Foreground Color 4. Border Tickness 5. Border Color
1
2158
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. During the "Edit" command of the grid, I have the following code: <code> If e.CommandName = "Edit" Then Dim myDatagridItem As DataGridItem Dim lblStartDate As Label Dim lblEndDate As Label
2
3413
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 controls (i.e. roundedcorners component www.4guysfromrolla.com], buttons and panels) functions like a tab control. The buttons are programmatically designed to make the corresponding panel visible. Sample aspx.vb code:
6
5516
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; DataBinder.Eval(Container.DataItem,"StoreEmail") &amp; "&amp;Subject=" &amp; DataBinder.Eval(Container.DataItem,"ProductName") ....
4
6228
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 'DBNull' to type 'Date' is not valid. <asp:Calendar ID="Calendar2" runat="server" SelectedDate='<%# Bind("DateReceived") %>' VisibleDate='<%# Eval("DateReceived") %>'></asp:Calendar>
3
2740
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 assist with this. Thanks in advance. I have an access database that i have added a pop up calendar to, the Table information for the Date Reported field is Date/Time format short date, input mask is 00/00/0000.
11
4478
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 backside form component also visible in front side how can i rectfiy this one? i changed the z-index also but no use? <TABLE border="1" bordercolor="#DDDFE7" bgcolor="#565656"cellPadding=0 cellSpacing="1" id=calendar style="DISPLAY:none;...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.