0
int cLeft=0;
public System.Windows.Forms.TextBox AddNewTextBox()
{
System.Windows.Forms.TextBox txt = new System.Windows.Forms.TextBox();
OleDbCommand command = new OleDbCommand();
command.Connection = connection;
string query = " select * FROM DotMatrix;
command.CommandText = query;
OleDbDataReader reader = command.ExecuteReader();
this.Controls.Add(txt);
txt.Top = (cLeft*25) + 124;
txt.Left = 50;
txt.Height = 20;
txt.Width = 259;
while (reader.Read())
{
txt.Text=reader["Pertanyaan"].ToString();
}
if (txt.Text=="")
{
MessageBox.Show("Pertanyaan Habis , Akan Redirect Ke Hasil");
}
cLeft = cLeft + 1;
return txt;
}
private void textBox1_TextChanged_1(object sender, EventArgs e)
{
AddNewTextBox();
}
我的問題代碼,爲什麼textBox中只顯示從數據庫1號線??? 我想在Pertanyaan行的數據顯示[行] 感謝回答