hey, I've just joined daniweb - usually just search around on the net till i find solutions to coding problems but this time i'm stuck.... probably a simple problem but nonetheless...

Anyway,

I'm making a program that connects to an access database, retrieves data and the data is taken into a dataset. This is all done in the program.cs

I have 2 forms, the first gives an option to list information taken from the database, it references a static method "clientList()" in the 2nd form which organises the data from the dataset into an array.

The problem is - when trying to populate the datagridview on the 2nd form it won't let me do it inside the static "clientList()", however without the field being static i can't reference the "clientList()" method from the first form.

I Tried making another method which wasn't static but this can't be accessed from within the static "clientList()" either, when i do it gives this error:

An object reference is required for the non-static field, method, or property

Any Ideas??

No worries, got it sorted putting everything in the program.cs then accessing the data by calling a method after the initialize component was called.....

thought it was simple, just needed to voice it to get my brain in gear i think :)

This question has already been answered. Start a new discussion instead.