Hi i'm traying to load my ultracalendartinfo from a table, but the tag property is null allways.
i have try this way but is there more ways to load from a table? many thanks
my table is :
CREATE TABLE [dbo].[Schedule_Appointments] (
[AppointmentID] [int] IDENTITY (1, 1) NOT NULL ,
[AllProperties] [varbinary] (2048) NULL ,
[StartDateTime] [datetime] NOT NULL ,
[EndDateTime] [datetime] NOT NULL ,
[Subject] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[AllDayEvent] [bit] NOT NULL ,
[OwnerKey] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[app_id] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
and i do that :
AppointmentsDataBinding appointmentsDataBinding = this.ultraCalendarInfo1.DataBindingsForAppointments;
appointmentsDataBinding.AllPropertiesMember = "AllProperties";
appointmentsDataBinding.StartDateTimeMember = "StartDateTime";
appointmentsDataBinding.EndDateTimeMember = "EndDateTime";
appointmentsDataBinding.SubjectMember = "Subject";
appointmentsDataBinding.AllDayEventMember = "AllDayEvent";
appointmentsDataBinding.OwnerKeyMember = "OwnerKey";
appointmentsDataBinding.Tag = "app_id";
appointmentsDataBinding.SetDataBinding(this.DatabaseSupport.DataSet, WinScheduleDatabaseSupportBase.APPOINTMENTS_TABLE_NAME);
appointmentsDataBinding.BindingContextControl = this;
All work fine but my appointment.tag is null , what can i do? if the table will be different with columns location,etc how can i load this values??????
many thanks
I believe the Tag property expects an object so you could not assign a literal value to it.
Load all the other items you want to include about the appointment into an object and then assign it to the TAG.
ok, but if i created my object as follows:
namespace MyObject{ [Serializable()]
public class Employee : ISerializable
{ public int EmpId; public string Location; //Default constructor
public Employee() { EmpId = 0; Location= null; } }}
where or how can i load the properties tag and location from an Appointment given that
AppointmentsDataBinding doesn't have any such properties.
How can i save afterwards in the database ?
and How can i search by location or dates??.
because i had tried :
DateTime dtS = DateTime.Parse("04/04/2010 00:00");
DateTime dtE = DateTime.Parse("05/04/2010 23:59");
AppointmentsSubsetCollection appointments = ultraCalendarInfo1.GetAppointmentsInRange(dtS, dtE);
Appointment[] arr = (Appointment[])appointments.All.Clone();
ultraCalendarInfo1.ResetAppointments();
ultraCalendarInfo1.Appointments.AddRange(arr);
but it's wrong.
may thanks