This is a migrated thread and some comments may be shown as answers.

Using linq to sql for resources

2 Answers 133 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ian Blackburn
Top achievements
Rank 1
Ian Blackburn asked on 28 Apr 2008, 11:22 AM
Hi,

I can use a Linq Data Source for the scheduler without a problem withour resources.

However if I have one linq datasource for the scheduler and another for a resource I get the following error:

Cannot access a disposed object.
Object name: 'DataContext accessed after Dispose.'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'DataContext accessed after Dispose.'.


This is Linq to Sql untouched just pointing to a table and related table with the following aspx:

<

telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Web20"

DataEndField="End" DataKeyField="CourseId" DataRecurrenceField="RecurrenceRule"

DataRecurrenceParentKeyField="RecurrenceReferenceId"

DataSourceID="LinqDataSource1" DataStartField="Start"

DataSubjectField="Subject">

<ResourceTypes>

<telerik:ResourceType DataSourceID="LinqDataSource2" ForeignKeyField="CentreId"

KeyField="CentreId" Name="Resource Type 0" TextField="Name" />

</ResourceTypes>

</telerik:RadScheduler>

<asp:LinqDataSource ID="LinqDataSource1" runat="server"

ContextTypeName="BcNetAppLogic.BcNetDataContext" EnableDelete="True"

EnableInsert="True" EnableUpdate="True" TableName="Courses">

</asp:LinqDataSource>

<asp:LinqDataSource ID="LinqDataSource2" runat="server"

ContextTypeName="BcNetAppLogic.BcNetDataContext" EnableDelete="True"

EnableInsert="True" EnableUpdate="True" TableName="Centres">

</asp:LinqDataSource>

Any ideas if this should be possible?

2 Answers, 1 is accepted

Sort by
0
Ian Blackburn
Top achievements
Rank 1
answered on 28 Apr 2008, 11:58 AM
If there is no simple answer to above, could you point me to a url for manually adding a resource to an appointment (and hving the advanced editor show it).

Cheers

Ian
0
Peter
Telerik team
answered on 28 Apr 2008, 01:31 PM
Hi Ian,

Please, refer to the KB article on RadScheduler with LinqDataSource. Part IV is about adding resources.
 
Let us know if you have any other questions.


All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Ian Blackburn
Top achievements
Rank 1
Answers by
Ian Blackburn
Top achievements
Rank 1
Peter
Telerik team
Share this question
or