| | |
How to pass a file name from another class
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 13
Reputation:
Solved Threads: 0
I'm trying to pull in a file name from another class... I have a three classes... My main class, a class called Transaction, and a class called Account. I have two sequential files. "CHECKING.TXT" or "SAVINGS.TXT" that I have loaded into arrays in my main class. I need to pass the proper file name to my subs and functions somehow to my OpenText(file) statement in my Account class.
I was getting a Warning - Variable 'sr' (my streamreader variable) is used before it has been assigned a value. A null reference exception could result at runtime in my Account class, but I fixed that by moving my before my Try statement in the subs. Not sure if that was the correct way to fix it, but the warnings disappeared. I still can't get the proper filename to pass to the other class, though...
Anyone have any clue what I'm talking about? =P
I was getting a Warning - Variable 'sr' (my streamreader variable) is used before it has been assigned a value. A null reference exception could result at runtime in my Account class, but I fixed that by moving my
VB.NET Syntax (Toggle Plain Text)
sr = IO.File.OpenText(file)
Anyone have any clue what I'm talking about? =P
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: I DON'T want to be a hack programmer...
- Next Thread: how to reset the form
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account application arithmetic array basic bing button buttons center check code combobox component crystalreport data database datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy hosting images input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





