Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Collections;
namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        [WebMethod]
        public static IList GetEvents()
        {
            IList events = new List<event>();
            for (int i = 0; i < DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); i++)
            {
                events.Add(new Event
                {
                    EventName = "krishna kant pandey " + i.ToString(),
                    StartDate = DateTime.Now.AddDays(i).ToString("01-06-2015"),
                    EndDate = DateTime.Now.AddDays(1).ToString("01-08-2015"),
                    ImageType = i % 2,
                   // Url = @"http://www.google.com"
                });
            }
            return events;
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
    public class Event
    {
        public Guid EventID { get { return new Guid(); } }
        public string EventName { get; set; }
        public string StartDate { get; set; }
        public string EndDate { get; set; }
        public int ImageType { get; set; }
        public string Url { get; set; }
    }
}
Posted
Updated 8-Jan-15 18:08pm
v2
Comments
Suvendu Shekhar Giri 9-Jan-15 0:22am    
A little more info about what you want to do in the database will help in providing a solution :)
krishna97 9-Jan-15 0:26am    
how can access event from database table
EventId,Eventname ,Eventdate
krishna97 9-Jan-15 0:28am    
I am Create Calander event can access from database table
Suvendu Shekhar Giri 9-Jan-15 0:53am    
What database you are using and what is the exact problem you are facing to save these data to database?
krishna97 9-Jan-15 0:57am    
yes

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900