在多行文本框中逐行显示

时间:2016-10-29 18:33:02

标签: c# facebook-c#-sdk

当我搜索电话号码时,它会在DataGridView中逐行显示,但在我的TextBox中,它会在旁边显示一个。你知道为什么吗?

var con = new OleDbConnection(
    @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
    + Application.StartupPath + "\\db\\it.accdb");

con.Open();

var cmd = new OleDbCommand
{
    CommandType = CommandType.Text,
    CommandText = "select * from data where [ID] like(" + textBox9.Text + ")",
    Connection = con,
};

var reader = cmd.ExecuteReader();

while (reader.Read())
{
    textBox1.Text = reader["Name"].ToString();
    textBox20.Text = reader["Description"].ToString();
}

con.Close();

enter image description here

0 个答案:

没有答案