[C#] Use a listBox from a Class.
#5


public List<string>[] Select()
{
string query = "SELECT * FROM `t_magic` `a_name` WHERE `a_index` = 48";

List<string>[] list = new List<string>[3];
list[0] = new List<string>();
list[1] = new List<string>();
list[2] = new List<string>();

if (this.OpenConnection() == true)
{

MySqlCommand cmd = new MySqlCommand(query, connection);
MySqlDataReader dataReader = cmd.ExecuteReader();

while (dataReader.Read())
{
list[0].Add(dataReader["a_index"] + "");
list[1].Add(dataReader["a_name"] + "");
list[2].Add(dataReader["a_type"] + "");

}

dataReader.Close();

this.connection.Close();

return list;
}
else
{
return list;
}
}

 

So but it dont return anything

 

// i tried it so too:

Form1 f1 = new Form1();
f1.listBox1.Items.Add("Worked");

 

But that too dont work lol and thats the simplest way, what i do wrong?



Messages In This Thread
[No subject] - by Nikolee - 08-20-2012, 12:07 PM
[No subject] - by HateMe - 08-20-2012, 01:10 PM
[No subject] - by Nikolee - 08-20-2012, 01:45 PM
[No subject] - by Wizatek - 08-20-2012, 01:51 PM
[No subject] - by Nikolee - 08-20-2012, 02:19 PM
[No subject] - by HateMe - 08-20-2012, 03:07 PM
[No subject] - by Nikolee - 08-20-2012, 03:15 PM
[No subject] - by Wizatek - 08-20-2012, 04:02 PM
[No subject] - by someone - 08-20-2012, 04:34 PM
[No subject] - by Nikolee - 08-20-2012, 04:52 PM
[No subject] - by someone - 08-20-2012, 05:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)