Click here to Skip to main content
15,869,940 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Developers,

i am inserting values into postgreSQL tables using functions, its inserting but i am getting result -1 Why it is coming -1 it should come greater then 0 right.please help me in this.

PgsqlCommand.Executingnonquery();==-1 is coming after inserting.

Sorry for the grammer mistakes

Regards,
Aravind G
Posted
Updated 28-Oct-13 21:45pm
v2

1 solution

Please see the documentation:
http://www.devart.com/dotconnect/postgresql/docs/Devart.Data~Devart.Common.DbCommandBase~ExecuteNonQuery.html[^]
For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1.

You said that you're using functions, and a function is neither an UPDATE, nor an INSERT, nor a DELETE statement, so the return value is -1.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900