05-15-2012, 11:54 AM
So i was working on a Editor for T_Magic but as first the Design need to work (Display the Table)
now i can Select from a_index and show it in a DataGridView BUUT .. i wanna show it in a ListBox i tried it and it always show up "System.Data.DataRowView" (Maybe need COnvert to String?)
I wanna show it in a Listbox and then it load t_magic to Display the Index and the Name in the Design.
2
Uploaded with 2
So just if you Select X Skill it Display Name, ID , Maxlevel, Damagetyp etc..^^
(I filled the ComboBoxes allready)
Code with Datagriedview :
MySqlConnection con;
MySqlConnectionStringBuilder csb = new MySqlConnectionStringBuilder();
csb.Server = textBox13.Text;
csb.UserID = textBox4.Text;
csb.Database = textBox5.Text;
csb.Password = textBox6.Text;
con = new MySqlConnection(csb.ConnectionString);
MySqlConnection connection = new MySqlConnection(csb.ConnectionString);
connection.Open();
string Test = textBox2.Text;
String sql1 = "SELECT * FROM t_magic a_index";
DataTable datatable = new DataTable();
MySqlDataAdapter dataAdapter = new MySqlDataAdapter(sql1, connection);
dataAdapter.Fill(datatable);
dataGridView1.DataSource = datatable;
dataGridView1.Show();
dataGridView1 .Update();
[/Code]
And Code for ListBox with Fail :
[Code]
MySqlConnection con;
MySqlConnectionStringBuilder csb = new MySqlConnectionStringBuilder();
csb.Server = textBox13.Text;
csb.UserID = textBox4.Text;
csb.Database = textBox5.Text;
csb.Password = textBox6.Text;
con = new MySqlConnection(csb.ConnectionString);
MySqlConnection connection = new MySqlConnection(csb.ConnectionString);
connection.Open();
string Test = textBox2.Text;
String sql1 = "SELECT * FROM t_magic a_index";
DataTable datatable = new DataTable();
MySqlDataAdapter dataAdapter = new MySqlDataAdapter(sql1, connection);
dataAdapter.Fill(datatable);
listBox1.DataSource = datatable;
listBox1.Show();
listBox1.Update();
2
Uploaded with 2

