改成 cmd = new SqlCommand("select top " + xzflag + " * from tb_Test where TypeID=1 order by newid()",conn);看看,SQL语句是不是少了空格