首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

两次输出数据到页面,第二回输出怎样不包扩第一次的数据

2011-12-23 
两次输出数据到页面,第二次输出怎样不包扩第一次的数据?SqlSelecttop9ID,TitleFromImage_TopicWhereGrou

两次输出数据到页面,第二次输出怎样不包扩第一次的数据?
Sql   =   "Select   top   9   ID   ,Title   From   Image_Topic   Where   GroupID   =   13   Order   By   AddTime   Desc ";
Comm   =   new   SqlCommand(   Sql,   Conn   );
Adapter   =   new   SqlDataAdapter(   Comm   );
Adapter.Fill(Rs);
Table   =   Rs.Tables[0];
//把数据输出页面一

Sql   =   "Select   top   9   ID   ,Title   From   Image_Topic   Where   GroupID   =   10   Order   By   AddTime   Desc ";
Comm   =   new   SqlCommand(   Sql,   Conn   );
Adapter   =   new   SqlDataAdapter(   Comm   );
Adapter.Fill(Rs);
Table   =   Rs.Tables[0];
//把数据输出页面二,问题是输出二里竟然包括输出一!是不是我哪里没关闭?

[解决办法]
输出页面二前要清理数据集
Sql = "Select top 9 ID ,Title From Image_Topic Where GroupID = 10 Order By AddTime Desc ";
Comm = new SqlCommand( Sql, Conn );
Adapter = new SqlDataAdapter( Comm );
Rs.Clear();
Adapter.Fill(Rs);
Table = Rs.Tables[0];

热点排行