Quantcast
Channel: StoredProc Returns -1
Browsing latest articles
Browse All 12 View Live

Re: StoredProc Returns -1

So in short and to summarize :- ExecuteQuery returns the number of affected rows (if transmitted back to the client) In your case possible options would have been : - reading a cmd.Parameters whose...

View Article



Re: StoredProc Returns -1

Hello ManyTitles.Try using execute scalar or as @limno suggested output parameter. SqlCommand cmd = new SqlCommand("CheckStudentExistence", con); cmd.CommandType = CommandType.StoredProcedure;...

View Article

Re: StoredProc Returns -1

Check this thread:http://stackoverflow.com/questions/290652/get-output-parameter-value-in-ado-net

View Article

Re: StoredProc Returns -1

Hi Limno, the following is my application code for calling the stored proc: public int CheckEmployeeIsUnique(string firstname, string lastname, string email) { SqlConnection con = new...

View Article

Re: StoredProc Returns -1

Yes, you are right. Don't use " return @totalFName ".You can use keyword Return  at the end with a stored procedure that has output parameter.Can you show us your current application code for calling...

View Article


Re: StoredProc Returns -1

Hi limno, thanks for replying. I have tried to return @totalFName using "return @totalFName;" but I still get the same error. Also I thought that when using output parameters the return statement is...

View Article

Re: StoredProc Returns -1

You need to have the return part in your stored procedure and get the output parameter from your calling program.:return@totalFName;

View Article

Re: StoredProc Returns -1

Hi Limno, I have tried to use an output parameterto return the count and received the error"expects parameter '@totalFName', which was not supplied."  The following is my stored...

View Article


Re: StoredProc Returns -1

Hi Patrice, the following is how I am calling my storedproc SqlCommand cmd = new SqlCommand("CheckStudentExistence", con); cmd.CommandType = CommandType.StoredProcedure; con.Open();...

View Article


Re: StoredProc Returns -1

Try to use OUTPUT parameter to get the return value and turn on the SET NOCOUNT ON;

View Article

Re: StoredProc Returns -1

Hi,Knowing how you reading the return value on the client side could help. Do you read a stored procedure parameter whose direction is ReturnValue?

View Article

StoredProc Returns -1

Hi all, I am trying to return total row count but I am getting -1. Please take a look at my storedproc  below.Alter PROCEDURE [dbo].[CheckExistence] @firstname nvarchar(35), @lastname nvarchar(35),...

View Article
Browsing latest articles
Browse All 12 View Live




Latest Images