473,326 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to Handle DataServiceException in Silverlight Client

Hi,

I've got a simple Silverlight 2.0 app set up and talking with an webservice
using ado.net entity datamodel. In the webservice I have a
ChangeInterceptor declared like this:

<ChangeInterceptor("CodePropAttributeTypes")_
Public Sub OnChangeCategories(ByVal p As
myEntities.CodePropAttributeTypes, ByVal action As UpdateOperations)
If action = UpdateOperations.Add Then
Throw New DataServiceException(400, "Test Insert Error")
ElseIf action = UpdateOperations.Change Then
Throw New DataServiceException(400, "Test Update Error")
End If
End Sub

I've set breakpoints and I can step thru the code and see that the code is
being run properly. The problem is I have no idea how to handle this
exception on the Silverlight client. My async callbacklooks like this:

Private Sub subChangesComplete(ByVal ar As System.IAsyncResult)
Try
_entityProxy.EndSaveChanges(ar)
'datagrid is not in edit mode anymore
_blnInEdit = False
System.Windows.Browser.HtmlPage.Window.Alert("Chan ges Saved")
Catch ex As Exception
System.Windows.Browser.HtmlPage.Window.Alert(ex.Me ssage &
ControlChars.NewLine & ex.InnerException.Message)
End Try
End Sub

The IAsyncResult does not seem to contain any exception indications so I'm
curious as to how the exception should make itself known to the client.

Thanks
Aug 4 '08 #1
0 1247

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michel Claveau | last post by:
Hi! SilverLight ("MS flash killer"), is a plug-in for InternetExplorer (Win), FireFox (Win), and Safari (Mac). The release 1.1-Alpha come with JScript & Python (or ironPython?) See :...
4
by: Ronald S. Cook | last post by:
I'm a Visual Studio developer confused by seeing these new products coming out... Expression and Silverlight. Is Expression maybe a successor to FrontPage and is Silverlight maybe something to...
5
by: Jassim Rahma | last post by:
can anyone tell me what are the required files to develop a basic video player website with ASP.NET and silverlight anf what are the optional files?
2
by: m.a | last post by:
Hello, I installed MSVC 2008 express and I like to install silverlight. Can I do this? Thenone that I got from silverlight web site, complain about msvc version. Regards
18
by: Artificer | last post by:
Any idea if MS will try to promote Silverlight over ASP.NET for web development or will silverlight remain just as a adobe's flash like tecnology?
3
by: Laura | last post by:
Hi: ¿How can I read a file on the client side without loading it to the server?
13
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
This is a follow-up to my post "Silverlight video doesn't work when file is streamed from handler in ASP.net" at...
1
by: Bradley Plett | last post by:
Is ActiveX still the only technology to allow for a full-featured application hosted in a browser? Specifically, I need an application, hosted in a browser (i.e. on a web page), that is capable of...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.