07-28-2013, 11:38 AM
Problem here:
this.Reader = MySqlCommand.ExecuteReader();
this.Reader.Read();
this.textBox_name.Text = this.Reader["a_keeper_idx"].ToString();
if there are no rows from the reader it will return false, if it will try to read the a_keeprer_idx from the reader, it will throw an exception.
Try something like this
this.Reader = MySqlCommand.ExecuteReader();
if(this.Reader.Read()){
this.textBox_name.Text = this.Reader["a_keeper_idx"].ToString();
}
this.Reader.Close();
Try to use this.Reader.Close(); before this.Reader.Dispose();
Another problem is this:
string text = this.Shops.SelectedItem.ToString();
MySqlCommand.CommandText = string.Concat(new string[]
{
"select * from `",
textBox_db.Text,
"`.`t_shop` where a_keeper_idx=",
text,
";"
});
this.Shops.SelectedItem.ToString() is a string not a index where in your query you look for a index:
"select * from `t_shop` where a_keeper_idx=Master of Monster Combo;"
Which it should be something like this(123 is the ID of the NPC):
"select * from `t_shop` where a_keeper_idx=123;"
Why are you opening so many connections?

