Shops loading error
#2

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?



Messages In This Thread
[No subject] - by Jaiz - 07-28-2013, 10:48 AM
[No subject] - by someone - 07-28-2013, 11:38 AM
[No subject] - by Jaiz - 07-28-2013, 12:06 PM
[No subject] - by soryjero - 07-28-2013, 12:13 PM
[No subject] - by someone - 07-28-2013, 12:21 PM
[No subject] - by Jaiz - 07-28-2013, 12:25 PM
[No subject] - by Jaiz - 07-28-2013, 12:58 PM
[No subject] - by someone - 07-28-2013, 03:01 PM
[No subject] - by Jaiz - 07-28-2013, 04:41 PM
[No subject] - by someone - 07-28-2013, 05:07 PM
[No subject] - by Jaiz - 07-28-2013, 05:35 PM
[No subject] - by someone - 07-29-2013, 04:40 PM
[No subject] - by Jaiz - 07-29-2013, 04:52 PM
[No subject] - by soryjero - 07-29-2013, 10:26 PM
[No subject] - by Jaiz - 07-30-2013, 06:43 PM
[No subject] - by soryjero - 07-30-2013, 10:34 PM
[No subject] - by Jaiz - 07-31-2013, 01:01 PM
[No subject] - by soryjero - 07-31-2013, 09:59 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)