# Checking what the best way is to execute a DA command using LocalCommand

**URL:** https://talk.remobjects.com/t/checking-what-the-best-way-is-to-execute-a-da-command-using-localcommand/34152
**Category:** Remoting SDK
**Tags:** net
**Created:** [October 15, 2026, 3:29pm UTC](https://talk.remobjects.com/t/checking-what-the-best-way-is-to-execute-a-da-command-using-localcommand/34152 "2026-10-15T15:29:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![fvancrae](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/f/ad7895/32.png) [@fvancrae](https://talk.remobjects.com/u/fvancrae)
#### Post date: [October 15, 2026, 3:29pm UTC](https://talk.remobjects.com/t/checking-what-the-best-way-is-to-execute-a-da-command-using-localcommand/34152/1 "2026-10-15T15:29:47Z")

</div>

I just wrote some code to execute a command from a da schema from the server (in a service)

I was surprised a bit I had to use

IDbCommand.CreateParameter

followed by a cmd.Parameters.Add(object)

Is this the advised approach?

Everything works but I just wanted to check since the redundant call surprises me a bit

 ![image](https://talk.remobjects.com/uploads/default/original/3X/d/4/d4bfb6cc5fdaa9f20d08e74974cda34127afdba1.png)

---

<div class="post-metadata">

### Author: ![artem.vuitsyk](https://talk.remobjects.com/user_avatar/talk.remobjects.com/artem.vuitsyk/32/22795_2.png) [@artem.vuitsyk](https://talk.remobjects.com/u/artem.vuitsyk)
#### Post date: [October 16, 2026, 9:03am UTC](https://talk.remobjects.com/t/checking-what-the-best-way-is-to-execute-a-da-command-using-localcommand/34152/3 "2026-10-16T09:03:30Z")

</div>

Hi,

The one thing I would change is

```auto
"return (iret > 0)". 

```

ExecuteNonQuery() returns -1 when  
the procedure runs with SET NOCOUNT ON, so a successful write is reported as a failure.

Use

```auto
"return (iret >= 0);" 

```
