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 ArticleRe: 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 ArticleRe: StoredProc Returns -1
Check this thread:http://stackoverflow.com/questions/290652/get-output-parameter-value-in-ado-net
View ArticleRe: 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 ArticleRe: 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 ArticleRe: 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 ArticleRe: 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 ArticleRe: 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 ArticleRe: 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 ArticleRe: StoredProc Returns -1
Try to use OUTPUT parameter to get the return value and turn on the SET NOCOUNT ON;
View ArticleRe: 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 ArticleStoredProc 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
More Pages to Explore .....