.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

Try-Catch block cannot handle exceptions when contacting a Silverlight Client using net.tcp Duplex W

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :WCF
 
I have created a simple duplex WCF for Silverlight 4 clients, using net.tcp binding (.NET Framework 4.0)  The client interface is declared as <ServiceContract()> _ Public Interface IServiceClient <OperationContract(IsOneWay:=True)> _ Sub SendUpdate(ByVal allRecords As List(Of String)) End Interface while the service interface is declared as <ServiceContract(Namespace:="SilverlightService", CallbackContract:=GetType(IServiceClient))> _ Public Interface IService <OperationContract(IsOneWay:=True)> _ Sub Connect() End Interface The service code is implemented like: <ServiceBehavior(ConcurrencyMode:=ConcurrencyMode.Multiple, InstanceContextMode:=InstanceContextMode.Single)> _ <Activation.AspNetCompatibilityRequirementsAttribute(RequirementsMode:=Activation.AspNetCompatibilityRequirementsMode.Allowed)> _ Public Class Service Implements IService 'Keep the list of all the active/connected clients: Public _clients As List(Of IServiceClient) = New List(Of ITrackServiceClient) Public Sub Connect() Implements IService.Connect Dim client = OperationContext.Current.GetCallbackChannel(Of IServiceClient)() Dim clientExist = From p In _clients _ Where p Is client _ Select p If clientExist.Count() = 0 Then Monitor.Enter(_clients) _clients.Add(client) Monitor.E


View Complete Post


More Related Resource Links

How to polling duplex for both Silverlight Client and Winform client?

  

Hi Experts,

I do need your help on this problem. I try to polling duplex for both Silverlight Client and Winform client, similar to

http://petermcg.wordpress.com/2008/11/19/silverlight-polling-duplex-part-4-wpf-client/

Silverlight client use PollingDuplexHttpBinding, however it can’t be used for Winform client(I use WSDualHttpBinding instead; so here need implement expose the same service contract through different endpoint(

Data Points: Building An Out-of-Browser Client With Silverlight 3

  

Silverlight 2 applications are restricted to running inside a browser. However, Silverlight 3 applications can run inside the browser or out. Here we build a social networking app as a standalone Silverlight 3 application.

John Papa

MSDN Magazine June 2009


Video: SharePoint 2010: Silverlight Client Object Model

  
In this video you will learn how to use the SharePoint client object model to program a Silverlight application against SharePoint data. (Length: 9:03)

Video: Developing Silverlight Applications by Using the SharePoint 2010 Client Object Model

  
This demonstration shows how to use the client object model from a Silverlight application. (Length: 11:15)

Duplex contract between web client and server?

  
Hi, Can duplex contract be implemented between web client and server using http as a transport?   Thanks jagaurg

Catch Block question

  
What are the scenarios in which a t-sql catch block will not be called?   I have a SP which does partition management, sometimes i see that partitions have not been properly created... but still the catch block was never called. This is getting very hard to debug.   Can it be that in some timeout scenarios the catch block is not called?

try catch block

  
Hi Guys, I have a very simple question. whether to put the select stmt in try/catch or not? Its advantage,disadvantage if any will be of great help.~Technology Analyst~

Silverlight client object model : Read a document from a document library

  
How do I read/download a document/file from a SharePoint document library using silverlight client object model? The most closest function that I found was: Microsoft.SharePoint.Client.File.OpenBinaryDirect() but this seems to be throwing an exception "Operation not supported".

why doesn't this catch block get reached?

  
I have code for sending an email.  I set a value in my config file for that would throw an smtpfailedrecipient exception.  This exception is being thrown but it isn't reaching the catch block.I get an smtpfailedrecipientexception that is at the send method in the try block.  The error says that the "exception was unhandled by user code".  I don't understand why the catch block isn't being reached.  I thought this would be reached in this situation.  I thought this is what the catch block was for.Can someone please help me understand how to design this better or why this isn't working the way I thought it would? try { client.Send(message); <-- this throws the exception } catch (SmtpFailedRecipientsException ex) { #region Catch logic for (int i = 0; i < ex.InnerExceptions.Length; i++) { SmtpStatusCode status = ex.InnerExceptions[i].StatusCode; if (status == SmtpStatusCode.MailboxBusy || status == SmtpStatusCode.MailboxUnavailable) { lblMessage.Visible = true; lblMessage.Text = "Deli

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object m

  

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object model ??

This is my code :

ClientContext clientContext = ClientContext.Current;
                Web oWebsite = clientContext.Web;
                ListCollection collList = oWebsite.Lists;
                ListItem oListItem;

                List oList = clientContext.Web.Lists.GetByTitle("Employees");

                oListItem = oList.AddItem(new ListItemCreationInformation());
                oListItem["Title"] = "My new item";

oListItem["Geography"] = "Kroea";//This is MetaData Field

oListItem.Update();

 

the oListItem["Geography"] = "Kroea" must be formatted like oListItem["Geography"] = "2;#Kroea",that code will be worked.

The "2

How to Catch and Process Client Side When a TextBox Changes

  

VWD 2008 Express.  Visual Basic.  JavaScript.

I have a gridview control that is populated with lesson grades (GradeTextBox) and lesson completion dates (GDateTextBox), both of which are in textboxes.  I want to do the following on the client side:

When a grade is entered or changed in the grade textbox, I want to detect (trap) the change and run some javascript code that automatically updates the lesson completion box.  Since the text control clientIDs are assigned dynamically for each row of the gridview, I also have the problem of determining the clientID for the lesson completion date textbox associated with the grade textbox.  

(1) How do I trap the event of the grade textbox changing?, and

(2) How do I determine the clientID for the lesson completion date textbox associated with the grade that just changed, so that I may automatically set the date?

I have tried adding an "afteredit=" to the grade textbox, but it never reaches the code.  Here is the HTML for the gridview with the two textboxes in red:

                    <asp:GridView ID="GradesGridView" runat="server"  
                        DataSourceID="SqlDataSourceGrades" Width="96%" AutoGenerateColumns="Fals

Silverlight Client Object Model - List Fields Names

  

I'm trying to get the DisplayName of the Fields of a list through the Client Object Model (Silverlight)

I can retrieve the fields of a list as an authenticated user but not as anonymous: getting list.fields as anonymous simply returns Access Denied.

Is there a way to enable list.fields for the Client Object Model?

Or is there any other way of getting the DisplayName of Fields of a List?


How to deploy custom assembly to Sharepoint and invoke it from Silverlight or WPF client?

  

I apologize upfront because my questions are probably trivial, but I don’t even know the correct wording to search for solution. We have C# assembly which performs some OpenXML processing and now we need to “plant” it to Sharepoint 2010 server, so that it can be invoked from the client to work on server documents.

 

1.     How (in what form) do we deploy it to the server, so that it is accessible (invocable) from the client code? We use VS 2010 for development.

2.    

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object m

  

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object model ??

This is my code :

ClientContext clientContext = ClientContext.Current;
                Web oWebsite = clientContext.Web;
                ListCollection collList = oWebsite.Lists;
                ListItem oListItem;

                List oList = clientContext.Web.Lists.GetByTitle("Employees");

                oListItem = oList.AddItem(new ListItemCreationInformation());
                oListItem["Title"] = "My new item";

oListItem["Geography"] = "Kroea";//This is MetaData Field

oListItem.Update();

 

the oListItem["Geography"] = "Kroea" must be formatted like oListItem["Geography"] = "2;#Kroea",that code will be worked.

The "2

Try Catch block is not work that try block failed but catch block is not excuted

  

I am facing the problem: Try Catch block is not work that try block failed but catch block is not excuted.

In my case, I tried to excuted the sql like below:

begin try

update [table] set [column] = abc

end try

begin catch
 select 'catch error'
end catch

 

The [column] is numeric format, but data set to it is not valid number.

When excute this sql, the following error prompt out:

Invalid column name 'abc'.

And the catch block has not been excuted.

 

I want to know what happen in this case.

Moreover, I found an article talks about the similar case too:

http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/05/13/your-try-block-may-fail-and-your-catch-block-may-be-bypassed.aspx

 

Is there any solution so that I can catch the error without stopping the batch?

Thanks a lot.


Please Help Catch Exceptions on asp.net OLAP GridView

  

Hello,

I am fairly new to the asp.net scene. Having build a dashboard gathering info on my OLAP system's health status, I can't seem to figure out how to make sure that I catch the no connection exception.

I use the following statements on the datagrid:

a) want to change the color of ssas2 button to red if an exception is thrown

 

Dim MyDBConn As New

OleDb.OleDbConnection

 

MyDBConn.ConnectionString =

"Provider=MSOLAP.4;Data Source=core-ssas2;Integrated Security=SSPI;Initial Catalog=Financials;Connect Timeout=6000"

 

Try

MyDBConn.Open()

MyDBConn.CreateCommand.CommandTimeout = 120

 

Ca

Please Help Catch Exceptions on asp.net OLAP GridView

  

Hello,

I am fairly new to the asp.net scene. Having build a dashboard gathering info on my OLAP system's health status, I can't seem to figure out how to make sure that I catch the no connection exception.

I use the following statements on the datagrid:

a) want to change the color of ssas2 button to red if an exception is thrown

 

Dim MyDBConn As New

OleDb.OleDbConnection

MyDBConn.ConnectionString =

"Provider=MSOLAP.4;Data Source=core-ssas2;Integrated Security=SSPI;Initial Catalog=Financials;Connect Timeout=6000"

<
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend