Pregunta

I'm trying something like:

            using (var db = new Database(ConnectionString, DataProvider))
            {
                var spResult =
                    db.Execute("exec [cmtUpdateOrganization] @Id,@FullName",
                               new
                                   {
                                       organizatonData.Id,
                                       organizatonData.FullName
                                   }
                        );
                if (spResult == 0 || spResult == 1)
                    return true;
                return false;
            }

But it appears the spResult is always -1.

Although in the stored procedure, it definately returns 0. I validated with the same parameters on sql server itself.

Output parameters work fine, but that is not what i prefer to do as it involves changing a lot of stored procedures.

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top