Is there a way within a proc to determine what object called it?
ex:
DB1.dbo.ProcA calls DB2.dbo.ProcB. From within ProcB, is there any means to
get the context (name or id) of the procedure or function that called it?
Thanks!I don't think so. I think all you get is @.@.NESTLEVEL
However you can set sysprocesses.CONTEXT_INFO
I've used it to bypass triggers before.
http://www.sqlservercentral.com/col...ingtriggers.asp
In this case it's much the same as updating an @.@.spid based table.
Paul
"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:047E3AF3-D480-4246-899B-A0616B51F179@.microsoft.com...
> Is there a way within a proc to determine what object called it?
> ex:
> DB1.dbo.ProcA calls DB2.dbo.ProcB. From within ProcB, is there any means
> to
> get the context (name or id) of the procedure or function that called it?
> Thanks!|||nrgh...that is what I was afraid of. :)
I have to modify some existing procedures and the original implementation
has led to some issues in logging information. I was hoping to avoid
changing about 1000 procs to pass in the DBID that it was executed on. *sig
h*
Thanks for the confirmation.
"Paul Cahill" wrote:
> I don't think so. I think all you get is @.@.NESTLEVEL
> However you can set sysprocesses.CONTEXT_INFO
> I've used it to bypass triggers before.
> http://www.sqlservercentral.com/col...ingtriggers.asp
> In this case it's much the same as updating an @.@.spid based table.
> Paul
>
>
> "Travis" <Travis@.discussions.microsoft.com> wrote in message
> news:047E3AF3-D480-4246-899B-A0616B51F179@.microsoft.com...
>
>|||The @.@.procid variable returns the procedure identifier of the current
procedure. Perhaps you can add a parameter to each SP @.called_by and call
procedures like so:
exec @.proc2 @.called_by = @.@.procid
"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:047E3AF3-D480-4246-899B-A0616B51F179@.microsoft.com...
> Is there a way within a proc to determine what object called it?
> ex:
> DB1.dbo.ProcA calls DB2.dbo.ProcB. From within ProcB, is there any means
> to
> get the context (name or id) of the procedure or function that called it?
> Thanks!|||There's been a few times I'd like to be able to get at the stack too.
Anyone out there know a trick?
If these were remote calls I think it could be done by setting up the linked
servers such that rpc's always connect as a particular user.
If each link is given a different username can you then tell which server
remotely called the proc.
But you are executing all on the same machine just from different databases.
"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:DA1631A4-10C6-4037-97F1-C5D58327B16A@.microsoft.com...
> nrgh...that is what I was afraid of. :)
> I have to modify some existing procedures and the original implementation
> has led to some issues in logging information. I was hoping to avoid
> changing about 1000 procs to pass in the DBID that it was executed on.
> *sigh*
> Thanks for the confirmation.
> "Paul Cahill" wrote:
>|||The procID is being passed into the procedure, but it will need to pass in
the DBID as well. There are multiple DBs on the server and it recently came
to light that the logic in the proc to determine which DB the proc was
executed on is incorrect (as the procIds can be the same in multiple dbs).
: )
Thx
"JT" wrote:
> The @.@.procid variable returns the procedure identifier of the current
> procedure. Perhaps you can add a parameter to each SP @.called_by and call
> procedures like so:
> exec @.proc2 @.called_by = @.@.procid
> "Travis" <Travis@.discussions.microsoft.com> wrote in message
> news:047E3AF3-D480-4246-899B-A0616B51F179@.microsoft.com...
>
>|||If you are wanting to peform procedure call stack tracing for debugging
purposes, then look into using SQL Profiler for this. It would require no
programming changes.
http://msdn.microsoft.com/library/d...nEventClues.asp
"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:4C79AB11-F7D1-40DD-BB52-0063E138D8C4@.microsoft.com...
> The procID is being passed into the procedure, but it will need to pass in
> the DBID as well. There are multiple DBs on the server and it recently
> came
> to light that the logic in the proc to determine which DB the proc was
> executed on is incorrect (as the procIds can be the same in multiple dbs).
> : )
> Thx
> "JT" wrote:
>
Showing posts with label object. Show all posts
Showing posts with label object. Show all posts
Thursday, March 29, 2012
Monday, March 19, 2012
Detail information within other detail (different table)
I have a one page report that prints information from several tables. The
report contains a list object slightly smaller than the body size (8X10.5)
and a rectangle object slightly smaller than the list object. The rectangle
object contains 130 plus textboxes for labels and actual fields to be
printed. This is a profile type report used to print all information for a
member (name, address, city, state, and several other fields) and requires
the whole page. There can be further detail linked to this member. In this
case, committees that the member serves on. I can't figure out how to get the
top 5 committees to print with all of the other detail. Does anyone know a
"best method" to accomplish this?
Thanks,
JohnNevermind. Finally used a subreport which solved the problem very nicely.
John
"John Joslin" wrote:
> I have a one page report that prints information from several tables. The
> report contains a list object slightly smaller than the body size (8X10.5)
> and a rectangle object slightly smaller than the list object. The rectangle
> object contains 130 plus textboxes for labels and actual fields to be
> printed. This is a profile type report used to print all information for a
> member (name, address, city, state, and several other fields) and requires
> the whole page. There can be further detail linked to this member. In this
> case, committees that the member serves on. I can't figure out how to get the
> top 5 committees to print with all of the other detail. Does anyone know a
> "best method" to accomplish this?
> Thanks,
> John
report contains a list object slightly smaller than the body size (8X10.5)
and a rectangle object slightly smaller than the list object. The rectangle
object contains 130 plus textboxes for labels and actual fields to be
printed. This is a profile type report used to print all information for a
member (name, address, city, state, and several other fields) and requires
the whole page. There can be further detail linked to this member. In this
case, committees that the member serves on. I can't figure out how to get the
top 5 committees to print with all of the other detail. Does anyone know a
"best method" to accomplish this?
Thanks,
JohnNevermind. Finally used a subreport which solved the problem very nicely.
John
"John Joslin" wrote:
> I have a one page report that prints information from several tables. The
> report contains a list object slightly smaller than the body size (8X10.5)
> and a rectangle object slightly smaller than the list object. The rectangle
> object contains 130 plus textboxes for labels and actual fields to be
> printed. This is a profile type report used to print all information for a
> member (name, address, city, state, and several other fields) and requires
> the whole page. There can be further detail linked to this member. In this
> case, committees that the member serves on. I can't figure out how to get the
> top 5 committees to print with all of the other detail. Does anyone know a
> "best method" to accomplish this?
> Thanks,
> John
Friday, February 17, 2012
design pattern question
Say I have an object that can be created by some users and not others. And, I have a method something like -function createObject(userId as Integer, objectName as String). The method calls a stored procedure using the two input arguments as parameters.
Now, what I am wondering is this; I am obviously going to check in my SP to ensure that the user has the rights to create the new object before inserting the new record, and there will be an output parameter to send the new record ID back to the method, but do I
a) have a separate output parameter to report on the success of the creation (e.g. @.Err Int OUTPUT)
b) use the existing output (used to send the new record ID back) and send an error code (e.g. if newRecordId = -9999)
c) somehow try to cause a failure of the SP that can be caught in a try/catch block
Thanks in advance,
MartinI would use option #2. Since you already have this variable, it can easily be checked for an error code and Im sure you are probably doing other types of checks as well. I would never ever ever use option #3. try/catches should always only be used from true exceptions. I always send myself an error email when a catch is experienced and would always be receiving these emails when there really wasnt an error.
Nick
Now, what I am wondering is this; I am obviously going to check in my SP to ensure that the user has the rights to create the new object before inserting the new record, and there will be an output parameter to send the new record ID back to the method, but do I
a) have a separate output parameter to report on the success of the creation (e.g. @.Err Int OUTPUT)
b) use the existing output (used to send the new record ID back) and send an error code (e.g. if newRecordId = -9999)
c) somehow try to cause a failure of the SP that can be caught in a try/catch block
Thanks in advance,
MartinI would use option #2. Since you already have this variable, it can easily be checked for an error code and Im sure you are probably doing other types of checks as well. I would never ever ever use option #3. try/catches should always only be used from true exceptions. I always send myself an error email when a catch is experienced and would always be receiving these emails when there really wasnt an error.
Nick
Tuesday, February 14, 2012
Deserialize ScheduleDefinition
I'm attempting to pull the Matchdata that is retrieved from the
GetSubscriptionProperties call into an object. According to the
documentation, matchdata is XML that is a represents a ScheduleDefinition
object. What I'd like to do is deserialize the XML string into a
ScheduleDefinition object. Something like this ...
Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
Dim requestSerializer As Xml.Serialization.XmlSerializer
requestSerializer = New
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
tion), a)
rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings, desc,
active, status, eventType, matchData, values)
Dim stm As New System.IO.MemoryStream
Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
msg.WriteRaw(matchData)
msg.Flush()
Dim readStream As New StreamReader(stm, Encoding.UTF8)
Dim r As CorporateReporting.RS.ScheduleDefinition = CType(requestSerializer.Deserialize(readStream),
CorporateReporting.RS.ScheduleDefinition)
It keeps throwing an XML exception. Any ideas on how I should be doing
this'
Thx,What exception are you seeing? There is a known issue with Monthly Day of
Week schedules, you may be running into this. Have you tried other
schedules?
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message
news:OB9fmYOdEHA.1644@.tk2msftngp13.phx.gbl...
> I'm attempting to pull the Matchdata that is retrieved from the
> GetSubscriptionProperties call into an object. According to the
> documentation, matchdata is XML that is a represents a ScheduleDefinition
> object. What I'd like to do is deserialize the XML string into a
> ScheduleDefinition object. Something like this ...
> Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> Dim requestSerializer As Xml.Serialization.XmlSerializer
> requestSerializer = New
>
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> tion), a)
> rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
desc,
> active, status, eventType, matchData, values)
> Dim stm As New System.IO.MemoryStream
> Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
> msg.WriteRaw(matchData)
> msg.Flush()
> Dim readStream As New StreamReader(stm, Encoding.UTF8)
> Dim r As CorporateReporting.RS.ScheduleDefinition => CType(requestSerializer.Deserialize(readStream),
> CorporateReporting.RS.ScheduleDefinition)
> It keeps throwing an XML exception. Any ideas on how I should be doing
> this'
> Thx,
>|||I'm doing the same thing. I can deserialize but I'm currently
figuring out how to get the info out of the definition and onto a
form. Not too many people helping out on this subject, here's what
I've done (snippet):
ScheduleDefinition objDef;
StringReader strRead = new
StringReader(Request.Cookies["Schedule"].Value);
XmlSerializer objXMLSerial = new
XmlSerializer(typeof(ScheduleDefinition));
objDef = (ScheduleDefinition) objXMLSerial.Deserialize(strRead);
// Working on this part...
setScheduleForm(objDef);
Let me know if this helps any?
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<OB9fmYOdEHA.1644@.tk2msftngp13.phx.gbl>...
> I'm attempting to pull the Matchdata that is retrieved from the
> GetSubscriptionProperties call into an object. According to the
> documentation, matchdata is XML that is a represents a ScheduleDefinition
> object. What I'd like to do is deserialize the XML string into a
> ScheduleDefinition object. Something like this ...
> Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> Dim requestSerializer As Xml.Serialization.XmlSerializer
> requestSerializer = New
> Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> tion), a)
> rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings, desc,
> active, status, eventType, matchData, values)
> Dim stm As New System.IO.MemoryStream
> Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
> msg.WriteRaw(matchData)
> msg.Flush()
> Dim readStream As New StreamReader(stm, Encoding.UTF8)
> Dim r As CorporateReporting.RS.ScheduleDefinition => CType(requestSerializer.Deserialize(readStream),
> CorporateReporting.RS.ScheduleDefinition)
> It keeps throwing an XML exception. Any ideas on how I should be doing
> this'
> Thx,|||Frank,
Yes!! Thanks for the help.
I can now deserialize the matchdata into an ScheduleDefinition object
without any errors
However, the object is not deserializing properly?!?
My matchdata is:
"<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
However, my object (during quickwatch) looks like
r - ScheduleDefinition (my object)
EndDate: #12:00:00AM#
EndDateSpecified: False
Item: Nothing
StartDateTime: #12:00:00AM#
At least the StartDateTime should deserialize properly!
I've only tried one schedule at this point in time. I'm going to try a
couple others and see if they do the same thing. I'll post back any
different results
Could this be the known bug that Daniel Reib mentioned?
Thx so much for getting me this far!!
-Joel
"Stoma_Kalos" <fzuma@.yahoo.com> wrote in message
news:e876e3c8.0408030931.7eec518e@.posting.google.com...
> I'm doing the same thing. I can deserialize but I'm currently
> figuring out how to get the info out of the definition and onto a
> form. Not too many people helping out on this subject, here's what
> I've done (snippet):
> ScheduleDefinition objDef;
> StringReader strRead = new
> StringReader(Request.Cookies["Schedule"].Value);
> XmlSerializer objXMLSerial = new
> XmlSerializer(typeof(ScheduleDefinition));
> objDef = (ScheduleDefinition) objXMLSerial.Deserialize(strRead);
> // Working on this part...
> setScheduleForm(objDef);
> Let me know if this helps any?
> Frank
> "Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message
news:<OB9fmYOdEHA.1644@.tk2msftngp13.phx.gbl>...
> > I'm attempting to pull the Matchdata that is retrieved from the
> > GetSubscriptionProperties call into an object. According to the
> > documentation, matchdata is XML that is a represents a
ScheduleDefinition
> > object. What I'd like to do is deserialize the XML string into a
> > ScheduleDefinition object. Something like this ...
> >
> > Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> >
> > Dim requestSerializer As Xml.Serialization.XmlSerializer
> >
> > requestSerializer = New
> >
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> > tion), a)
> >
> > rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
desc,
> > active, status, eventType, matchData, values)
> >
> > Dim stm As New System.IO.MemoryStream
> >
> > Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
> >
> > msg.WriteRaw(matchData)
> >
> > msg.Flush()
> >
> > Dim readStream As New StreamReader(stm, Encoding.UTF8)
> >
> > Dim r As CorporateReporting.RS.ScheduleDefinition => > CType(requestSerializer.Deserialize(readStream),
> > CorporateReporting.RS.ScheduleDefinition)
> >
> > It keeps throwing an XML exception. Any ideas on how I should be doing
> > this'
> >
> > Thx,|||I believe the error that Daniel Reib mentioned is of no consequence as
to why your Item method is empty. I've gotten that far w/ the code
below, however the retrieving of the information under each type is
still eluding me. I know how to figure out what type of definition as
can be seen below, but I don't know how to pull the info out of the
specific types. I'm sure it has to be under the Item method
somewhere...there aren't many other choices. I'm surprised there
hasn't been a Microsoft rep all over this, maybe they don't know
either?
Anyway let me know you get along...
private void setScheduleForm(ScheduleDefinition def)
{
DateTime strStartDT = def.StartDateTime;
int month = strStartDT.Month;
int day = strStartDT.Day;
int year = strStartDT.Year;
int hour = strStartDT.Hour;
int minute = strStartDT.Minute;
int second = 0;
this.pnlHourly.Visible = false;
this.pnlDaily.Visible = false;
this.pnlWeekly.Visible = false;
this.pnlMonthly.Visible = false;
this.txtStartDate.Value = def.StartDateTime;
if (def.EndDateSpecified)
this.txtEndDate.Value = def.EndDate;
// This looks at what type of definition is stored...since there are
multiple
switch (def.Item.GetType().Name)
{
case "Hourly":
this.pnlHourly.Visible = true;
case "Daily":
this.pnlDaily.Visible = true;
case "WeeklyRecurrence":
WeeklyRecurrence recurrence = new WeeklyRecurrence();
DaysOfWeekSelector days = new DaysOfWeekSelector();
this.pnlWeekly.Visible = true;
this.txtWeeklyStartMinutes.Text = minute.ToString();
if (hour >= 12)
{
hour = hour - 12;
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyPM.Checked = true;
}
else
{
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyAM.Checked = true;
}
/*this.chkWeeklyMonday.Checked = ;
this.chkWeeklyTuesday.Checked = ;
this.chkWeeklyWednesday.Checked = ;
this.chkWeeklyThursday.Checked = ;
this.chkWeeklyFriday.Checked = ;
this.chkWeeklySaturday.Checked = ;
this.chkWeeklySunday.Checked = ;
*/
//recurrence.DaysOfWeek = days;
if (recurrence.WeeksIntervalSpecified)
this.txtWeeklyRepeatWeeks.Text =recurrence.WeeksInterval.ToString();
break;
case "MonthlyRecurrence":
case "MonthlyDOWRecurrence":
}
}
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<eRPnmOYeEHA.1656@.TK2MSFTNGP09.phx.gbl>...
> Frank,
> Yes!! Thanks for the help.
> I can now deserialize the matchdata into an ScheduleDefinition object
> without any errors
> However, the object is not deserializing properly?!?
> My matchdata is:
> "<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
> Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
> rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
> nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
> y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
> However, my object (during quickwatch) looks like
> r - ScheduleDefinition (my object)
> EndDate: #12:00:00AM#
> EndDateSpecified: False
> Item: Nothing
> StartDateTime: #12:00:00AM#
> At least the StartDateTime should deserialize properly!
> I've only tried one schedule at this point in time. I'm going to try a
> couple others and see if they do the same thing. I'll post back any
> different results
> Could this be the known bug that Daniel Reib mentioned?
> Thx so much for getting me this far!!
> -Joel|||Ok, FINALLY figured it out...I was not casting the object correctly.
You can refer to my previous post to see some of the outer portions of
code. By the way, I looked at where you got, it appears that you are
not getting any info at all. That definition looks empty, one thing
to note in my first posting is I use a cookie and not the MatchData
variable. So be sure you are using MD instead of my cookie value.
Also be sure you have string XML in your MD variable at that point.
Let me know if you need more clarifcation...and post some code so I
can see more of what you are doing.
case "WeeklyRecurrence":
// THIS WAS THE KICKER FOR ME...that damn def.Item cast.
WeeklyRecurrence recurrence =(TXU.Online.Reports.Web.Objects.WeeklyRecurrence)def.Item;
DaysOfWeekSelector days = recurrence.DaysOfWeek;
this.pnlWeekly.Visible = true;
this.radRecurrence.SelectedValue = "Weekly";
this.txtWeeklyStartMinutes.Text = minute.ToString("00");
if (hour > 12)
{
hour = hour - 12;
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyPM.Checked = true;
}
else
{
if (hour == 0)
this.txtWeeklyStartHour.Text = "12";
else
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyAM.Checked = true;
}
this.chkWeeklyMonday.Checked = days.Monday;
this.chkWeeklyTuesday.Checked = days.Tuesday;
this.chkWeeklyWednesday.Checked = days.Wednesday;
this.chkWeeklyThursday.Checked = days.Thursday;
this.chkWeeklyFriday.Checked = days.Friday;
this.chkWeeklySaturday.Checked = days.Saturday;
this.chkWeeklySunday.Checked = days.Sunday;
if (recurrence.WeeksIntervalSpecified)
this.txtWeeklyRepeatWeeks.Text =recurrence.WeeksInterval.ToString();
break;
case "MonthlyRecurrence":
case "MonthlyDOWRecurrence":
}
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<eRPnmOYeEHA.1656@.TK2MSFTNGP09.phx.gbl>...
> Frank,
> Yes!! Thanks for the help.
> I can now deserialize the matchdata into an ScheduleDefinition object
> without any errors
> However, the object is not deserializing properly?!?
> My matchdata is:
> "<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
> Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
> rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
> nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
> y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
> However, my object (during quickwatch) looks like
> r - ScheduleDefinition (my object)
> EndDate: #12:00:00AM#
> EndDateSpecified: False
> Item: Nothing
> StartDateTime: #12:00:00AM#
> At least the StartDateTime should deserialize properly!
> I've only tried one schedule at this point in time. I'm going to try a
> couple others and see if they do the same thing. I'll post back any
> different results
> Could this be the known bug that Daniel Reib mentioned?
> Thx so much for getting me this far!!
> -Joel|||Frank,
Thanks so much for the code snippets. Once I get my object to start
deserializing properly at all, I will be able to plugin the code you wrote.
However, you are correct in that the definition once deserialized is empty.
Here's the code I'm using to retrieve and deserialize the object
subscriptions = rs.ListSubscriptions(Nothing, nUserObj.UserName.ToString)
Dim requestSerializer As Xml.Serialization.XmlSerializer
Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
requestSerializer = New
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
tion), a)
For Each subscription As RS.Subscription In subscriptions
rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
desc, active, status, eventType, matchData, values)
extensionParams = extSettings.ParameterValues
Dim obj As Object = requestSerializer.Deserialize(New
StringReader(matchData))
Dim r As CorporateReporting.RS.ScheduleDefinition = CType(obj,
CorporateReporting.RS.ScheduleDefinition)
When I look at the MatchData I get the XML listed below:
"<ScheduleDefinition><StartDateTime>2004-08-03T08:00:00.000-07:00</StartDate
Time><EndDate>08/20/2004</EndDate><WeeklyRecurrence><WeeksInterval>3</WeeksI
nterval><DaysOfWeek><Monday>True</Monday><Wednesday>True</Wednesday></DaysOf
Week></WeeklyRecurrence></ScheduleDefinition>"
When you say "be sure you have string XML in your MD variable at that point
..." do you mean that I need to add an <?xml version='1.0'?> tag to the
beginning of the string? (I tried that, but it didn't change the object.)
Any help is always appreciated!!
"Stoma_Kalos" <fzuma@.yahoo.com> wrote in message
news:e876e3c8.0408051117.539a5442@.posting.google.com...
> Ok, FINALLY figured it out...I was not casting the object correctly.
> You can refer to my previous post to see some of the outer portions of
> code. By the way, I looked at where you got, it appears that you are
> not getting any info at all. That definition looks empty, one thing
> to note in my first posting is I use a cookie and not the MatchData
> variable. So be sure you are using MD instead of my cookie value.
> Also be sure you have string XML in your MD variable at that point.
> Let me know if you need more clarifcation...and post some code so I
> can see more of what you are doing.
> case "WeeklyRecurrence":
> // THIS WAS THE KICKER FOR ME...that damn def.Item cast.
> WeeklyRecurrence recurrence => (TXU.Online.Reports.Web.Objects.WeeklyRecurrence)def.Item;
> DaysOfWeekSelector days = recurrence.DaysOfWeek;
> this.pnlWeekly.Visible = true;
> this.radRecurrence.SelectedValue = "Weekly";
> this.txtWeeklyStartMinutes.Text = minute.ToString("00");
> if (hour > 12)
> {
> hour = hour - 12;
> this.txtWeeklyStartHour.Text = hour.ToString();
> this.radWeeklyPM.Checked = true;
> }
> else
> {
> if (hour == 0)
> this.txtWeeklyStartHour.Text = "12";
> else
> this.txtWeeklyStartHour.Text = hour.ToString();
> this.radWeeklyAM.Checked = true;
> }
> this.chkWeeklyMonday.Checked = days.Monday;
> this.chkWeeklyTuesday.Checked = days.Tuesday;
> this.chkWeeklyWednesday.Checked = days.Wednesday;
> this.chkWeeklyThursday.Checked = days.Thursday;
> this.chkWeeklyFriday.Checked = days.Friday;
> this.chkWeeklySaturday.Checked = days.Saturday;
> this.chkWeeklySunday.Checked = days.Sunday;
> if (recurrence.WeeksIntervalSpecified)
> this.txtWeeklyRepeatWeeks.Text => recurrence.WeeksInterval.ToString();
> break;
> case "MonthlyRecurrence":
> case "MonthlyDOWRecurrence":
> }
>
> Frank
>
> "Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message
news:<eRPnmOYeEHA.1656@.TK2MSFTNGP09.phx.gbl>...
> > Frank,
> >
> > Yes!! Thanks for the help.
> >
> > I can now deserialize the matchdata into an ScheduleDefinition object
> > without any errors
> >
> > However, the object is not deserializing properly?!?
> >
> > My matchdata is:
> >
"<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
> >
Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
> >
rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
> >
nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
> > y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
> >
> > However, my object (during quickwatch) looks like
> >
> > r - ScheduleDefinition (my object)
> > EndDate: #12:00:00AM#
> > EndDateSpecified: False
> > Item: Nothing
> > StartDateTime: #12:00:00AM#
> >
> > At least the StartDateTime should deserialize properly!
> >
> > I've only tried one schedule at this point in time. I'm going to try a
> > couple others and see if they do the same thing. I'll post back any
> > different results
> >
> > Could this be the known bug that Daniel Reib mentioned?
> >
> > Thx so much for getting me this far!!
> >
> > -Joel|||Joel,
Be careful with your "New" statements...this is just a guess, but you
may try whackin'(removing) that "New" statement in the line below.
You're matchdata looks good, so i'm assuming you are getting a blank
object because your re-initializing your StringReader? I'm not
sure...I have to play with different lines to figure out my code
sometimes. It doesn't help that i'm in C# and you in VB, if I get
time I will VB it, but i'm wading in code as it is.
If at the point of this line you have good data in matchData
(hover/use immediate/watch in Debug), and after that line (step
through) the obj object is empty then that line is your problem. I
always step through in debug and follow my data, once you find out
where it goes wrong that's 75% of the battle. Try that and let me
know how you do.
Dim obj As Object = requestSerializer.Deserialize(New
StringReader(matchData))
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<u$R6W5yeEHA.644@.tk2msftngp13.phx.gbl>...
> Frank,
> Thanks so much for the code snippets. Once I get my object to start
> deserializing properly at all, I will be able to plugin the code you wrote.
> However, you are correct in that the definition once deserialized is empty.
> Here's the code I'm using to retrieve and deserialize the object
> subscriptions = rs.ListSubscriptions(Nothing, nUserObj.UserName.ToString)
> Dim requestSerializer As Xml.Serialization.XmlSerializer
> Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> requestSerializer = New
> Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> tion), a)
> For Each subscription As RS.Subscription In subscriptions
> rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
> desc, active, status, eventType, matchData, values)
> extensionParams = extSettings.ParameterValues
> Dim obj As Object = requestSerializer.Deserialize(New
> StringReader(matchData))
> Dim r As CorporateReporting.RS.ScheduleDefinition = CType(obj,
> CorporateReporting.RS.ScheduleDefinition)
> When I look at the MatchData I get the XML listed below:
> "<ScheduleDefinition><StartDateTime>2004-08-03T08:00:00.000-07:00</StartDate
> Time><EndDate>08/20/2004</EndDate><WeeklyRecurrence><WeeksInterval>3</WeeksI
> nterval><DaysOfWeek><Monday>True</Monday><Wednesday>True</Wednesday></DaysOf
> Week></WeeklyRecurrence></ScheduleDefinition>"
> When you say "be sure you have string XML in your MD variable at that point
> ..." do you mean that I need to add an <?xml version='1.0'?> tag to the
> beginning of the string? (I tried that, but it didn't change the object.)
> Any help is always appreciated!!
GetSubscriptionProperties call into an object. According to the
documentation, matchdata is XML that is a represents a ScheduleDefinition
object. What I'd like to do is deserialize the XML string into a
ScheduleDefinition object. Something like this ...
Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
Dim requestSerializer As Xml.Serialization.XmlSerializer
requestSerializer = New
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
tion), a)
rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings, desc,
active, status, eventType, matchData, values)
Dim stm As New System.IO.MemoryStream
Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
msg.WriteRaw(matchData)
msg.Flush()
Dim readStream As New StreamReader(stm, Encoding.UTF8)
Dim r As CorporateReporting.RS.ScheduleDefinition = CType(requestSerializer.Deserialize(readStream),
CorporateReporting.RS.ScheduleDefinition)
It keeps throwing an XML exception. Any ideas on how I should be doing
this'
Thx,What exception are you seeing? There is a known issue with Monthly Day of
Week schedules, you may be running into this. Have you tried other
schedules?
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message
news:OB9fmYOdEHA.1644@.tk2msftngp13.phx.gbl...
> I'm attempting to pull the Matchdata that is retrieved from the
> GetSubscriptionProperties call into an object. According to the
> documentation, matchdata is XML that is a represents a ScheduleDefinition
> object. What I'd like to do is deserialize the XML string into a
> ScheduleDefinition object. Something like this ...
> Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> Dim requestSerializer As Xml.Serialization.XmlSerializer
> requestSerializer = New
>
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> tion), a)
> rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
desc,
> active, status, eventType, matchData, values)
> Dim stm As New System.IO.MemoryStream
> Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
> msg.WriteRaw(matchData)
> msg.Flush()
> Dim readStream As New StreamReader(stm, Encoding.UTF8)
> Dim r As CorporateReporting.RS.ScheduleDefinition => CType(requestSerializer.Deserialize(readStream),
> CorporateReporting.RS.ScheduleDefinition)
> It keeps throwing an XML exception. Any ideas on how I should be doing
> this'
> Thx,
>|||I'm doing the same thing. I can deserialize but I'm currently
figuring out how to get the info out of the definition and onto a
form. Not too many people helping out on this subject, here's what
I've done (snippet):
ScheduleDefinition objDef;
StringReader strRead = new
StringReader(Request.Cookies["Schedule"].Value);
XmlSerializer objXMLSerial = new
XmlSerializer(typeof(ScheduleDefinition));
objDef = (ScheduleDefinition) objXMLSerial.Deserialize(strRead);
// Working on this part...
setScheduleForm(objDef);
Let me know if this helps any?
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<OB9fmYOdEHA.1644@.tk2msftngp13.phx.gbl>...
> I'm attempting to pull the Matchdata that is retrieved from the
> GetSubscriptionProperties call into an object. According to the
> documentation, matchdata is XML that is a represents a ScheduleDefinition
> object. What I'd like to do is deserialize the XML string into a
> ScheduleDefinition object. Something like this ...
> Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> Dim requestSerializer As Xml.Serialization.XmlSerializer
> requestSerializer = New
> Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> tion), a)
> rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings, desc,
> active, status, eventType, matchData, values)
> Dim stm As New System.IO.MemoryStream
> Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
> msg.WriteRaw(matchData)
> msg.Flush()
> Dim readStream As New StreamReader(stm, Encoding.UTF8)
> Dim r As CorporateReporting.RS.ScheduleDefinition => CType(requestSerializer.Deserialize(readStream),
> CorporateReporting.RS.ScheduleDefinition)
> It keeps throwing an XML exception. Any ideas on how I should be doing
> this'
> Thx,|||Frank,
Yes!! Thanks for the help.
I can now deserialize the matchdata into an ScheduleDefinition object
without any errors
However, the object is not deserializing properly?!?
My matchdata is:
"<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
However, my object (during quickwatch) looks like
r - ScheduleDefinition (my object)
EndDate: #12:00:00AM#
EndDateSpecified: False
Item: Nothing
StartDateTime: #12:00:00AM#
At least the StartDateTime should deserialize properly!
I've only tried one schedule at this point in time. I'm going to try a
couple others and see if they do the same thing. I'll post back any
different results
Could this be the known bug that Daniel Reib mentioned?
Thx so much for getting me this far!!
-Joel
"Stoma_Kalos" <fzuma@.yahoo.com> wrote in message
news:e876e3c8.0408030931.7eec518e@.posting.google.com...
> I'm doing the same thing. I can deserialize but I'm currently
> figuring out how to get the info out of the definition and onto a
> form. Not too many people helping out on this subject, here's what
> I've done (snippet):
> ScheduleDefinition objDef;
> StringReader strRead = new
> StringReader(Request.Cookies["Schedule"].Value);
> XmlSerializer objXMLSerial = new
> XmlSerializer(typeof(ScheduleDefinition));
> objDef = (ScheduleDefinition) objXMLSerial.Deserialize(strRead);
> // Working on this part...
> setScheduleForm(objDef);
> Let me know if this helps any?
> Frank
> "Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message
news:<OB9fmYOdEHA.1644@.tk2msftngp13.phx.gbl>...
> > I'm attempting to pull the Matchdata that is retrieved from the
> > GetSubscriptionProperties call into an object. According to the
> > documentation, matchdata is XML that is a represents a
ScheduleDefinition
> > object. What I'd like to do is deserialize the XML string into a
> > ScheduleDefinition object. Something like this ...
> >
> > Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> >
> > Dim requestSerializer As Xml.Serialization.XmlSerializer
> >
> > requestSerializer = New
> >
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> > tion), a)
> >
> > rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
desc,
> > active, status, eventType, matchData, values)
> >
> > Dim stm As New System.IO.MemoryStream
> >
> > Dim msg As New Xml.XmlTextWriter(stm, System.Text.Encoding.UTF8)
> >
> > msg.WriteRaw(matchData)
> >
> > msg.Flush()
> >
> > Dim readStream As New StreamReader(stm, Encoding.UTF8)
> >
> > Dim r As CorporateReporting.RS.ScheduleDefinition => > CType(requestSerializer.Deserialize(readStream),
> > CorporateReporting.RS.ScheduleDefinition)
> >
> > It keeps throwing an XML exception. Any ideas on how I should be doing
> > this'
> >
> > Thx,|||I believe the error that Daniel Reib mentioned is of no consequence as
to why your Item method is empty. I've gotten that far w/ the code
below, however the retrieving of the information under each type is
still eluding me. I know how to figure out what type of definition as
can be seen below, but I don't know how to pull the info out of the
specific types. I'm sure it has to be under the Item method
somewhere...there aren't many other choices. I'm surprised there
hasn't been a Microsoft rep all over this, maybe they don't know
either?
Anyway let me know you get along...
private void setScheduleForm(ScheduleDefinition def)
{
DateTime strStartDT = def.StartDateTime;
int month = strStartDT.Month;
int day = strStartDT.Day;
int year = strStartDT.Year;
int hour = strStartDT.Hour;
int minute = strStartDT.Minute;
int second = 0;
this.pnlHourly.Visible = false;
this.pnlDaily.Visible = false;
this.pnlWeekly.Visible = false;
this.pnlMonthly.Visible = false;
this.txtStartDate.Value = def.StartDateTime;
if (def.EndDateSpecified)
this.txtEndDate.Value = def.EndDate;
// This looks at what type of definition is stored...since there are
multiple
switch (def.Item.GetType().Name)
{
case "Hourly":
this.pnlHourly.Visible = true;
case "Daily":
this.pnlDaily.Visible = true;
case "WeeklyRecurrence":
WeeklyRecurrence recurrence = new WeeklyRecurrence();
DaysOfWeekSelector days = new DaysOfWeekSelector();
this.pnlWeekly.Visible = true;
this.txtWeeklyStartMinutes.Text = minute.ToString();
if (hour >= 12)
{
hour = hour - 12;
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyPM.Checked = true;
}
else
{
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyAM.Checked = true;
}
/*this.chkWeeklyMonday.Checked = ;
this.chkWeeklyTuesday.Checked = ;
this.chkWeeklyWednesday.Checked = ;
this.chkWeeklyThursday.Checked = ;
this.chkWeeklyFriday.Checked = ;
this.chkWeeklySaturday.Checked = ;
this.chkWeeklySunday.Checked = ;
*/
//recurrence.DaysOfWeek = days;
if (recurrence.WeeksIntervalSpecified)
this.txtWeeklyRepeatWeeks.Text =recurrence.WeeksInterval.ToString();
break;
case "MonthlyRecurrence":
case "MonthlyDOWRecurrence":
}
}
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<eRPnmOYeEHA.1656@.TK2MSFTNGP09.phx.gbl>...
> Frank,
> Yes!! Thanks for the help.
> I can now deserialize the matchdata into an ScheduleDefinition object
> without any errors
> However, the object is not deserializing properly?!?
> My matchdata is:
> "<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
> Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
> rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
> nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
> y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
> However, my object (during quickwatch) looks like
> r - ScheduleDefinition (my object)
> EndDate: #12:00:00AM#
> EndDateSpecified: False
> Item: Nothing
> StartDateTime: #12:00:00AM#
> At least the StartDateTime should deserialize properly!
> I've only tried one schedule at this point in time. I'm going to try a
> couple others and see if they do the same thing. I'll post back any
> different results
> Could this be the known bug that Daniel Reib mentioned?
> Thx so much for getting me this far!!
> -Joel|||Ok, FINALLY figured it out...I was not casting the object correctly.
You can refer to my previous post to see some of the outer portions of
code. By the way, I looked at where you got, it appears that you are
not getting any info at all. That definition looks empty, one thing
to note in my first posting is I use a cookie and not the MatchData
variable. So be sure you are using MD instead of my cookie value.
Also be sure you have string XML in your MD variable at that point.
Let me know if you need more clarifcation...and post some code so I
can see more of what you are doing.
case "WeeklyRecurrence":
// THIS WAS THE KICKER FOR ME...that damn def.Item cast.
WeeklyRecurrence recurrence =(TXU.Online.Reports.Web.Objects.WeeklyRecurrence)def.Item;
DaysOfWeekSelector days = recurrence.DaysOfWeek;
this.pnlWeekly.Visible = true;
this.radRecurrence.SelectedValue = "Weekly";
this.txtWeeklyStartMinutes.Text = minute.ToString("00");
if (hour > 12)
{
hour = hour - 12;
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyPM.Checked = true;
}
else
{
if (hour == 0)
this.txtWeeklyStartHour.Text = "12";
else
this.txtWeeklyStartHour.Text = hour.ToString();
this.radWeeklyAM.Checked = true;
}
this.chkWeeklyMonday.Checked = days.Monday;
this.chkWeeklyTuesday.Checked = days.Tuesday;
this.chkWeeklyWednesday.Checked = days.Wednesday;
this.chkWeeklyThursday.Checked = days.Thursday;
this.chkWeeklyFriday.Checked = days.Friday;
this.chkWeeklySaturday.Checked = days.Saturday;
this.chkWeeklySunday.Checked = days.Sunday;
if (recurrence.WeeksIntervalSpecified)
this.txtWeeklyRepeatWeeks.Text =recurrence.WeeksInterval.ToString();
break;
case "MonthlyRecurrence":
case "MonthlyDOWRecurrence":
}
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<eRPnmOYeEHA.1656@.TK2MSFTNGP09.phx.gbl>...
> Frank,
> Yes!! Thanks for the help.
> I can now deserialize the matchdata into an ScheduleDefinition object
> without any errors
> However, the object is not deserializing properly?!?
> My matchdata is:
> "<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
> Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
> rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
> nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
> y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
> However, my object (during quickwatch) looks like
> r - ScheduleDefinition (my object)
> EndDate: #12:00:00AM#
> EndDateSpecified: False
> Item: Nothing
> StartDateTime: #12:00:00AM#
> At least the StartDateTime should deserialize properly!
> I've only tried one schedule at this point in time. I'm going to try a
> couple others and see if they do the same thing. I'll post back any
> different results
> Could this be the known bug that Daniel Reib mentioned?
> Thx so much for getting me this far!!
> -Joel|||Frank,
Thanks so much for the code snippets. Once I get my object to start
deserializing properly at all, I will be able to plugin the code you wrote.
However, you are correct in that the definition once deserialized is empty.
Here's the code I'm using to retrieve and deserialize the object
subscriptions = rs.ListSubscriptions(Nothing, nUserObj.UserName.ToString)
Dim requestSerializer As Xml.Serialization.XmlSerializer
Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
requestSerializer = New
Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
tion), a)
For Each subscription As RS.Subscription In subscriptions
rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
desc, active, status, eventType, matchData, values)
extensionParams = extSettings.ParameterValues
Dim obj As Object = requestSerializer.Deserialize(New
StringReader(matchData))
Dim r As CorporateReporting.RS.ScheduleDefinition = CType(obj,
CorporateReporting.RS.ScheduleDefinition)
When I look at the MatchData I get the XML listed below:
"<ScheduleDefinition><StartDateTime>2004-08-03T08:00:00.000-07:00</StartDate
Time><EndDate>08/20/2004</EndDate><WeeklyRecurrence><WeeksInterval>3</WeeksI
nterval><DaysOfWeek><Monday>True</Monday><Wednesday>True</Wednesday></DaysOf
Week></WeeklyRecurrence></ScheduleDefinition>"
When you say "be sure you have string XML in your MD variable at that point
..." do you mean that I need to add an <?xml version='1.0'?> tag to the
beginning of the string? (I tried that, but it didn't change the object.)
Any help is always appreciated!!
"Stoma_Kalos" <fzuma@.yahoo.com> wrote in message
news:e876e3c8.0408051117.539a5442@.posting.google.com...
> Ok, FINALLY figured it out...I was not casting the object correctly.
> You can refer to my previous post to see some of the outer portions of
> code. By the way, I looked at where you got, it appears that you are
> not getting any info at all. That definition looks empty, one thing
> to note in my first posting is I use a cookie and not the MatchData
> variable. So be sure you are using MD instead of my cookie value.
> Also be sure you have string XML in your MD variable at that point.
> Let me know if you need more clarifcation...and post some code so I
> can see more of what you are doing.
> case "WeeklyRecurrence":
> // THIS WAS THE KICKER FOR ME...that damn def.Item cast.
> WeeklyRecurrence recurrence => (TXU.Online.Reports.Web.Objects.WeeklyRecurrence)def.Item;
> DaysOfWeekSelector days = recurrence.DaysOfWeek;
> this.pnlWeekly.Visible = true;
> this.radRecurrence.SelectedValue = "Weekly";
> this.txtWeeklyStartMinutes.Text = minute.ToString("00");
> if (hour > 12)
> {
> hour = hour - 12;
> this.txtWeeklyStartHour.Text = hour.ToString();
> this.radWeeklyPM.Checked = true;
> }
> else
> {
> if (hour == 0)
> this.txtWeeklyStartHour.Text = "12";
> else
> this.txtWeeklyStartHour.Text = hour.ToString();
> this.radWeeklyAM.Checked = true;
> }
> this.chkWeeklyMonday.Checked = days.Monday;
> this.chkWeeklyTuesday.Checked = days.Tuesday;
> this.chkWeeklyWednesday.Checked = days.Wednesday;
> this.chkWeeklyThursday.Checked = days.Thursday;
> this.chkWeeklyFriday.Checked = days.Friday;
> this.chkWeeklySaturday.Checked = days.Saturday;
> this.chkWeeklySunday.Checked = days.Sunday;
> if (recurrence.WeeksIntervalSpecified)
> this.txtWeeklyRepeatWeeks.Text => recurrence.WeeksInterval.ToString();
> break;
> case "MonthlyRecurrence":
> case "MonthlyDOWRecurrence":
> }
>
> Frank
>
> "Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message
news:<eRPnmOYeEHA.1656@.TK2MSFTNGP09.phx.gbl>...
> > Frank,
> >
> > Yes!! Thanks for the help.
> >
> > I can now deserialize the matchdata into an ScheduleDefinition object
> > without any errors
> >
> > However, the object is not deserializing properly?!?
> >
> > My matchdata is:
> >
"<ScheduleDefinition><StartDateTime>2004-07-28T09:00:00.000-07:00</StartDate
> >
Time><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Sunday>T
> >
rue</Sunday><Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wed
> >
nesday><Thursday>True</Thursday><Friday>True</Friday><Saturday>True</Saturda
> > y></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
> >
> > However, my object (during quickwatch) looks like
> >
> > r - ScheduleDefinition (my object)
> > EndDate: #12:00:00AM#
> > EndDateSpecified: False
> > Item: Nothing
> > StartDateTime: #12:00:00AM#
> >
> > At least the StartDateTime should deserialize properly!
> >
> > I've only tried one schedule at this point in time. I'm going to try a
> > couple others and see if they do the same thing. I'll post back any
> > different results
> >
> > Could this be the known bug that Daniel Reib mentioned?
> >
> > Thx so much for getting me this far!!
> >
> > -Joel|||Joel,
Be careful with your "New" statements...this is just a guess, but you
may try whackin'(removing) that "New" statement in the line below.
You're matchdata looks good, so i'm assuming you are getting a blank
object because your re-initializing your StringReader? I'm not
sure...I have to play with different lines to figure out my code
sometimes. It doesn't help that i'm in C# and you in VB, if I get
time I will VB it, but i'm wading in code as it is.
If at the point of this line you have good data in matchData
(hover/use immediate/watch in Debug), and after that line (step
through) the obj object is empty then that line is your problem. I
always step through in debug and follow my data, once you find out
where it goes wrong that's 75% of the battle. Try that and let me
know how you do.
Dim obj As Object = requestSerializer.Deserialize(New
StringReader(matchData))
Frank
"Joel Rumerman" <JRumerman@.prometheuslabs.com> wrote in message news:<u$R6W5yeEHA.644@.tk2msftngp13.phx.gbl>...
> Frank,
> Thanks so much for the code snippets. Once I get my object to start
> deserializing properly at all, I will be able to plugin the code you wrote.
> However, you are correct in that the definition once deserialized is empty.
> Here's the code I'm using to retrieve and deserialize the object
> subscriptions = rs.ListSubscriptions(Nothing, nUserObj.UserName.ToString)
> Dim requestSerializer As Xml.Serialization.XmlSerializer
> Dim a As New Serialization.XmlRootAttribute("ScheduleDefinition")
> requestSerializer = New
> Xml.Serialization.XmlSerializer(GetType(CorporateReporting.RS.ScheduleDefini
> tion), a)
> For Each subscription As RS.Subscription In subscriptions
> rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings,
> desc, active, status, eventType, matchData, values)
> extensionParams = extSettings.ParameterValues
> Dim obj As Object = requestSerializer.Deserialize(New
> StringReader(matchData))
> Dim r As CorporateReporting.RS.ScheduleDefinition = CType(obj,
> CorporateReporting.RS.ScheduleDefinition)
> When I look at the MatchData I get the XML listed below:
> "<ScheduleDefinition><StartDateTime>2004-08-03T08:00:00.000-07:00</StartDate
> Time><EndDate>08/20/2004</EndDate><WeeklyRecurrence><WeeksInterval>3</WeeksI
> nterval><DaysOfWeek><Monday>True</Monday><Wednesday>True</Wednesday></DaysOf
> Week></WeeklyRecurrence></ScheduleDefinition>"
> When you say "be sure you have string XML in your MD variable at that point
> ..." do you mean that I need to add an <?xml version='1.0'?> tag to the
> beginning of the string? (I tried that, but it didn't change the object.)
> Any help is always appreciated!!
Labels:
according,
attempting,
call,
database,
deserialize,
documentation,
getsubscriptionproperties,
matchdata,
microsoft,
mysql,
object,
oracle,
pull,
retrieved,
scheduledefinition,
server,
sql
Subscribe to:
Posts (Atom)