I am a professional mainframe programmer, and I am trying to learn .Net. I have an OOO problem that is stumping me. I can get around it, but it would look like amateur hacking. I would like to do it the OOO way.
Simply put:
In one method (ReadAccounts), I am reading an Access table into a List (AcctsList). I don't have a problem with that; that works.
In another method (DisplayAccount s), I would like to READ that list, and then process it.
I tried to make the list "global", but I am tripping up on the language. Here is my code:
How do I do this? I'm sure there is a simple explanation to this.
Thanks in advance! Any help is really appreciated.
Dave
Simply put:
In one method (ReadAccounts), I am reading an Access table into a List (AcctsList). I don't have a problem with that; that works.
In another method (DisplayAccount s), I would like to READ that list, and then process it.
I tried to make the list "global", but I am tripping up on the language. Here is my code:
Code:
public void ReadAccounts() { var AcctsList = new List<AcctRec>(); // How do I make THIS AcctsList available to other programs? } public void DisplayAccounts() { // Process AcctsList from ReadAccounts above. }
Thanks in advance! Any help is really appreciated.
Dave
Comment