Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, am in a distributed project (.NET 2.0).In my project my Database is in server.we are returning DataTable when client needs that.

But the problem is, when my DataTable contains 1000 or more records it takes too long time to return the DataTable.

Is there any other techniques are available in .NET Remoting to return a large DataTable.

I need your guidance

Thanks in Advance

ganesh_IT
Posted

This should provide you with a solution to your problems.
Optimizing Serialization in .NET[^]

Regards
Espen Harlinn
 
Share this answer
 
Comments
JF2015 21-Jan-11 5:05am    
Good reference link.
Espen Harlinn 21-Jan-11 5:10am    
Thanks JF2015
Pravin Patil, Mumbai 21-Jan-11 5:26am    
Very good article...
Espen Harlinn 21-Jan-11 12:19pm    
Thanks Pravin Patil!
What type of remoting are you using?

You have different options for how you communicate with the remote objects, this article describes some of the options. Pay particular attention to the 'Hosting Options' section

.NET Remoting: design decisions and best practicies[^]

"Hosting remote applications on Microsoft Internet Information Services (IIS) involves less development work than hosting applications in Windows services. However, performance with IIS is slower than with Windows services because hosting applications in IIS adds the overhead of a Web server. Also, IIS supports only the HTTP protocol. Because of this limitation, you cannot take advantage of the performance of TCP, which is a protocol with far less overhead."

An application we support uses binary remoting over TCP using a Windows Service on the host server. Performance is really good here, it can handle 1000 rows no problem.

There are a number of places you need to check for performance

* The database itself. Is your query running quickly, does it generate and return the data responsively?
* Object serialization. Is this happening quickly? How many columns in your DataTable etc?
* Communication. Depending on the remoting configuration you have selected, performance will vary.

See this article on MSDN, go to the performance comparison

http://msdn.microsoft.com/en-us/library/ms973841.aspx[^]

""WS_TCP_Binary, as shown above, in which the object is configured to use the TCP channel and the Binary formatter with host being a Windows service, outperforms other distribution techniques. The reason for this is that this approach transmits binary data over raw TCP sockets, which are more efficient than HTTP. and since the data does not have to be encoded/decoded, there is less processing overhead. We see around 60% performance spread between WS_TCP_Binary and the slowest approach."

If your application is internal in nature and security is *less* of a consideration, TCP over binary is probably the way to go.

"If raw speed really is of primary importance, then this "60% performance spread" may be significant. The drawback is the need to host the server inside a Windows service in order to use the TCP protocol (see the earlier section on Remote Hosting). Effectively, this trades off security for performance, and as an approach is "not recommended over the Internet or a non secure Intranet."


So, it's down to you to check these things out and make a decision on the best configuration to choose, based on your user requirement :)
 
Share this answer
 
Hi Espen Harlin,

Thanks for your link but i am beginner in remoting pls explain me in simple way. That article is highly technical.

Thanks in advance
ganesh_IT
 
Share this answer
 
Comments
Hemraj Gujar 21-Jan-11 6:25am    
Hi Ganesh,

I understood from your question that you are working in project where remoting is already implemented, and now your are facing performance issue with remoting. In my opinion, problem could be on Database side, try to check the query which is returning result. check the indexes on table.
Espen Harlinn 21-Jan-11 6:59am    
The article I referenced is the first of a two part series - read the second part too.
The code provided includes samples demonstrating efficient serialization of DataSets

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900