解决TOP后面不能参数传值的问题

String sql = "SELECT TOP (0+@count) *  FROM [shangjiaxinxi] ORDER BY [xinyong] DESC";
            SqlParameter[] parms
= new SqlParameter[1];
            parms[
0] = new SqlParameter("@count" , SqlDbType.Int ) ;
            parms[
0].Value = count;

你可能感兴趣的:(解决TOP后面不能参数传值的问题)