I am pretty new to delphi and I would like to ask how can I create a correct SQL statement / SQL string in delphi.
I have tried something like this:
sql:='use [TestovaciaDb] INSERT INTO [dbo].[client]([Meno],[Priezvisko]) VALUES('+name+','+surname+')';
I am using MS SQL server 2012
But I am getting a exception there. Thank you
EDIT:
meno and priez are variables with values from TEdit1 and TEdit2:
meno:= Edit1.Text;
priez:= Edit2.Text;
use parameterse.g.'INSERT INTO client (Meno, Priezvisko) VALUES (:Meno, :Priezvisko)';. Then you'll need to fill parameter values in your query component. And, when you're asking for help, you have to provide relevant information. That you got "an exception" is pointless here. You need to provide the exact error message you got. Also would be more than useful to tell us which DB component you used (e.g.TADOQuery).