Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I am trying to create a mashup that does simple CRUD operations on an InfoTable. I suppose this is possible. Does anybody know a tutorial or can point me the right direction for accomplishing this?
So far I have managed to bind the table to a grid but I am stuck at modifying the data.
Solved! Go to Solution.
Hans,since InfoTable is only a datastructure in the memory I think you are looking for persisting this data from the memory to either a DataTable or to an external RDBMS table to store in external database? (That's my assumption when i read through your question where you mention about binding them to a grid and then performing CRUD on that) - correct me if i am wrong.
Whether you are storing them in a DataTable or externally in a RDBMS system you will need services to perform those operation. If you are using DataTable you can utilize some of the inbuilt services of a DataTable
You can also try this video for further help Video Link : 1457
If you are using external DB, for e.g. Oracle or MS SQL, MySQL, you'll need to create your own services with SQL (much like you would do directly on SQL database) and that Service type will required to be of SQL type (SQL Command or SQL Query - depends on what you are intending to do with that Service) for e.g.
To work with external RDBMS you'll have to create a Thing which will inherit Thing Template of type of Database you are attempting to connect to. You can import the extensions from http://marketplace.thingworx.com/Items/Relational-databases-connectors
Hope this helps
Hans,since InfoTable is only a datastructure in the memory I think you are looking for persisting this data from the memory to either a DataTable or to an external RDBMS table to store in external database? (That's my assumption when i read through your question where you mention about binding them to a grid and then performing CRUD on that) - correct me if i am wrong.
Whether you are storing them in a DataTable or externally in a RDBMS system you will need services to perform those operation. If you are using DataTable you can utilize some of the inbuilt services of a DataTable
You can also try this video for further help Video Link : 1457
If you are using external DB, for e.g. Oracle or MS SQL, MySQL, you'll need to create your own services with SQL (much like you would do directly on SQL database) and that Service type will required to be of SQL type (SQL Command or SQL Query - depends on what you are intending to do with that Service) for e.g.
To work with external RDBMS you'll have to create a Thing which will inherit Thing Template of type of Database you are attempting to connect to. You can import the extensions from http://marketplace.thingworx.com/Items/Relational-databases-connectors
Hope this helps
Thanks! This helps a lot. Using DataTable solves the issue.
One more question: Are you aware of any tutorials that show editing of a DataTable with a mashup?
Glad it helped. You can give this a try, lists all the available tutorials ThingWorx Video Tutorials
Editing is quite straight forward, you can either use the Grid's own functionality of making rows editable by enable the isEditable something like this and then handle the selected and edited values via your services
or you can simply use some value boxes and CRUD buttons on the mashup and bind the data and the action via the respective services, something like this
Just as a side note here, if you're looking forward to storing large amount of data in the Data Table, then you'll be better of with external RDBMS tables due to the performance reasons.