command.ExecuteNonQuery returns -1

I would like to know what does the value -1 indicate when I execute the command.ExecuteNonQuery  which excutes a stored procedure.

iResult = command.ExecuteNonQuery

iResult shows -1
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.
countrymeisterAuthor Commented:
countrymeisterAuthor Commented:
So how do I know if my stored procdure excuted correctly
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

If there is an error executing it will throw it.
otherwise you can use an return a specific value in the stored proc if it ran correct.

Executed OK
return 1
return 0

are you updating deleting inserting, or all?
countrymeisterAuthor Commented:
I am inserting records
if you have an identity on the table you can use
return @@IDENTITY;

mycom.CommandType = CommandType.StoredProcedure;
SqlParameter sp = new SqlParameter();
sp.Direction= ParameterDirection.ReturnValue;
string s= mycom.Parameters[0].Value.ToString(); or whatever you need it as

if you need more info let me know

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.