Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 15th, 2004, 09:40 AM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using DataSet in the memory cache??

I would like to know a way to use the DataSet in a memory cache into a C# application.

I only found examples in ASP.NET applications that they are not accepted in the C# application.

I am needing to improve the performance of my application and would like to know as to store in cache the content of a DataSet.

Thanks...
 
Old June 15th, 2004, 09:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

IMO, the cache is only useful for ASP.NET applications, to save the data between page calls.

In a desktop application, there is no need to cache. Just define a DataSet in your application somewhere (in the form's code, or in some business layer), feed it the data you have and that's it. The DataSet will be available through the life of the application.

Is this what you're after? Or do you have different requirements?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 15th, 2004, 12:11 PM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar;

Thanks for your reply;

I use one LOOP FOR to cover all the registers of a table that they are in one DATASET.

Inside of this LOOP FOR I use a method that consults another table and returns the values for a STRING that to the end is added to a RICHTEXTBOX.

Do you have some suggestion to improve the performance of this code.

My code below:

for (int i = 0; i <thisDataSetNumerosDeRegistro.Tables ["coleta"].Rows.Count; i++) {
                                thisDataSetTodosDadosTabela = ptcol.capturaTodosDadosTabelaColeta (thisDataSetNumerosDeRegistro.Tables ["coleta"].Rows [i]["NUMERODECAMPO"].ToString ());
                                    TodosDadosAchados += this.preparaDadosFormularioColeta (thisDataSetTodosDadosTabela); }//final do FOR

                                    ptconfere.rtfTextGeral.Text = TodosDadosAchados;

Thanks....
 
Old June 15th, 2004, 01:19 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

One way to optimize this is to use a StringBuilder instead of concatenating strings, which is pretty slow. Look here for more info:
http://msdn.microsoft.com/library/de...classtopic.asp

I am off now. Watching the Netherlands play football against Germany.....


Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
memory allocation for a dataset kalyanykk ASP.NET 2.0 Basics 3 August 12th, 2008 02:24 AM
clear the cache disk memory in firefox cse.sandeep ASP.NET 2.0 Professional 0 October 24th, 2007 07:39 AM
Fill(dataset) or dataset.load() salemkoten SQL Server 2005 1 November 2nd, 2006 11:04 PM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.