Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Entity databinding
 

Pages: 1
LLBLGen Pro Runtime Framework
Entity databinding
Page:1/1 

  Print all messages in this thread  
Poster Message
OSSistemes
User



Location:

Joined on:
20-Nov-2019 21:55:31
Posted:
9 posts
# Posted on: 21-Nov-2019 07:56:19.  
Hi,

We are evaluating the ORM, at first - great job! - it'a amazing and it's easy to use and runs very good, but we have a little problem.

The problem is with and Entity with another one nested, if we try to bind the parent, its impossible to obtain datamember inside child.

Exemple:

Code:
ArticleEntity Art = new ArticleEntity(1);
BindingSource Formbinding = new BindingSource();
Formbinding.DataSource = Art;
//Lazy Load its ok
FamilyEntity Fam = Art.Family;
    
//textbox databindings
textBox1.DataBindings.Add("Text", Formbinding, "Codi", true, DataSourceUpdateMode.OnValidation);
textBox2.DataBindings.Add("Text", Formbinding, "Descripcio", true, DataSourceUpdateMode.OnValidation);
textBox3.DataBindings.Add("Text", Formbinding, "Family.Nom", true, DataSourceUpdateMode.OnValidation);


At runtime, when we try to bind string inside Art.Family.Nom, the program stop with error:

Code:
textBox3.DataBindings.Add("Text", Formbinding, "Family.Nom", true, DataSourceUpdateMode.OnValidation)

"Datamember Family not found in Datasource"

We check this thread, but no solution:
https://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=24683&HighLight=1

Please someone can help!!

Thanks!

We use:
Framework 4.6.1
Self-servicing
MySQL
LLBLGen 5.6



        
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37797 posts
# Posted on: 21-Nov-2019 11:45:22.  
I can reproduce it. It's however a winforms databinding issue, but I'll see if I have an answer for you.

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37797 posts
# Posted on: 21-Nov-2019 12:14:13.  
I can't reproduce it if I move the bindings to the OnLoad override on the form:

Code:

using System;
using System.Linq;
using System.Windows.Forms;
using NWDB.EntityClasses;

namespace DBTester
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            _orderIdTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this._binding, "OrderId", true));
            _customerCompanyNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this._binding, "Customer.CompanyName", true));
        }


        private void _fetchButton_Click(object sender, EventArgs e)
        {
            var o = new OrderEntity(10262);
            _binding.DataSource = o;
        }
    }
}



Selfservicing, northwind (sqlserver, but doesn't matter), Browsable($false) attribute removed on the navigator.

The datasource is defined in the project on the 'datasources' pane in visual studio.

btw, we recommend to use Adapter over selfservicing. You do lose lazy loading, but adapter offers more features, like batching. Not sure you need those of course, but just in case Regular Smiley
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
OSSistemes
User



Location:

Joined on:
20-Nov-2019 21:55:31
Posted:
9 posts
# Posted on: 21-Nov-2019 13:02:47.  
At first thanks for response, at this moment we solve it using related fields mapping.

When you said "Browsable($false)" where is the place to check if this option is enable/disable?

We are testing if use self or adapter at this moment

Thanks!


  Top
OSSistemes
User



Location:

Joined on:
20-Nov-2019 21:55:31
Posted:
9 posts
# Posted on: 21-Nov-2019 13:08:15.  
We find it!! and check if i removed Browsable($false) all runs ok without related fields

Thanks
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.