Code Comments
Programming Forum and web based access to our favorite programming groups.I would move the call of the function from main() to the form load function. techprot-google04 wrote: > Who's asking this question: > 1. A newbie. > 2. This is my second C# program. > 3. I've done VB programming in the past. > 4. I'm rusty on OOP - usually where I trip up. > > Here is what I've got: > 1. A form with treeview. > 2. A database with a table. > > Here is what I want to do: > 1. Populate the treeview with each record in the table. > > What you'll notice: > 1. Why use a treeview? Future functionality. I plan to have "sub > projects". > 2. But for now I want to have a node per record. > > My problem: > 1. If the fillTree function is a void then when I call in in my main(), > I get "an object reference is required for the > > nonstatic field, method or property...". > 2. However, if I make it static void fillTree(), then I get an error > one the line "projectTree.Nodes..." where it says - > > "...projectTree' denotes a field where a class was expected". >
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.