Hi,
I actually found a problem with the code. The problem is that the
indexer for the TZ collection is not positional, its the TimeZoneId.
Here's how I fixed the code.
Add a new class:
public sealed class DisplayTimeZone {
private Microsoft.SqlServer.NotificationServices.TimeZone
zone;
public
DisplayTimeZone( Microsoft.SqlServer.NotificationServices.TimeZone
tz ) {
zone = tz;
}
public override string ToString() {
return zone.DisplayName;
}
public Microsoft.SqlServer.NotificationServices.TimeZone
TimeZone {
get { return zone; }
}
}
In MainForm.cs around line 337 should be a line like:
this.comboBoxTimezone.Items.Add( tz.DisplayName );
Change it to:
this.comboBoxTimezone.Items.Add( new DisplayTimeZone( tz ) );
Then around line 383 find a line like:
// Set the subscription schedule.
if (ScheduleRequired)
{
replace everything between the { and } with this code:
DateTime scheduleStartTime =
dateTimePickerScheduleStart.Value;
DisplayTimeZone dtz =
(DisplayTimeZone)comboBoxTimezone.SelectedItem;
subscription.ScheduleRecurrence = "FREQ=DAILY;";
subscription.ScheduleStart = FormatScheduleStart(
scheduleStartTime,
dtz.TimeZone);
That should fix the utility.
Overall I really like the book, but was disappointed that this tool
didn't work as shipped, and also there seems to be a large number of
typos throughout (the last one was the opening page for Part III,
which listed "two" chapter 14s..
[quoted text, click to view] On Feb 9, 2:57 pm, Todd C <T...@discussions.microsoft.com> wrote:
> I am going through Shyam Pather's book to get myself up and running on NS.
> His source CD has a utility that loads scheduled subscriptions into the
> appropriate table.
>
> I use it and assign a time zone of "(GMT-05:00 Ineian (East)" for my
> subscription.
>
> Looking in the NSTimeZone table, I see that the TimeZoneId for this should
> be 40. But when I view the contents of the Scheduled Subscriptions table, the
> TimeZoneId shows up as 13 (Mexico).
>
> Anybody else have issues with time zones like this? Can I manually enter
> Subscription info, or at least edit it once it is entered?
>
> Any help is appreciated.
>
> --
> Todd Chittenden
>
> [If this response was helpful, please indicate by clicking the appropriate
> answer at the bottom]