Add code SQL in the class method lazarus / 16-Databases ---------------------------------------------------------------------- carlos_am_2003 · 2022-11-21 12:15 Hello! I have a class, for example, TCar and I need to save the data of the class TCar to any database. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TCar = classprivatename: string;year : integer;end  How can I add code to save an object TCar in the database? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TCar = classprivatename: string;year : integer;procedude SQL_InsertOrUpdate;procedude SQL_Delete;end  OR Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TCar = classprivatename: string;year : integer;end;TSQL_Car = classprocedure SQL_InsertOrUpdate(car : TCar);procedude SQL_Delete(car : TCar);  What do you think? Help me! ---------------------------------------------------------------------- Zvoni · 2022-11-21 13:30 Do you have code using SQL at all? That's not in a class? that works? Because right now, i don't get it, what the problem is ---------------------------------------------------------------------- MarkMLl · 2022-11-21 13:50 I think he's looking for a way to serialise an instance into a table. Deserialisation costs extra :-) MarkMLl ---------------------------------------------------------------------- carlos_am_2003 · 2022-11-21 14:12 Hi! I would just like an opinion on the best way to go about it. ---------------------------------------------------------------------- Zvoni · 2022-11-21 14:15 How about reading the documentation? https://wiki.freepascal.org/SQLdb_Programming_Reference I'd start with "How to set up the SQL-Trinity" (Connection-, Transaction-, Query-Objects)