在vs2005 读取并显示sql2005中某表的最后一条记录的某个字段,怎么实现??(急)
本人是新手,求高手详细指点……

解决方案 »

  1.   

    在vs2005 读取并显示sql2005中某表的最后一条记录的某个字段还是字段值,怎么实现??(急)
      

  2.   

    如果有ID列,  select 列名 from table  where  id=(select max(ID) from table) 
      

  3.   

    dataset ds=new dataset();
    ds=getlist();//获取表的内容
    for (int i=0;i<ds.table[0].Rows.count;i++)
    {
    string s=ds.tables[0].rows[i]["字段"].tostring();
    }
    字段就是你想要的数据库中的某一个字段。
      

  4.   

    没有id有记录时间的字段吗,你这要求真蛋疼,
    最后插入的记录,在select的时候不一定会显示在最后面一条,不如有聚集索引的时候
      

  5.   

    看看这样行不 
     select top 1 * from tableName t order by  t.createtime desc