string sql = "select * from(select ROW_NUMBER() over(order by CreateTime desc) as number,ID,Name,Size,IsOpen,DownCount,ImgUrl,DownUrl,CreateTime from Source where IsDeleted = 0 ";
if (TypeID!=0)
{
sql += "and TypeID=@TypeID";
}
sql+= " )as aaa where number between " + ((pageindex - 1) * pagecount + 1) + " and " + pageindex * pagecount;