接続は正常に機能しています。ただし、MysqlDataREADer dataReader 行を実行すると、ウィンドウ フォームが表示され、while ループにアクセスしてデータを取得しません。データベースからの情報を表示するために dataGridView を使用しています。私は何を間違えましたか?ありがとう
if (this.OpenConnection() == true)
{
//Create Command
MySqlCommand cmd = new MySqlCommand(query, connection);
//Create a data reader and Execute the command
MySqlDataReader dataReader= cmd.ExecuteReader();
//Read the data and store them in the list
while (dataReader.Read())
{
list[0].Add(dataReader["id"] + "");
list[1].Add(dataReader["name"] + "");
list[2].Add(dataReader["weekday"] + "");
list[3].Add(dataReader["description"] + "");
}
//close Data Reader
dataReader.Close();
//close Connection
this.CloseConnection();
}