Remote eror : commandtext changes are not allowed

70 Views Asked by At

In DataSnap, I have a TSQLConnection and TFDQuery with TDataSetProvider in the server, and in the client I have TSQLConnection with TDSProviderConnection and TClientDataSet and TDataSource to show data in a TDBGrid.

When I want to insert into SQL from the client, I write this code:

ClientDataSet2.CommandText:='INSERT INTO [table_name] (param) VALUES(:v)';
ClientDataSet2.Params.ParamByName('v').AsString:='a';

ClientDataSet2.Execute;

When I want use this code in the client, the program shows an error:

Remote error: commandtext changes are not allowed

How can fix this problem?

0

There are 0 best solutions below