日期:2014-05-20  浏览次数:20435 次

两次输出数据到页面,第二次输出怎样不包扩第一次的数据?
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];