views:

43

answers:

1

I'm using visual studio 2008 and sql server 2005 and everything is working just fine under normal use. However if a user is on a page for a while several minutes with no activity then clicks a button on occassion the site throws the following exception ...

Procedure or Function "sp_name" parameter '@SomeParameterName', which was not supplied

I'm also encountering this error in Visual Studio while debugging the application, in otherwords run the site from visual studio then make some change to the html in VS save the changes and refresh the page.

The error is not consistent nor is the time the page has to stay idle in order for it to occur....

The current sql command object timeout is 30 secs and the website timeout is 30 minutes.

Has anyone else experienced this scenario and what is the fix as I would not except anything to go out of scope until the website timeout occurs ...

Any insight will be appreciated.

+1  A: 

Seems you're passing a value (SomeParameterName) stored on the user session to procedure sp_name. When the user is inactive long enough his session expires so you lost the stored value and you end up passing null on SomeParameterName.

Claudio Redi
Thanks for the reply ... In some cases you yes you are correct in other cases it is a guid passed in url as a parameter then stored in a hdn field ... When the button is click I get the value and send it over ... Do you know what the best way to handle this is other then kicking them back out to the login page?
Fields on the client don't expire so It make no sense to me that comes as null from the client. And storing values on hidden field is old school stuff :-) You could use the ViewState
Claudio Redi
I use a mix of both. I attached an except nothing unique about either one. I don't get it. public MySession() { } public static MySession Current { get { MySession session = (MySession)HttpContext.Current.Session["__MySession__"]; if (session == null) { session = new MySession(); HttpContext.Current.Session["__MySession__"] = session; } return session; } }<asp:HiddenField ID="hdnParent_fk" runat="server"/>