I have reconfigured the WinSchedule Database Demo CS to point to my SQL database. The sample runs fine on the initial run, however, after adding an owner the sample throws an error.
End of Stream encountered before parsing was completed. on line 968 of frmMain.cs
for ( int i = 0; i < this.ultraCalendarInfo1.Owners.Count; i ++ )
If I look in the database table the owner was created successfully.
Please Help.
It would seem possible that one of the fields in the table to which that you have bound the Owners is not large enough to contain the serialized object graph. The likeliest culprit is the AllPropertiesMember field.
That is exactly what is happening...I changed the size of the AllProperties field in my Owners table from 256 to 2048 and it works perfectly now.
Thanks!
Just to expand on this a bit...since the Owner's bindable properties (for example, 'Name') have no limit on the number of characters you can assign to them, you could theoretically have the same problem if someone assigned a value that was 2049 characters to that property. I know that would be absurd but my point is that if you are extending the ability to change Owner properties to the end users, you might want to consider enforcing some kind of maximum on the string lengths to avoind problems.
On the other side of the coin, the typical Owner's bytestream (I think) was somewhere around 600 or so, so 2048 might be overkill. You can use the Owner.Save method to serialize the object graph out to a byte stream, and check out the size. Depending on the type of database field you use, some of them actually reserve that exact number of characters, so you could be wasting server space by allocating a lot more than you need.
I have the exact same problem but changing the AllProperties to varbinary(max) does not change anything.
could my connectionstring configuration perhaps cause any issues?
Private Const DATABASE_CONNECTION_STRING As String = "Provider=SQLNCLI10;Data Source=DEMO-SERVER;Initial Catalog=Centive;User Id=Demo;Password=Demo123;"
OK its definitely not my connectionstring.
I have now added owners without specifying an "email" and "the owner is accessible through the UI" check.
I am using SQL 2008.