LinqDataSource & stored procs & select params

Last post 05-28-2008 9:56 AM by Overmars. 0 replies.

Sort Posts:

  • LinqDataSource & stored procs & select params

    05-28-2008, 9:56 AM
    • Loading...
    • Overmars
    • Joined on 10-09-2007, 6:08 AM
    • Posts 7

    Hi

    I have read that when using stored procs with the LinqDataSource, you need to use the Selecting Event eg:

    protected void linqDSReport_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            ADataContext aDataContext = new ADataContext();
    
            var report = ADataContext.AReport();
    
            e.Result = report.OrderBy(r => r.id);
    
        }
     
    My actual proc, AReport takes 10 input params. Can I still use the SelectParams => FormParameters to set these? If so, how? It seems very long winded to have to use the

    e.SelectParameters to reference each param and pass it through the method.



     

    Also, if I wanted to make use of the SortOrder, how would I use the e.Arguements.SortExpression with the report.OrderBy?


    Thanks for your help.

     

     

     

     
    Filed under: ,
Page 1 of 1 (1 items)
Microsoft Communities
Page view counter