Hello there, as mentioned in the title I have some DB problem. I wanted to combine a Mendix programm with some C# code that is managing an SQL database. I created at first an entity in Mendix so it would create the corresponding table in the SQL Database. Then I had the C# programm fill data into the table. Then I tried to look at the Data in Mendix but the Datagrid that was placed on the website was throwing an error. I sadly don’t have the exact wording anymore but it was complaining something about that the “ID” in the entity should not be zero. The ID however wasn’t zero when I filled Data in so I am not sure what Mendix was complaining about. Is it because Mendix itself didn’t create an entry in the Database or why is Mendix complaining when I fill in Data manually into the Database? Is it maybe because the ID is a hidden attribute in Mendix and Mendix just counts the ID up for any Entity? Like my new Entity would have to maybe start 112 because there are 111 other entities Mendix already has created? Another Idea that came to my mind was to have Mendix create the entries and the C# programm would do that by calling maybe a REST service or something. However I am not sure how I would go about doing that. But I’d rather have the C# programm manage the Database entries and use Mendix only to have like a nice Overview of all the Data.
Mendix uses an internal mechanism to generate unique ids for every object. Though it is technically possible to replicate that I would advise not to do so and not do any modifications on the Mendix database that bypass the runtime as you can easily break the data consistency.
I would rather recommend to add an interface (e.g. REST or ODATA) to your app and interface with that.