ObjectDataSource 如何传递查询参数

后台cs 赋值:

 ObjectDataSource_Main.SelectParameters["where"].DefaultValue = " 3=3 ";
 ObjectDataSource_Main.SelectParameters["order"].DefaultValue = " dLastEditDate Desc ";

 public DataTable F08_SelectDetail(int startRowIndex, int maximumRows, string where, string order)
        {

            CWorkProductVersionBLL myCWorkProductVersionBLL = new CWorkProductVersionBLL();
            return myCWorkProductVersionBLL.F08_SelectColumnHaveWhereOrder_OnePage(startRowIndex, maximumRows, string.Empty, "", "");
        }

前台:

 <asp:ObjectDataSource ID="ObjectDataSource_Main" runat="server" EnablePaging="True"
        SelectCountMethod="F09_GetCount" SelectMethod="F08_SelectDetail" TypeName="Product.WorkProductVersion_List">
        <SelectParameters>
            <asp:Parameter Name="where" Type="String" />
            <asp:Parameter Name="order" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

posted @ 2011-07-08 10:12  郑文亮  阅读(1082)  评论(0编辑  收藏  举报