안녕하세요! 독자가 사용하는 데이터베이스에서 데이터를 호출 할 수 있으며 데이터베이스에 데이터를 가져온 후 예상 데이터를 얻을 때 messageBox가 나타납니다. 여기 내 예제 코드입니다 :리더를 사용하여 ms 액세스 데이터베이스에서 데이터 가져 오기
if (textBox5.Text == "")
{ }
else
{
DialogResult ms = MessageBox.Show("Try Again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
if (ms == DialogResult.OK)
{
textBox5.Clear();
textBox1.Clear();
listBox5.Items.Clear();
textBox3.Clear();
listBox4.Items.Clear();
}
}
while (reader.Read())
{
listBox4.Items.Clear();
if (string.Compare(label1.Text, reader.GetString(0)) == 0)
{
for (int t = 1; t < 11; t++)
{
words.Add(reader.GetString(t));
}
}
words.Shuffle();
listBox4.Items.AddRange(words.ToArray());
}
reader.Close();
coon.Close();
여기
내 문제는 내가이 코드를 적용 할 때, 두 messageBox가 그래서 난이 코드 제거 나타납니다있다 :
textBox5.Clear();
textBox1.Clear();
listBox5.Items.Clear();
textBox3.Clear();
listBox4.Items.Clear();
내가 원하는 건 내가 보여주고 싶은입니다 messageBox를 한 번. 이걸로 내가 도울 수 있니?
답장을 보내 주셔서 감사합니다. 나는 프로그램에서 딸꾹질이 어디 있는지 알고 있다고 생각합니다. 내게 큰 힌트를 보였습니다. 그것은 나를 많이 도와줍니다 :) –