当前位置: 代码迷 >> ASP.NET >> 两次输出数据到页面,第二回输出怎样不包扩第一次的数据
  详细解决方案

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

热度:5415   发布时间:2013-02-26 00:00:00.0
两次输出数据到页面,第二次输出怎样不包扩第一次的数据?
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];
  相关解决方案