473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Read File again

Ray
Hello World,

I have a Winform that reads records from a CSV file. It displays the record
(if <field= TextBox1.Text) and fills the other textboxes and lables
with the info. So far so good. But when I give another request then nothing
happens because the program has reached the End of the CSV file.
Is there a way to restart the program without exiting and run again? A sort
of refresh? Or a way to let it read the file again..?

Here's the loop:

Do While Not objparser.EndOfData
Dim strvelden() As String = objparser.ReadFields

If conf = strvelden(5) Or conf = strvelden(1) Then

lblLogical.Text = strvelden(1)
txtSnr.Text = strvelden(5)
txtOwner.Text = strvelden(3)
txtOS.Text = strvelden(6)
txtSoort.Text = strvelden(0)
txtType.Text = strvelden(4)
txtScan.Text = strvelden(7)
txtLogonuser.Text = strvelden(8)

End If
Loop
Ray

Mar 2 '07 #1
1 1077
Ray,

Don't use a Do While loop. You are looping through all the rows of data in
the file and what ends up in the textboxes is data from the last row.

Kerry Moorman
"Ray" wrote:
Hello World,

I have a Winform that reads records from a CSV file. It displays the record
(if <field= TextBox1.Text) and fills the other textboxes and lables
with the info. So far so good. But when I give another request then nothing
happens because the program has reached the End of the CSV file.
Is there a way to restart the program without exiting and run again? A sort
of refresh? Or a way to let it read the file again..?

Here's the loop:

Do While Not objparser.EndOfData
Dim strvelden() As String = objparser.ReadFields

If conf = strvelden(5) Or conf = strvelden(1) Then

lblLogical.Text = strvelden(1)
txtSnr.Text = strvelden(5)
txtOwner.Text = strvelden(3)
txtOS.Text = strvelden(6)
txtSoort.Text = strvelden(0)
txtType.Text = strvelden(4)
txtScan.Text = strvelden(7)
txtLogonuser.Text = strvelden(8)

End If
Loop
Ray

Mar 2 '07 #2

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

Similar topics

6
by: chuck amadi | last post by:
Hi , Im trying to parse a specific users mailbox (testwwws) and output the body of the messages to a file ,that file will then be loaded into a PostGresql DB at some point . I have read the...
11
by: Sebastian Krause | last post by:
Hello, I tried to read in some large ascii files (200MB-2GB) in Python using scipy.io.read_array, but it did not work as I expected. The whole idea was to find a fast Python routine to read in...
7
by: Graham Taylor | last post by:
I've tried posting this in the 'microsoft.public.access' but I will post it here also, as I think it might be the webserver which is causing my problem. --------- I have an Access 2003 database...
19
by: ranjeet | last post by:
Hay Guys can you all suggest me the points on the below issue Problem : The thing is that I have the data some thing like this. 1486, 2168, 3751, 9074, 12134, 13944, 17983, 19173, 21190,...
5
by: manokumar | last post by:
hiye, i notice that some if not all of my folders in winxp pro. are set as read only and its giving me some problem with development. so as the natural thing, i unchecked the read only option and...
6
by: Samuel M. Smith | last post by:
I have been playing around with a subclass of dict wrt a recipe for setting dict items using attribute syntax. The dict class has some read only attributes that generate an exception if I try to...
0
by: phplasma | last post by:
Hey, I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express. I have successfully made...
3
by: phwashington | last post by:
I am new to C++ and have a data file I want to read, which was stored in binary. I have looked at the data with a hex editor and it appears to be correct. Whenever I try to read it though as an...
14
by: Zoro | last post by:
My task is to read html files from disk and save them onto SQL Server database field. I have created an nvarchar(max) field to hold them. The problem is that some characters, particularly html...
3
by: flavourofbru | last post by:
Hi all, I am reading a text file and then computing some values. Then I am closing that file. Later on if i reopened that file in the same program I am unable to read that file. I found that the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.