VS05代碼中存儲過程定義

    public DataTable Get_FilmMore(int rows,int type)
        {
            string sqlStr;
            DataTable myDataTable = new DataTable();
            sqlStr = "select top "+rows+" id,title from film_list where class_1=@type and id not in (select top 2 id from film_list where class_1 = @type order by upload_date desc ) order by upload_date desc ";

            SqlParameter[] _param ={
                new SqlParameter("@type",SqlDbType.Int)
   };
            _param[0].Value = type;
            myDataTable = SqlHelper.ExecuteDataset(Config.ConnectionString, CommandType.Text, sqlStr,_param).Tables[0];

            return myDataTable;
        }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章