Solved

slow wcf calls

Posted on 2010-08-20
3
548 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Formatting DateTime String Value 5 68
How to repeat the data 4 43
Problem to Office 1 67
msiexec won't run 4 26
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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…

734 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