0

C# noob.

Ok, here's what I'm trying to do ...

I have a dbUtilities class I've made. And its my desire to have methods in it like "FillListBoxFromDB" .... I want to pass the listBox that will be the target, and the sql query command.

I will have multiple places I want to fill listboxes, combo boxes, etc ... so I just want to create one generic utility method I can call.

I tried:

public void FillListBoxFromDB(ByRef listBox AS lb, string sqlCommand)

But that generates 9 build errors concerning tokens and arrays.

I changed it to:

public void FillListBoxFromDB(listBox ls, string sqlCommand)

and I get only one error:

error CS0246: The type or namespace name 'listBox' could not be found (are you missing a using directive or an assembly reference?)

Even though I have using System.Windows.Forms;

Any help would be appreciated. :)

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Zinderin
0

public void FillListBoxFromDB(listBox ls, string sqlCommand)

There is no any Class listBox .Letter L should be capital for Class ' ListBox'
in namespace System.Windows.Forms;

0

There is no any Class listBox .Letter L should be capital for Class ' ListBox'
in namespace System.Windows.Forms;

That fixed it! Sooooo frustrating.

Thanks K.D.M.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.