Equivalent to this Delphi code?

What’s the .NET command to use instead of something like this from Delphi? Is it the LocalCommand I should be using on a DA Custom Server and if so is there a sample? I have tried that but am getting an error (Execution of commands has been disabled (ExecuteCommand)) even though I set AllowExecuteCommands to true.

var aLogCmd:IDASQLCommand;
begin
aLogCmd := LoginSchema.NewCommand(Connection, ‘LogLogoutMobile’);
aLogCmd.ParamByName(‘LogTime’).AsDateTime:=now;
aLogCmd.ParamByName(‘Username’).AsString:=Session[‘UserID’];
aLogCmd.Execute;

Hello

You mentioned that you have resolved this. Could you post the solution here for further reference?

Sure, yes

  var aLogCmd:RemObjects.DataAbstract.LocalCommand:=new  RemObjects.DataAbstract.LocalCommand();
  aLogCmd.ServiceInstance:=self;
  aLogCmd.ServiceName := 'DataService';
  aLogCmd.SessionID:=SessionID;     
  var pLogTime:=new DataParameter('LogTime',DateTime.Now);
  var pUsername:=new DataParameter('Username',Username);

  aLogCmd.Execute('LogLoginMobile',[pLogTime,pUsername]);
1 Like