CodeSmith Community
Your Code. Your Way. Faster!

GetPaged or Custom Stored Procedure ?

Latest post 05-11-2008 11:58 AM by evantroeyen. 1 replies.
  • 05-10-2008 6:22 AM

    GetPaged or Custom Stored Procedure ?

    hello,

    as newbie in NetTiers I have a lot of question...

    I am facing a problem and I am not sure how to solve it...

    In my Winform application I have stored some payments and I want to have a list of all those include between 2 dates.  I have seen that I can define a where clause in the .GetPaged method, but the method also require the number of line and a starting position... I will always start at the first lin, but I don't know how many lines will come back and I don't really want to limit them.

    So my question is: "am  I on the right way in trying to use GetPaged, or should I implement a new custom stored procedure ?"

    If I should implement a custom procedure, I am not sure how to do, and where to place it ... Is there some post or an example to show me how to do dealing with DAL etc... ?

    Thank's for your help

     
    Eric 

    • Post Points: 5
  • 05-11-2008 11:58 AM In reply to

    Re: GetPaged or Custom Stored Procedure ?

    Hello,

    I didn't use GetPaged or a Custom SP...

    I found my solution with the .Find() method and with the help of the follwing page http://blog.csdn.net/ILOVEMSDN/archive/2007/03/15/1530737.aspx

    But I have a question about performances is the faster method, or what a specialist would suggest ?

     here is a part of my code:

                CoursParameterBuilder query1 = new CoursParameterBuilder();
                query1.BeginGroup();
                query1.Append(string.Empty,CoursColumn.Regle, "false", false);
                query1.AppendIsNull(CoursColumn.DteIntermediaire);
                query1.EndGroup();

                query1.BeginGroup("OR");
                query1.Append(string.Empty, CoursColumn.Regle, "false", false);
                query1.AppendGreaterThanOrEqual(CoursColumn.DteIntermediaire, dateTimePicker1.Value.ToString());
                query1.AppendLessThanOrEqual(CoursColumn.DteIntermediaire, dateTimePicker2.Value.ToString());
                query1.EndGroup();

                bindingSourceCours.DataSource = DataRepository.CoursProvider.Find(query1.GetParameters());        
     

    Thank's for your help 

    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems