Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello

 

I've got a little problem.

I've declarated an array into a class above.

 

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

 

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

 

        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?

Posted
What do you mean by you get nothing, does it error or perhaps return an empty string?
Anybody looking for a graduate programmer (Midlands, England)?
Posted
Which one is the problem, it errors (in which case please provide an indication of the error given), or it returns and empty string?
Anybody looking for a graduate programmer (Midlands, England)?
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...