This question is locked. New answers and comments are not allowed.
Dear Everyone,
I am now 2 days struggling to get the OA working instead of my previous Microsoft EF-4.
I created a sample project structure Client and server(.web) then I created a RIA service project (2 projects, client & server), then i setup the reference between the Client & Server projects.
I then added the OA DataModel and then OA DomainService.
I add the Data Access code in one of my SL client applications that need access to the Database, I found that I can reference the DomainContext class not the DomainService class, How can I access the DomainService here?
I start dealing with the DomainContext, I try change one of the entities and call the SubmitChanges() on the DomainContext I added the Try/catch as follows:
it doesn't catch anything but IE through this error:
Any Idea of how can I handle the exception here
I am using RIA services, SL4.
Any help ..
Greetings
I am now 2 days struggling to get the OA working instead of my previous Microsoft EF-4.
I created a sample project structure Client and server(.web) then I created a RIA service project (2 projects, client & server), then i setup the reference between the Client & Server projects.
I then added the OA DataModel and then OA DomainService.
I add the Data Access code in one of my SL client applications that need access to the Database, I found that I can reference the DomainContext class not the DomainService class, How can I access the DomainService here?
I start dealing with the DomainContext, I try change one of the entities and call the SubmitChanges() on the DomainContext I added the Try/catch as follows:
if (Context.HasChanges == false) return false; try{ Context.SubmitChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); return false; } return true;it doesn't catch anything but IE through this error:
Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E) Timestamp: Tue, 5 Apr 2011 17:34:12 UTC Message: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.ServiceModel.DomainServices.Client.DomainOperationException: Submit operation failed due to conflicts. Please inspect Entity.EntityConflict for each entity in EntitiesInError for more information. at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error) at System.ServiceModel.DomainServices.Client.SubmitOperation.Complete(OperationErrorStatus errorStatus) at System.ServiceModel.DomainServices.Client.DomainContext.CompleteSubmitChanges(IAsyncResult asyncResult) at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClassd.<SubmitChanges>b__5(Object ) Line: 56 Char: 13 Code: 0 URI: http://localhost:13256/MyTestPage.aspx Any Idea of how can I handle the exception here
I am using RIA services, SL4.
Any help ..
Greetings