473,668 Members | 2,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem displaying 40,000 - 60 char entries in a text box.

Ty
I have a problem that should be relatively easy to fix but the solution just
seems to elude me.

I am creating a Windows app that contains a text box that I wish to fill
with data from a file. The file contains approximately 40k, 60 character
entries and it is taking an enormous amount of time to load the file contents
into the text box. Is there some way to speed this up?

I am currently reading an entry from the file and using the code:
FileNameTextBox .Text += sFileEntry;
to display the entry.

Thanks,
Ty
Mar 14 '06 #1
4 1505


"Ty" wrote:
I have a problem that should be relatively easy to fix but the solution just
seems to elude me.

I am creating a Windows app that contains a text box that I wish to fill
with data from a file. The file contains approximately 40k, 60 character
entries and it is taking an enormous amount of time to load the file contents
into the text box. Is there some way to speed this up?

I am currently reading an entry from the file and using the code:
FileNameTextBox .Text += sFileEntry;
to display the entry.

Thanks,
Ty


I faced a similar problem a while ago and did this:

StringBuilder sb = new StringBuilder() ;
// Append the 40,000 entries to sb
FileNameTextBox .Text += sb.ToString();

Worked great for me!

I hope this helps.
-Jeff
Mar 14 '06 #2
Jeff wrote:
StringBuilder sb = new StringBuilder() ;
// Append the 40,000 entries to sb
FileNameTextBox .Text += sb.ToString();


That really should be:

SringBuilder sb = new StringBuilder(2 400000);
// Append the 40,000 entries to sb
FileNameTextBox .Text += sb.ToString();
--
Truth,
James Curran [erstwhile-MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
Mar 15 '06 #3
Ty wrote:
I am creating a Windows app that contains a text box that I wish to
fill with data from a file. The file contains approximately 40k, 60
character entries and it is taking an enormous amount of time to load
the file contents into the text box. Is there some way to speed this
up?

Well, I'm not sure if it well be any faster, but I'll bet this will be
more useable:
put them in a listbox.
--
Truth,
James Curran [erstwhile-MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
Mar 15 '06 #4
Hello Ty,

Are u really need all data being showed on the screen? Seems no. Just fill
that box async in the form start, thus fillin' of the box will be performed
in the background

T> I have a problem that should be relatively easy to fix but the
T> solution just seems to elude me.
T>
T> I am creating a Windows app that contains a text box that I wish to
T> fill with data from a file. The file contains approximately 40k, 60
T> character entries and it is taking an enormous amount of time to load
T> the file contents into the text box. Is there some way to speed this
T> up?
T>
T> I am currently reading an entry from the file and using the code:
T> FileNameTextBox .Text += sFileEntry;
T> to display the entry.
T> Thanks,
T> Ty
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
9846
by: Brandon McCombs | last post by:
This may be the wrong group but I didn't see anything for VC++ so I'm trying here. I have a C++ book by Deitel and Deitel that says I can use fstream File("data.dat", ios::in | ios::out | ios::binary) to declare a file object with read/write modes turned on for working with binary data. I've tried this and my file is not created. The only time it is created is when I specify ifstream or ofstream but not fstream. I've tried removing the...
4
1855
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
Hey, Well, I have a Problem. I have designed a table which has few fields which are being declared in the database of type .... char of length 10. and other fields with varchar 50 and datetime too. Well, the Problem is I am not able to display the CHAR type FIELDS in the
20
2494
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using insert-statements. after initalizing and starting postgres 7.4 on a different port and datadirectory, i tried to import the sql-dump with the copy statements. this import fails, but importing the dump-file with inserts took a long time but was...
3
1531
by: Chris H | last post by:
Ok in the following code I am trying to have my keywards meta tag auto insert the top 10 titles from most recently added database entries, right now the while loop is only setting the $keyword varibale with one title and not the top 10.. not sure what i am doing wrong... Note: keyword retrival code will be between ######## //comment CODE #######
5
3530
by: H J van Rooyen | last post by:
Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: Current entry Company : entered co. name First entry : entered stuff The second entry: more entered stuff
5
2372
by: dav3 | last post by:
I am by no means an ultra slick programmer and my problem solving skills.. well they leave much to be desired. That being said I have been working on the following problem for the past few days and have yet to find a solution. My program is supposed to read in a txt file which contains 2 lines of numbers. Program reads the file and stores each line as a string, then converts each character to an integer. Once char is converted to an int the...
5
1719
by: Chad | last post by:
say my input file is $ more suck ______ < gnu? > ------ \ , , \ /( )` \ \ \___ / | /- _ `-/ '
0
1275
by: cappa | last post by:
hi, i've some problem to print to screen and save date in mysql if the entries contain char like à,è... i try to read some post but i'm not able to solve my problem. i use easyphp 1.8 with apache 1.3.33-php 4.3.10-mysql 4.1.9 SO:windows vista home premium in php.ini i've: default_charset = "utf-8"
3
1310
by: Robert Bevington | last post by:
Hi all, I ran into memory problems while tying to search and replace a very large text file. To solve this I break the file up into chunks and run the search and replace on each chunk. This works fine and has solved the OutOfMemory problem. However, on the last loop when the array c is written to CleanTMX, a number of 0x00 characters are written at the end of the file. This causes problems in a further XMLTransformation as this...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8889
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8652
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.