Array problem

Jelmer

Regular
Joined
Jan 11, 2006
Messages
96
Hello

I've got a little problem.
I've declarated an array into a class above.

Code:
	public class Class_customers
	{	

        string [] hoofd;

        public Class_customers(){

            hoofd = new string[100];

       }

I controlled it if hoofd is actually filled with some data with a showmessagebox... and it contains data..:

Code:
            for (int i = 1; i < nCount; i++)
            {
                //Kolom headers
                header = new ColumnHeader();
                header.Width = 100;
                header.Text = reader.GetName(i);                
                hoofd[i-1] = reader.GetName(i);                
            }

But on the next part it went wrong.
I dont get something back...

Code:
        public string return_header(int count)
        {
            MessageBox.Show("" + hoofd[count]);
            return hoofd[count];
        }

Count is a normal number what should have some data...
But i'll get nothing..

Why went it wrong?
 
stupid.. i've found it..

klant = new Class_customers(0, "", "", "", "", "", "", "", "", "", "", "", "", "", "");
klant.open("SELECT * FROM Bedrijven where " + comItems.Items.Count());
klant.read();
klant.first();

But the part is not selected.. so everything is empty.. i'll need to transport the array from the class to the form..

This is the second time a klant is getting activated.
 
Back
Top