Click here to Skip to main content
16,004,192 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

Can someone please help me.

I have a usercontrol with gridview and populated by records from a datatable.
After populating the gridview by datatable, I saved the datatable in session variable. Once i clicked the row in gridview i will load another usercontrol and then once i click back button, it will load again the previous usercontrol thats why i save the datatable into session variable so that i don't need to query again from the database.

The system is runnin but the problem is that sometimes when im retrieving the datatable from session variable, it gives me "Stack Empty" error.

Can someone out there enlighten me what's the problem?

Thanks in advance.
Posted
Comments
Leeland Clay 6-Dec-11 14:58pm    
Can you provide the code that you're using?
Hernan K. Cabrera 6-Dec-11 15:30pm    
I provided my code.

I'm thinking of putting a try catch in the else part where the error occurs. In the catch part, I will retrieve again the data from the table but I hope there's a better idea than that.
Hernan K. Cabrera 6-Dec-11 15:20pm    
Hi Leeland,

Here's my code.

If Session("VolumeDataTable") Is Nothing Then
If clsDAL.GetDataTable(strQuery, dt) Then
GridView1.DataSource = dt
GridView1.DataBind()
Session("VolumeDataTable") = dt
End If
Else
GridView1.DataSource = CType(Session("VolumeDataTable"), DataTable)
GridView1.DataBind() <-- Error is here
End If
Sergey Alexandrovich Kryukov 6-Dec-11 17:17pm    
What that supposed to mean: "I saved the datatable in session variable"?
--SA
Hernan K. Cabrera 6-Dec-11 20:08pm    
Hi SAKryukov,

I mean, I assigned the datatable to a session variable.

1 solution

Hi Leeland,

Thank you very much for the concern.

I forgot to mention that there are 4 independent processes querying and binding into gridview. And because of that I decided to use threading so that simultaneously the 4 processes are running. But I never knew that this threading will cause stack empty error. In my research, gridview binding should not be done simultaneously with other instances of binding.


Here is the site :
http://stackoverflow.com/questions/6852857/databind-within-parallel-invoke-failing-due-to-stack-empty-error

I'm ok now Leeland, again thank you very much.

Hernan
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900