09-18-2012, 02:37 AM
private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
{
MySqlConnection cn = new MySqlConnection("host= " + BOX1.Text + "; username= " + BOX2.Text + "; password= " + BOX3.Text + ";database= " + BOX5.Text);
Encryption = true;
BOX4.Text = database;
BOX5.Text = database1;
BOX1.Text = host;
BOX3.Text = password;
BOX2.Text = user;
textBox12.Text = " " + listBox2.Items.Count.ToString();
DataRowView PeopleRow = listBox2.SelectedItem as DataRowView;
if (PeopleRow != null && PeopleRow.Row != null && PeopleRow.Row.ItemArray != null)
{
DataRow row = PeopleRow.Row;
if (row.ItemArray.Count() > 0)
{
textBox41.Text = Convert.ToString(row["NAME"]).ToString();
try
{
this.textBox41.Text = this.listBox2.SelectedItem.ToString();
DataSet DS = new DataSet();
this.textBox41.Text = DS.Tables[0].Rows[0]["a_nick"].ToString();
this.textBox40.Text = DS.Tables[0].Rows[0]["a_level"].ToString();
this.textBox39.Text = DS.Tables[0].Rows[0]["a_job"].ToString();
this.textBox38.Text = DS.Tables[0].Rows[0]["a_skill_point"].ToString();
this.textBox37.Text = DS.Tables[0].Rows[0]["a_statpt_remain"].ToString();
this.textBox36.Text = DS.Tables[0].Rows[0]["a_str"].ToString();
this.textBox47.Text = DS.Tables[0].Rows[0]["a_dex"].ToString();
this.textBox46.Text = DS.Tables[0].Rows[0]["a_int"].ToString();
this.textBox45.Text = DS.Tables[0].Rows[0]["a_con"].ToString();
this.textBox44.Text = DS.Tables[0].Rows[0]["a_admin"].ToString();
this.textBox43.Text = DS.Tables[0].Rows[0]["a_enable"].ToString();
}
catch (Exception ex)
{
MessageBox.Show("Please select Caracter from the list!");
}
}
}

