473,490 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Array Heaven

Hey Guys. i'd really appreciate your help with this. I've got a VB.net program due on tuesday and i've hit a brick wall... it's a program that helps keep track room reservations for a hotel

I'm reading from a text file using streamreader (Import System.IO) and i'm having trouble understanding how it stores the information into an array. and how to pass the array between multiple forms.

I'm creating a search button that takes what the text file puts into an array and compare it to the available rooms for the hotel to see if there's vacancy or not. then display the valid results in a listbox.

I have the files available if somebody really wants to help out. i've got a good grasp on VB but i work well if i have example code that demonstrates a concept. so if there's a book out there or example file somebody has. that'd be great.

Attached is my vbcode for my frmmain... help would be great. thanks.

In Hoc

Nov 21 '05 #1
3 1085
A streamReader doesn't store any data, nor does it work with arrays.

A streamReader simply reads streams of data from a source you specify. If you wish to store that data, you could store it into a string and then break the string up (using a string method such as "split" or "substring"), which do return arrays.

Once the data is stored in an array, it can be passed between form instances if it has been declared with "Friend" or "Public" scope.
"Cesar" <si*******@hotmail.com> wrote in message news:On**************@TK2MSFTNGP14.phx.gbl...
Hey Guys. i'd really appreciate your help with this. I've got a VB.net program due on tuesday and i've hit a brick wall... it's a program that helps keep track room reservations for a hotel

I'm reading from a text file using streamreader (Import System.IO) and i'm having trouble understanding how it stores the information into an array. and how to pass the array between multiple forms.

I'm creating a search button that takes what the text file puts into an array and compare it to the available rooms for the hotel to see if there's vacancy or not. then display the valid results in a listbox.

I have the files available if somebody really wants to help out. i've got a good grasp on VB but i work well if i have example code that demonstrates a concept. so if there's a book out there or example file somebody has. that'd be great.

Attached is my vbcode for my frmmain... help would be great. thanks.

In Hoc

Nov 21 '05 #2
Cesar,

When you want your data in an array, the best thing you can use is in my
opinion the arraylist.

Than you can read record by record the data by using readline, something as

\\\
Dim arrList as new ArrayList
Dim sr As StreamReader = New StreamReader(path)
Do While sr.Peek() >= 0
arrList.add(sr.ReadLine())
Loop
///

You can as well set it direct in the listbox, doing this, however mostly
will that slow up your program.

I hope this helps?

Cor

"Cesar" si*******@hotmail.com
Hey Guys. i'd really appreciate your help with this. I've got a VB.net
program due on tuesday and i've hit a brick wall... it's a program that
helps keep track room reservations for a hotel

I'm reading from a text file using streamreader (Import System.IO) and i'm
having trouble understanding how it stores the information into an array.
and how to pass the array between multiple forms.

I'm creating a search button that takes what the text file puts into an
array and compare it to the available rooms for the hotel to see if there's
vacancy or not. then display the valid results in a listbox.

I have the files available if somebody really wants to help out. i've got a
good grasp on VB but i work well if i have example code that demonstrates a
concept. so if there's a book out there or example file somebody has.
that'd be great.

Attached is my vbcode for my frmmain... help would be great. thanks.
In Hoc
Nov 21 '05 #3
You should create a structure using keyword Type. Read in as a record is easy.

I have a sample in VB6 so have fun for migration and testing.

chanmm
"Cesar" <si*******@hotmail.com> wrote in message news:On**************@TK2MSFTNGP14.phx.gbl...
Hey Guys. i'd really appreciate your help with this. I've got a VB.net program due on tuesday and i've hit a brick wall... it's a program that helps keep track room reservations for a hotel

I'm reading from a text file using streamreader (Import System.IO) and i'm having trouble understanding how it stores the information into an array. and how to pass the array between multiple forms.

I'm creating a search button that takes what the text file puts into an array and compare it to the available rooms for the hotel to see if there's vacancy or not. then display the valid results in a listbox.

I have the files available if somebody really wants to help out. i've got a good grasp on VB but i work well if i have example code that demonstrates a concept. so if there's a book out there or example file somebody has. that'd be great.

Attached is my vbcode for my frmmain... help would be great. thanks.

In Hoc

Nov 21 '05 #4

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

Similar topics

20
2899
by: fix | last post by:
Hi all, I feel unclear about what my code is doing, although it works but I am not sure if there is any possible bug, please help me to verify it. This is a trie node (just similar to tree nodes)...
1
1700
by: GreatB | last post by:
Bill Gates died in a car accident. He found himself in Purgatory being sized up by God . .. "Well, Bill, I'm really confused on this call. I'm not sure whether to send you to Heaven or Hell....
8
6092
by: Kresimir Spes | last post by:
Is the following C code possibile in C# (without the pointers ofcourse) int a; int* b=&a; // or a+100 b=0; what I would like to do is create a new int array object and have it point at the...
26
2690
by: MLH | last post by:
How would I modify the following to achieve a 2-dimensional array? Dim MyWeek, MyDay MyWeek = Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") ' Return values assume lower bound set to 1...
0
7112
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,...
1
6852
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...
0
7356
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...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
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...
0
4573
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...
0
3084
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...
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
277
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...

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.