[求助]c#读取数据库(为什么只显示最后一条数据)
string s =null;String conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb";
OleDbConnection olecon = new OleDbConnection(conn);
olecon.Open();
OleDbCommand sql = new OleDbCommand("select * from person", olecon);
OleDbDataReader reader;
reader = sql.ExecuteReader();
if (reader.Read();)
{
s+=reader["xm"];//把这一列的数据全部连接起来,并且显示出来
}
richTextBox1.Text = s;//显示数据