Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

slow wcf calls

Posted on 2010-08-20
3
Medium Priority
?
580 Views
Last Modified: 2013-11-12
I am using silverlight and WCF calls

My code works but it is slow. I am updating a field in a database table then i make another call to display the currect data to reflect the updated changes. The issue is on my PC there is about 1-2 for the update and new data to display.

 Public Sub webservice_updatedataPlus2Completed(ByVal sender As Object, ByVal e As ServiceReference1.updatedataPlus2CompletedEventArgs)
        If e.Result = True Then
            displayData()
        End If
    End Sub


<OperationContract()> _
        Public Function selectdata(ByVal getID As String) As List(Of sumResult)
        ' Public Function selectdata() As List(Of StudentInfo)
        Dim db2 As New trigB.Web.DataClasses1DataContext
        Dim mylist As New List(Of sumResult)
        'in the path it still says mathsTrainer1




        'what this does is get data from the database in results which is a list undeclared 'variant
        'with this list I populate each record into an existing class.


        Dim myresults = (From p In db2.sumResults _
                         Where p.id = getID _
                      Select p)

        If myresults.Count = 0 Then 'only bother if the user name exists which it will
            Dim temp As New sumResult
            temp.id = "wrong"
            mylist.Add(temp)

            Return mylist

        End If


        Return myresults.ToList



    End Function
    <OperationContract()> _
 Public Function updatedataPlus2(ByVal myid As String, ByVal sec As Integer) As Boolean
        Dim db2 As New trigB.Web.DataClasses1DataContext
        Dim temp As sumResult
        Dim mylist As New List(Of sumResult)


        'what this does is get data from the database in results which is a list undeclared 'variant
        'with this list I populate each record into an existing class.


        Dim myresults = (From p In db2.sumResults _
                        Where p.id = myid _
                        Select p)

        If myresults.Count > 0 Then 'only bother if the user name exists which it will
            For Each p As sumResult In myresults
                p.plus = p.plus + 1
                p.plusTime = p.plusTime + sec

            Next
            db2.SubmitChanges()

            Return True
        End If

        Return False

    End Function

Open in new window

0
Comment
Question by:jagguy
  • 2
3 Comments
 
LVL 1

Expert Comment

by:stuti16
ID: 33487081
Please follow the link.

http://msdn.microsoft.com/en-us/library/aa751883.aspx

also you can

-- set useDefaultWebProxy=false on binding
-- disable wcf security if not required

Hope it will help.
0
 

Author Comment

by:jagguy
ID: 33489792
not big on reading WCF in MSDN for clairty.

where do i do the below
-- set useDefaultWebProxy=false on binding
-- disable wcf security if not required
0
 
LVL 1

Accepted Solution

by:
stuti16 earned 2000 total points
ID: 33503673
within web.config
set useDefaultWebProxy like this way

<bindings>
<basicHttpBinding>
<binding name="binding1" useDefaultWebProxy="true">
</basicHttpBinding>
</bindings>

And
define security as :

<bindings>
    <wsHttpBinding>
        <binding name="binding1">
            <security mode="None">
</wsHttpBinding>
</bindings>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question