1
Answer

Slow return to wcf

Photo of Nadia Teles

Nadia Teles

12y
1.1k
1
Hello.

I have a Silverlight application that performs queries to the database SQL Server. In a table I have 1 million entries, as follows:

starts with the letter A: 130.000

starts with the letter B:  16.000

starts with the letter C:  70.000

When I run the query the first time, in case the letter A, the return is faster, the later will become increasingly slow. The impression I have is that the buffer will accumulate data.

Does anyone have an idea how to solve this?

To work with large amounts of data and simultaneous queries, how do I configure the properties of the protocol NetTcpBinding in web.config?

Thankyou.

Teles

Answers (1)

0
Photo of Vulpes
NA 98.3k 1.5m 12y
Assuming there's only one GUID in each file or it's just the first one you need to match, then this is easily done using a regular expression.

Here's some sample code:

using System;
using System.IO;
using System.Text.RegularExpressions;

class Test
{
   static void Main()
   {
      string regExp = 
      @"(?i)\b" +
      @"[0-9A-F]{8}-" +
      @"[0-9A-F]{4}-" +
      @"[0-9A-F]{4}-" +
      @"[0-9A-F]{4}-" +
      @"[0-9A-F]{12}" +
      @"\b";

      string text = File.ReadAllText("darma.xml");
      string guid = Regex.Match(text, regExp).Value;
      Console.WriteLine(guid);

      string text2 = File.ReadAllText("darma.ini");
      string guid2 = Regex.Match(text2, regExp).Value;
      Console.WriteLine(guid2);

      if (guid == guid2)
         Console.WriteLine("Files are the same");
      else
         Console.WriteLine("Files are not the same");
      Console.ReadKey();
   }
 
 


Accepted
0
Photo of darma teja
NA 493 194.3k 12y
Wonderful!!!

Thanks allot!!!