2 WebBusiness Source and 1 Business Object


Author
Message
Tony Charpentier
Tony Charpentier
StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)StrataFrame Beginner (38 reputation)
Group: StrataFrame Users
Posts: 10, Visits: 81
Hello

i would like to know if it's possible to start 2 query for my WebBusiness Source with
the Same Business Object.


In the webForm i have this code :

 <SFWeb:WebBusinessBindingSource runat="server" ID="WbAGENDA" BusinessObjectName="oAgendaBo" EnableViewState="true"></SFWeb:WebBusinessBindingSource>
 <SFWeb:WebBusinessBindingSource runat="server" ID="WbTACHE" BusinessObjectName="oAgendaBo"></SFWeb:WebBusinessBindingSource>

And side the behond code :

i have this :

  protected void Page_Load(object sender, EventArgs e)
        {
            if (! this.Page.IsPostBack) {
                this.LoadMess();
                this.LoadAgenda();
            }
       }


 protected void LoadAgenda(){
            this.oAgendaBo.FillData("agd_date","tac_id=5 " agd_date_maj desc","");
        }

        protected void LoadTache(){
            this.oAgendaBo.FillData("agd_date","tac_id = 2," agd_date_maj desc","");
        }


in WbAgenda and WbTache i have the last Query , it's last query to take over the first.

thanks


Michel Levy
Michel Levy
StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Bonjour Tony,

les WebBusinessBindingSource ne sont que des "passerelles" vers les BusinessObjects. Dans ton exemple, tes 2 WBBS pointent vers un seul et même BO, donc il est normal que ces 2 WBBS ne te retournent que les données provenant de la 2ème requête.

Si tu veux avoir 2 jeux d'enregistrements différents provenant de la même source de données, alors il te faut instancier 2 fois le même BO sous des noms différents : tu auras 2 objets, chacun avec ses enregistrements, et chaque WBBS pointera vers un seul de ces objets.

Tu peux aussi récupérer le 2ème jeux d'enregistrements dans une autre DataTable du BO, en passant par une fonction GetData, au lieu d'une méthode FillData, mais ensuite ça t'oblige à gérer dans ton code l'utilisation de la DataTable par défaut (celle du Fill), et les autres (celles du Get)




Hi Tony,

the WebBusinessBindingSource act as a "bridge" to reach the BusinessObjects. In your example, your 2 WBBS are mapped to a single BO, and then these 2 WBBS get only the dataset retrieved by the 2nd query.

If you want 2 different dataset coming from a single data source, you may instanciate twice a single BO, with different names. You'll get 2 objects, each one with its own dataset, and each WBBS being mapped to only one of the two objects.

Another way should be to retrieve another dataset in another DataTable of the same BO, using a GetData function in place of a FillData method. In that way, you'll have to manage by your own code the switch of using the default DataTable (coming from Fill) and the other ones (coming from Get).
Olivier
Olivier
StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)StrataFrame User (324 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 805
Thanks Michel

For your answer.


-------------------------------------------------------------
Merci Michel

Pour ta réponse.

==============================================
Asp.net C# - Strataframe - telerik
==============================================
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search