For Programmers: Free Programming Magazines  


Home > Archive > C# > November 2004 > Re: Newbie needs help: treeview, datareader, and a function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Newbie needs help: treeview, datareader, and a function
techprot-google04

2004-11-27, 3:56 pm

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".
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com