Jelmer Posted February 12, 2006 Posted February 12, 2006 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? Quote
Cags Posted February 12, 2006 Posted February 12, 2006 What do you mean by you get nothing, does it error or perhaps return an empty string? Quote Anybody looking for a graduate programmer (Midlands, England)?
Cags Posted February 12, 2006 Posted February 12, 2006 Which one is the problem, it errors (in which case please provide an indication of the error given), or it returns and empty string? Quote Anybody looking for a graduate programmer (Midlands, England)?
Jelmer Posted February 12, 2006 Author Posted February 12, 2006 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.