页面加载时倒叙查询出最新的一条数据显示在文本框

第一种:调用Sqlhelper类
string   sql = "select * from 表名 order by 字段 desc";
var   data = Sqlhelper.GetData(sql1);
TextBox1.Text = data.Rows[0]["数据库字段"].ToString();
TextBox2.Text = data.Rows[0]["数据库字段"].ToString();

第二种:调用common类

var  data = new DataTable();
SqlDataAdapter   adpter = new SqlDataAdapter("select * from 表名 order by 字段 desc", common.g_Con);    //sql语句,字符串
adpter.Fill(dt);
TextBox1.Text = data.Rows[0]["数据库字段"].ToString();
TextBox2.Text = data.Rows[0]["数据库字段"].ToString();