Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Thursday, March 22, 2012

Detecting whether table contents have changed

If I start with table1 and take a copy of it, call it table2.
How can I later determine whether there have been any changes have been made to table2 since the copy (so I can determine whether I need to copy back the changes to table1).

I'd like to use a 'last-updated-date' on the table, but I can't seem to find anything like that in the system tables.

I'm considering using:
exec sp_table_validation
to get checksums of table1 and table2 (I have no image, text or ntext fields) so this should work fine, though might be slow (since I'd have to select the full count(*) option).
I'd prefer to use timestamps if they're available.

And no, I don't want to use triggers.

Thanks,

- Andy AbelOther than using to trigger to *log* changes, you would have to do a full table *scan* to find the differences. This sure would take a long time to step through a large table.

Detecting whether a trace is running

We have had some problems with getting a trace restarted after capturing the
trace output to a table. Is there a query or API call that can determine i
f a server trace is running?Randy,
I believe that fn_trace_getinfo (0) will give you what you need.
Russell Fields
"Randy Hersom" <anonymous@.discussions.microsoft.com> wrote in message
news:3FAA134B-9472-4AC7-B619-128FD7B5B6B0@.microsoft.com...
> We have had some problems with getting a trace restarted after capturing
the trace output to a table. Is there a query or API call that can
determine if a server trace is running?
>sql

Wednesday, March 21, 2012

Detect and Passing measure name in Action

Is there a way when launching action to call a URL, I can pass the name of the measure select by users?

We have a cube with multiple measures (included calculated member measures), when a user select a cell under measure A, I need to pass the name A to the URL to ASP.NET application. Similarly, when a user click measure B cell to fire up action, I need to pass measuer name B on URL the the web applicatoin.

Currently, I can pass dimension CurrentMember w/o problem, is there a similar measure CurrentMember function I can use?

Thanks!

CurrentMember should work on the Measures dimension in exactly the same way as on other dimensions, so by using something like Measures.CurrentMember.Name you should be able to get hold of the name of the current measure. Using the UrlEscapeFragment function (see http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!517.entry) will get rid of any url-unfriendly characters.

Chris

Friday, March 9, 2012

Detach sql2000 msde database using SMO.

Hello,

I am trying to detach a database from an instance of msde 2000 using smo. When I call the Server.DetachDatabase function using my valid server object I get the following error.

"This method or property is accessible only while working against SQL Server 2005 or later."

Does anyone know if it is possible to detach a msde database using the .net smo objects.

What I am trying to do is detach the database and then re-atach to an instance of sqlexpress. I thought about just stopping the server and copying the mdf file to a new location but I cannot figure out how to stop the server and restart it using smo.

Thanks,

Oh you don't have to go through all of that trouble just use the transfer class. Be sure to look at the information in MSDN regarding the Transfer class (specifically regarding its limitations). But going from 2000 to a 2005 DB should be well within its capabilities. Use the overloaded constructor that takes an existing database object to get started.

Hope this helps.

Michael

|||I suspect this may be a bug that you are running into. Detaching a SQL Server 2000 Database is supported by SMO. Could you post a small repro source code here so I can take a look?|||

Here is the main part of the code. I get an exception on the detach function that tells me that this function is valid on sql2005 databases only. The server object is valid and connected and the function will work on a 2005 database.

Dim KBMSS As Server = Nothing

Dim svc As New ServerConnection

With svc

.ApplicationName = Application.ProductName

.ServerInstance = ServerName

.StatementTimeout = 30

.LoginSecure = False

.Login = "sa"

.Password = "kbmsa"

End With

KBMSS = New Server(svc)

KBMSS.DetachDatabase("KBM", False)

|||

I've had a similar message when attempting to itterate through triggers in a database

connects =

m_srvconnSelectedServerConnection.ServerInstance = comboServer.Text;
m_srvconnSelectedServerConnection.LoginSecure = false;
m_srvconnSelectedServerConnection.Login = this.textUser.Text;
m_srvconnSelectedServerConnection.Password = this.textPassword.Text;
m_serverSelectedServer = new Server(m_srvconnSelectedServerConnection);

itterate triggers =

Database SelectedDatabase = m_serverSelectedServer.Databases[comboDB.Text];

foreach (Trigger trgTRG in SelectedDatabase.Triggers)
{
}

version of connected server reports =

?m_serverSelectedServer.Information.Version
{8.0.760}

cheers

Detach sql2000 msde database using SMO.

Hello,

I am trying to detach a database from an instance of msde 2000 using smo. When I call the Server.DetachDatabase function using my valid server object I get the following error.

"This method or property is accessible only while working against SQL Server 2005 or later."

Does anyone know if it is possible to detach a msde database using the .net smo objects.

What I am trying to do is detach the database and then re-atach to an instance of sqlexpress. I thought about just stopping the server and copying the mdf file to a new location but I cannot figure out how to stop the server and restart it using smo.

Thanks,

Oh you don't have to go through all of that trouble just use the transfer class. Be sure to look at the information in MSDN regarding the Transfer class (specifically regarding its limitations). But going from 2000 to a 2005 DB should be well within its capabilities. Use the overloaded constructor that takes an existing database object to get started.

Hope this helps.

Michael

|||I suspect this may be a bug that you are running into. Detaching a SQL Server 2000 Database is supported by SMO. Could you post a small repro source code here so I can take a look?|||

Here is the main part of the code. I get an exception on the detach function that tells me that this function is valid on sql2005 databases only. The server object is valid and connected and the function will work on a 2005 database.

Dim KBMSS As Server = Nothing

Dim svc As New ServerConnection

With svc

.ApplicationName = Application.ProductName

.ServerInstance = ServerName

.StatementTimeout = 30

.LoginSecure = False

.Login = "sa"

.Password = "kbmsa"

End With

KBMSS = New Server(svc)

KBMSS.DetachDatabase("KBM", False)

|||

I've had a similar message when attempting to itterate through triggers in a database

connects =

m_srvconnSelectedServerConnection.ServerInstance = comboServer.Text;
m_srvconnSelectedServerConnection.LoginSecure = false;
m_srvconnSelectedServerConnection.Login = this.textUser.Text;
m_srvconnSelectedServerConnection.Password = this.textPassword.Text;
m_serverSelectedServer = new Server(m_srvconnSelectedServerConnection);

itterate triggers =

Database SelectedDatabase = m_serverSelectedServer.Databases[comboDB.Text];

foreach (Trigger trgTRG in SelectedDatabase.Triggers)
{
}

version of connected server reports =

?m_serverSelectedServer.Information.Version
{8.0.760}

cheers

Detach sql2000 msde database using SMO.

Hello,

I am trying to detach a database from an instance of msde 2000 using smo. When I call the Server.DetachDatabase function using my valid server object I get the following error.

"This method or property is accessible only while working against SQL Server 2005 or later."

Does anyone know if it is possible to detach a msde database using the .net smo objects.

What I am trying to do is detach the database and then re-atach to an instance of sqlexpress. I thought about just stopping the server and copying the mdf file to a new location but I cannot figure out how to stop the server and restart it using smo.

Thanks,

Oh you don't have to go through all of that trouble just use the transfer class. Be sure to look at the information in MSDN regarding the Transfer class (specifically regarding its limitations). But going from 2000 to a 2005 DB should be well within its capabilities. Use the overloaded constructor that takes an existing database object to get started.

Hope this helps.

Michael

|||I suspect this may be a bug that you are running into. Detaching a SQL Server 2000 Database is supported by SMO. Could you post a small repro source code here so I can take a look?|||

Here is the main part of the code. I get an exception on the detach function that tells me that this function is valid on sql2005 databases only. The server object is valid and connected and the function will work on a 2005 database.

Dim KBMSS As Server = Nothing

Dim svc As New ServerConnection

With svc

.ApplicationName = Application.ProductName

.ServerInstance = ServerName

.StatementTimeout = 30

.LoginSecure = False

.Login = "sa"

.Password = "kbmsa"

End With

KBMSS = New Server(svc)

KBMSS.DetachDatabase("KBM", False)

|||

I've had a similar message when attempting to itterate through triggers in a database

connects =

m_srvconnSelectedServerConnection.ServerInstance = comboServer.Text;
m_srvconnSelectedServerConnection.LoginSecure = false;
m_srvconnSelectedServerConnection.Login = this.textUser.Text;
m_srvconnSelectedServerConnection.Password = this.textPassword.Text;
m_serverSelectedServer = new Server(m_srvconnSelectedServerConnection);

itterate triggers =

Database SelectedDatabase = m_serverSelectedServer.Databases[comboDB.Text];

foreach (Trigger trgTRG in SelectedDatabase.Triggers)
{
}

version of connected server reports =

?m_serverSelectedServer.Information.Version
{8.0.760}

cheers

Sunday, February 19, 2012

Design Question

I am struggling to decide which the following two design is better choice in terms of performance:

Here is exisiting system has table call SalesDetail, which has typical sales amount, sales cost, etc measures, it also includes field like locationCode (varchar), companyCode(varchar). There is identity key field call TransID, which acts like GUID, all other tables in the system has this TransID.

1) One design is there are "lookup" table in the system such as location (locationCode, locationname), company (companyCode, companyName), so I can have my factSalesDetail with all exsiting field, I can join locationCode to the location "Lookup" table, creating one-many relationship, essentially I use these "lookup" table as Dimension such as dimLocation, etc. This gives us wider FactTable since it is included all "locationCode", etc.

2) Or I can use GUID "TransID" of SalesDetail Fact, to join prebuild CompanyTable in datamart, which has all Location, Companyname, code there. so this gives me shorter factTable (only including true measurement), but deeper and bigger DimensionTable with more records than "lookup" dimensionTable"

The factTable is quite large (26 million records), which design is better in terms of performance?

If the transaction's relationship to location is through company, then my advice would be to model it that way unless it would be confusing to end-users.

Regarding performance, look into partitioning. HOLAP may be another interesting option for you, but I would try to stick with MOLAP if you can get away with it. Watch the processing steps to grab the SQL and make sure your relational database is tuned to help those queries run as quickly as possible. Also, look into replace any GUID fields used for joins with integer values as this will reduce space which could give you a performance boost (by reducing the number of data pages needing to be read).

Good luck,
Bryan

|||

Thanks Bryan for your advice. So basically you think Design Mode 2) could be good route to go, which use GUID like TrasID join prebuilt Company table includes all information regarding the company. I actually test both choices, Design 2 has smaller size and prcessing little bit faster, currently it is about 20-22 minutes.

I also would like to ask your advice on processing, the whole database has 15 cubes but salesDetail accounts for half of the size and processing time. What do you think the better processing strategy? Currently I setup Full Process for whole AS DB using Cube Processing Task at SSIS, it takes about 36-42 minutes. There is also Process Default which seems doing nothing. Should I process the biggest cube in this case salesTransaction separately?

I try to do ProcessData to this Cube, and I check "Prcess Affected Object" but it still gives me error:"Errors in the OLAP storage engine: The attribute key cannot be found". since new record has been added in the dimension table. Do I miss something, I though if you choose "Prcess Affected Object", OLAP engine should be smart enough to figure it out.

|||

If there is time to pull it off, I go with full processing. It's just cleaner and easier to execute. But again, you have to have the time to do it.

Regarding "Process Affected Objects", I have used this in the context of processing a dimension and having associated partitions being automatically reprocessed. It may be that it only works that one direction. (Kinda makes sense actually. If I processed a partition but instructed SSAS to first process any associated dimensions, I could invalidate a bunch of other partitions associated with those dimensions.)

So, one question I have is do you have 15 cubes or 15 measure groups in one cube?

Thanks,
Bryan

|||

Hi Bryan, thanks again for your advice. for now I think I can pull it off by doing full process since it only takes around 40 minutes. I have 15 cubes, not measure groups. in terms of size, I have 5 cubes have facttable records about 24 million, 15 million, 9.4 million, 9.2 million and 3 million, all others are about half million records.

One thing I cannot do is partition since we are using standard edition of SQL 2005.

Tuesday, February 14, 2012

Design Choices

I have 20-30 action queries which will be executed nightly. Is it better to place them in a DTS package and call the package, or place them in a stored procedure and call the stored procedure?If you are using a Access dtabase on a web site and using an inc file for your data connections I can down load the database and crack security. As for the performance of Acess it sucks over 1,000,000,000 records.|||This is for a SQL Server database. I'm not looking for your opinion on Access|||depends on what your action queries do. If you need to move data then DTS is the way to go. If you need to work with data inside SQL server then I would faver stored procedures.

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!!