我现在从数据库取值,我想把DataList固定大小.但是值多了DataList会被撑大.
我不想分页.问怎样弄??
帮忙哦,谢谢;

解决方案 »

  1.   

    那就在查询的时候用select top 10 就可以了
      

  2.   

    declare @num as int
    select @num = count(*) from Chat
    set @num = @num - 10
    declare @chatid int 
    declare @sql as varchar(200)
    set @sql = 'select * from Chat where NoteID not in (select top ' + cast(@num as char) + ' NoteID from Chat ) and Chatid = '+ cast(@chatid as char) + ''
    exec (@sql)这个为什么有错?取不到值,问题在 @chatid 怎么改?????
      

  3.   

    declare @chatid int -----〉declare @chatid as int