Results 1 to 11 of 11

Thread: [2.0] Slight issues here, classes - structures - arraylists - databases oh my...

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    56

    [2.0] Slight issues here, classes - structures - arraylists - databases oh my...

    Hello,

    I recently started programming in C# a few days ago. Having a bit of a problem here.

    At first I tried this...

    I have a seperate class from the form -- and this is the logic:

    1) A public struct with my program's settings is setup (window locations, etc.)
    2) A public sub calls a private function which gets the data from a database. That private function stores the returned column in an array list.
    3) the public sub gets the values from the array list and fills the variables of the structure.

    At this point I thought I could just call the structure in my main form and read the value, but it's setting it up as null because I guess when I do "MyStruct ms = new MyStruct();" it resets it?

    I'm pretty confused to be honest. I have absolutely no idea how I can set this up at the moment.

    Edit:

    Guess I need to ditch the structure, use private variables in the class, and pass them with methods? Going to try that now, btw if this ends up working -- would that setup be considered the normal way to get things done?

    I want to start writing "good" code, rather than jerry rigged "it works, but it's retarded" code.
    Last edited by ThisIsMyUserName; Apr 15th, 2006 at 03:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width