Hello.
I would like to know the way of livebinding in Delphi XE3, since the TBindScopeDB doesn’t exist any more, and is depreciated to TBindsourcedb. I am trying to livebind a simple Tedit from a TDACDSDATATABLE field , but the it doesn’t understand the field in the datatable. I am using the latest data abstract (7.0.62.1049 build) with Delphi XE3 Professional, on Win 7 (64bit). The system is on firemonkey.
Thank you in advance.
Hello,
Try do the following instruction:
- Drop TDADataSource component on a form.
- Assign TDADataSource.DataSet property with TDACDSDataTable component.
- Assign TBindSourceDB.DataSource property with TDADataSource component.
Look at screenshot
http://screencast.com/t/TVVNQqecS
We also recommend to use TDAMemDataTable instead of TDACDSDataTable.
Hello, thank you for the reply.
I will try your suggestion, and come back again.
Hello again.
Well, I have tried the same aproach before your reply, and i tried again following your suggestion. Neither one TDACDSDataTable or TDAMemDataTable works. The problem is that, when i assign the TBindSourceDB.DataSource to TDADataSource, doesn’t give me any field on the TBindSourceDB component, in order to live bind it with the TText component. What am i doing wrong i dont know.
On the other hand i have managed to bind it with TBindScopeDB, but it is depreciated over TBindSourceDB. Please advice.
Hello,
Please, open and close TDACDSDataTable table in design-time. TBindSourceDB will fill by corresponded fields. Check TDACDSDataTable.Fields property.
Hello, sorry, doesn’t work for me. I wonder, in you screenshot suggestion you have datasreemers etc on the same form, in my project all these connection and streaming components are on a datamodule. Is this the problem , i dont get the bindsource updated. Additionaly, there is no TDACDSDataTable.Fields property. What exactely dou you meen? For your information, the TBindScopeDB is updated with the fields. Please advisce.
Thank you again.
Hello,
Can you send us your small testcase? We will check and fix it.
Hello, thank you again for the reply.
Do you need testcase, with app server and client, or just the client?
In any case, on your project you can have the connection,schema and steemers on a datamodule, and the problem will rise. If you can’t do that, i will try to supply testcase.
Thank you again.
Hello,
Here is a my testcase.
- Create a simple DA FMX app
- Recompile both projects
- Change TDAMemDataTable to TDACDSDataTable and fill corresponded properties.
- Activate server
- Create TBindSourceDB and fill TBindSourceDB.DataSource property
- Open TDACDSDataTable. Then I can see fields in TBindSourceDB and assign them.
Hello, and thank you for the effort.
The thing you suggest, doesn’t apply to my project. The problem is that even i activate the server, i don’t get anything on my TDA…Table, and the reason is that, during clients connection(run time), the system verifies the client, assigns a new connection depending on the users credentials, and then the clients connects to the appropriate database.Every client on my system, has his own database.All databases (eventually all clients), has same schema. So, i have to find an other way to accomplish data binding, since the client, when not connected to the clients database, doesn’t get any data.
Is there any other way, to get the data tables fields?
The only way to have fields in bindsourcedb, is by manually updating the bindsources dataset fieldsdef, then i have fields to livebind, but on the other hand, i don’t know if there is a draw back with this technic, and what kind of wall should i meet in the projects future.
Please advice.
Thank you.
Hello,
Use TBindingList component and add live binding manually.
- Create TBindingList component on main form
- Dbl click on TBindingList to show Bind component list
- Add new ‘TLinkPropertyToField’ live binding
- Fill ‘Component’, ‘ComponentProperty’, ‘DataSource’ and ‘FieldName’ properties of new TLinkPropertyToField.
- In LiveBinding designer this field will be as invalid. When you run app and open data table it will work fine.
Hello, and thank you ,that works fine.