all groups > sql server notification services > february 2007 >
You're in the

sql server notification services

group:

NSTimeZone and TimeZoneID in Scheduled Subscriptions


NSTimeZone and TimeZoneID in Scheduled Subscriptions Todd C
2/9/2007 11:57:01 AM
sql server notification services:
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
Re: NSTimeZone and TimeZoneID in Scheduled Subscriptions Andy
2/9/2007 1:46:49 PM
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]

Re: NSTimeZone and TimeZoneID in Scheduled Subscriptions Todd C
2/11/2007 11:59:00 AM
Andy:

Thanks for your response. I have not gotten to the source code for the
Subscription Loader utility yet, but I did figure out what was happening by a
brute force iteration of adding one subscription for every time zone using
the utlility. After about 20 records I saw what was happening and predicted
(correctly) that in order to get my time zone (US Eastern) I needed to use
the one for Athens and Istanbul.

Anyway, I will keep this info for when I get to chapter 7 in a few days.

I too like the book. I'm not a VB.Net coder so may have more questions when
it comes to the APIs. Stay tuned!

Thanks again!
--
Todd Chittenden



[quoted text, click to view]
Re: NSTimeZone and TimeZoneID in Scheduled Subscriptions Andy
2/12/2007 6:42:08 AM
No problem. You were getting unexpected behavior.. when I selected my
time zone, EST, the loader threw an exception!

Do you know any C#? That's what all the coding examples are written
in. I check the news group regularly... I hope that more people come
here though, as isn't not a very active group... but the people here
so far have been able to help me quite a bit.

[quoted text, click to view]
Re: NSTimeZone and TimeZoneID in Scheduled Subscriptions Todd C
2/13/2007 1:36:01 PM
Andy:

Since you are familiar with Pather's book, maybe you can help me with
another issue: I am trying to develop my own NS app in parallel with his,
using the same basic logic and am having trouble with a Hosted SQL Event
Provider.

In the ADF, under <HostedProvider> I have the sql statements to drop the
SQLProviderRunTime table if it exists and re-create it. The interval on the
schedule is exactly like his "P0DT00H00M30S".

But when I examine the LastRunTime field of the SQLProviderRunTime table
after the app/instance has been updated and enabled and started, the value
does not change at all. Even after several update iterations, it still has a
DateTime of when it was FIRST created, indicating that it is NOT dropped and
re-created like the ADF says it should.

Any ideas?

Please feel free to e-mail me directly at todd_dot_chittenden_atmorantugdotcom

Thanks
--
Todd Chittenden



[quoted text, click to view]
Re: NSTimeZone and TimeZoneID in Scheduled Subscriptions Andy
2/19/2007 8:09:48 AM
[quoted text, click to view]

You have statements dropping and re-creating the SqlProviderRunTime
table in the HostedProvider? I have those in the Chronicle setup in
the EventProviders section.

[quoted text, click to view]

Is the provider running?
Re: NSTimeZone and TimeZoneID in Scheduled Subscriptions Todd C
2/19/2007 12:57:05 PM
Not sure what I did, but it seems to be working OK now... Pulling events
through my SQL provider, and updating the SQL Provider Chron table as it does.

Thanks.
--
Todd Chittenden

[quoted text, click to view]
AddThis Social Bookmark Button