Solved

System.Data.SqlClient.SqlException: Procedure or function 'wp_session_spLogout' expects parameter '@SessionKey', which was not supplied.

Posted on 2012-12-28
9
278 Views
Last Modified: 2013-08-26
I have a stored procedure that is throwing a web error whenever a user is logged in and the system times out . I am attaching my stored procedure and the web error log to this question. What do I need to include in my stored procedure to eliminate this web error from appearing on a daily basis?
wp-session-spLogout.docx
web-error.docx
0
Comment
Question by:is_staff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 8

Expert Comment

by:venk_r
ID: 38727410
From the exception that you attached looks like the sessionkey value isn't been passed at times and it throws the error.


System.Data.SqlClient.SqlException: Procedure or function 'wp_session_spLogout' expects parameter '@SessionKey', which was not supplied
0
 

Author Comment

by:is_staff
ID: 38727599
This is true. I am wondering why this is happening and how can I prevent this from happening. This error has some connection with the files below. Any ideas?  Thank you.
TimeOut2.aspx
TimeOut2.aspx.cs
0
 
LVL 6

Expert Comment

by:esolve
ID: 38786195
This error is being generated by your web app and has nothing to do with the proc. So whenever this code runs on your website for whatever reason the actual parameter has not been set.

You will have to modify your webmethod to ensure the parameter is being passed to the proc always.

You can update your proc to allow for default values like below but I don't think this will solve your problem. You will still have to ensure that your code in your web method does always include the parameter which for some reason is not.

ALTER   PROCEDURE [dbo].[wp_session_spLogout]
      @SessionKey      VARCHAR(64) = ''
AS

if(@SessionKey = '') BEGIN SET @SessionKey = NULL END

if(@SessionKey IS NOT NULL)
BEGIN
 'do updates etc.
END
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:is_staff
ID: 38793811
Do you think it has anything to do with the API call being used?
0
 
LVL 6

Expert Comment

by:esolve
ID: 38797355
Do you have the code for the API call? My guess is that the API call passes a null to the procedure.
0
 

Author Comment

by:is_staff
ID: 38811501
The only code I see for the API call is located in Timeout2.aspx.cs.
0
 

Author Comment

by:is_staff
ID: 38982707
Any other suggestions? This error is occuring whenever the web method hits timeout2.aspx page.
0
 

Accepted Solution

by:
is_staff earned 0 total points
ID: 39427332
Go it figured out, it just needed to call a new API to release the session
0
 

Author Closing Comment

by:is_staff
ID: 39438353
Resolved
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question