Hi,
how can we get the Activity Id after addinbg an activity to the database .any helps please urgent
thanks in advance
First, if you are using stored procedures then have you checked the DataKey property on the Activity after it has been added? WebScheduleSqlClientProvider will put the ID there if the add transaction commits successfully.
If you are using embedded SQL, then when the WebScheduleInfo data binds (which happens just after the client sends a request that adds or updates an Activity), its Activities should be re-loaded with their IDs. If your code remembers the date/time of the newly added Activity, you can go in and retrieve it with a call to GetAppointmentsForDate.
hi,
Thanks ...
I have a doubt
I added an appoint .The code is as follows:
.CreateAppointment();
// Add Activity to the Activities collection on WebScheduleInfo1.
.WebScheduleInfo1.Activities.Add(appt);
WebScheduleOleDbProvider1.AddActivity(appt,
createappointment was as follows:
private
FollowUpAppointment
CreateAppointment()
{
// Create an empty Activity owned by the WebScheduleInfo.
FollowUpAppointment appt = new FollowUpAppointment(this
.WebScheduleInfo1);
appt.StartDateTimeUtc = Infragistics.WebUI.Shared.
SmartDate
.Now;
// Set pertinent properties on the Activity.
appt.Subject =
"My Thirty-Minute Appointmentxc"
;
appt.Duration =
new TimeSpan
(0, 30, 0);
// Set Key property to a unique value on each appointment.
//appt.Key = "100";
appt.ProviderID =
"STEXT"
string
str = appt.Key;
// Set ResourceKey property to link Activity with organizing Resource.
appt.ResourceKey =
this
.WebScheduleInfo1.VisibleResources.UnassignedResource.Key;
// Return the newly initialized Activity.
return appt;
Afer adding this how can i get the correspopnding activity iD
this.WebScheduleInfo1.VisibleResources.UnassignedResource);
after this statement appt.datakey is null
how can i get it just after adding the appointment
Please help me on this regard