Thursday, March 29, 2012
Performance of datatable.select() func against database query or
I am developing a webportal on VS2005 and ASP.NET 2.0
Using MsSQL SERVER 2005.
I have some static records(around 15000) in the database.These contents
never changed while the application is running.
what i m doing is querying the database only once at the
application_start event of the global.asax file and storing the records
in dataset...and further no query to database is done for this data.
wherever I need this data I fetch it from the dataset...through
datatable.select(filter expression) method.this is done several time for
a single page request and the website is high traffic portal.
Is it an efficient way of doing or there is any other better way by
which I can achieve the same..,as the amount of data is very
large...approx 15,000 records.
Plz Suggest me ........
Thanxxxxxxxxxxxxxx
Regards
Deepti Yadav
NoidaOK, I will suggest you. 15,000 rows for a select is a lot of data to displa
y
in an ASP.NET web application. Are your users realistically going to need to
see all 15,000 rows? why not have a more restrictive select with some sort
of paging mechanism if they want to move to the next page of results?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Mukesh" wrote:
> Hi all
> I am developing a webportal on VS2005 and ASP.NET 2.0
> Using MsSQL SERVER 2005.
> I have some static records(around 15000) in the database.These contents
> never changed while the application is running.
> what i m doing is querying the database only once at the
> application_start event of the global.asax file and storing the records
> in dataset...and further no query to database is done for this data.
> wherever I need this data I fetch it from the dataset...through
> datatable.select(filter expression) method.this is done several time for
> a single page request and the website is high traffic portal.
> Is it an efficient way of doing or there is any other better way by
> which I can achieve the same..,as the amount of data is very
> large...approx 15,000 records.
> Plz Suggest me ........
>
> Thanxxxxxxxxxxxxxx
> Regards
> Deepti Yadav
> Noida
>
Performance of datatable.select() func against database query orthe xquery
I am developing a webportal on VS2005 and ASP.NET 2.0
Using MsSQL SERVER 2005.
I have some static records(around 15000) in the database.These contents
never changed while the application is running.
what i m doing is querying the database only once at the
application_start event of the global.asax file and storing the records
in dataset...and further no query to database is done for this data.
wherever I need this data I fetch it from the dataset...through
datatable.select(filter expression) method.this is done several time for
a single page request and the website is high traffic portal.
Is it an efficient way of doing or there is any other better way by
which I can achieve the same..,as the amount of data is very
large...approx 15,000 records.
Plz Suggest me ........
Thanxxxxxxxxxxxxxx
Regards
Deepti Yadav
NoidaOK, I will suggest you. 15,000 rows for a select is a lot of data to display
in an ASP.NET web application. Are your users realistically going to need to
see all 15,000 rows? why not have a more restrictive select with some sort
of paging mechanism if they want to move to the next page of results?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Mukesh" wrote:
Quote:
Originally Posted by
>
Hi all
>
I am developing a webportal on VS2005 and ASP.NET 2.0
Using MsSQL SERVER 2005.
I have some static records(around 15000) in the database.These contents
never changed while the application is running.
>
what i m doing is querying the database only once at the
application_start event of the global.asax file and storing the records
in dataset...and further no query to database is done for this data.
wherever I need this data I fetch it from the dataset...through
datatable.select(filter expression) method.this is done several time for
a single page request and the website is high traffic portal.
>
Is it an efficient way of doing or there is any other better way by
which I can achieve the same..,as the amount of data is very
large...approx 15,000 records.
Plz Suggest me ........
>
>
Thanxxxxxxxxxxxxxx
>
Regards
>
Deepti Yadav
Noida
>
Hi Deepti,
Although you're not directly displaying all 15,000 records to end-user
(used DataTable.Select to filter), it's still not a good idea to cache all
15,000 records at server-side.
I would suggest to optimize at the database side: with careful index
design, I think you should get good performance when frequently selecting
from the table. After all, the database server also does pretty well to
cache data for frequently queried data.
Hope this helps.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Monday, March 26, 2012
permanently Removing a node from a treeview?
hi all
i have managed to remove a node from a treeview by pressing a button, however it doesnt remove it from the database and when i re-run the program the node is still there. Can anyone please help me?
Granto
During your deletion of the node, you'll need to run a delete statement against the table as well. Then refresh your datatable, dataset, or whatever you are using and rebind to your treeview. Should work fine.
Hi,
This problem which you have posted at:http://forums.asp.net/t/1191381.aspx
If the answers in above thread have helped you out, please mark this post as Resoved. If not, don't hesitate to let me know.
However, I provide some suggestions here. Before you remove the node, you should delete the datain database first. Because only remove nodes won't delete the datain database. You can follow the below codes.protected void RemoveNodeButton_Click(object sender, EventArgs e) { TreeNode nd=TreeView1.SelectedNode;if (nd.Parent ==null) {//you should find which are the children node of it. DeleteNode(nd); TreeView1.Nodes.Remove(nd);//which is parent node }else {//delete the data in database by "nd.Text", such as: delete from test where t1='"+nd.Text+"'" TreeView1.SelectedNode.Parent.ChildNodes.Remove(nd);//which is child node } }//delete the every child of the node.protected void DeleteNode(TreeNode nd) {if (nd.ChildNodes.Count == 0)// It is the deepest node. {//Delete the data of child node in database by "nd.Text", such as: delete from test where t1='"+nd.Text+"'"return; } TreeNodeCollection nds = nd.ChildNodes;foreach (TreeNode ein nds) { DeleteNode(e); }//Delete the data of parent node in database by "nd.Text", if you need to delete the data about parent node. Such as: delete from test where t1='"+nd.Text+"'"return; } Hope this can help you.
cheers for the feedback, could you give an example with code i would need to use?
Granto
Saturday, March 24, 2012
permission denied!
i am trying to use xmlHttp.open
while opening page A from a div in page B
i am using .net 2005 and my sites are on the different domains at
server
using the above function causes "permission denied" error
but when page A is on local host it works fine...
i call the function only with 3 parameters:
xmlHttp.open("GET", url ,true)
without username & password (i tried that too ofcourse)
can anyone tell me what's the problem?
thanx
wb
--
wild_bunch
----------------------
Posted via http://www.codecomments.com
----------------------XmlHttpRequest can only open sites in the same domain as the source of
the calling page.
if you need to call another domain, you will need to put a proxy page on
the calling domain.
-- bruce (sqlwork.com)
wild_bunch wrote:
Quote:
Originally Posted by
hi all
>
i am trying to use xmlHttp.open
while opening page A from a div in page B
i am using .net 2005 and my sites are on the different domains at
server
using the above function causes "permission denied" error
but when page A is on local host it works fine...
i call the function only with 3 parameters:
xmlHttp.open("GET", url ,true)
without username & password (i tried that too ofcourse)
can anyone tell me what's the problem?
>
thanx
wb
>
>
>
--
wild_bunch
----------------------
Posted via http://www.codecomments.com
----------------------
>
permission denied!
i am trying to use xmlHttp.open
while opening page A from a div in page B
i am using .net 2005 and my sites are on the different domains at server
using the above function causes "permission denied" error
but when page A is on local host it works fine...
i call the function only with 3 parameters:
xmlHttp.open("GET", url ,true)
without username & password (i tried that too ofcourse)
can anyone tell me what's the problem?
thanx
wb
quote:
Originally posted by wild_bunch
hi all
i am trying to use xmlHttp.open
while opening page A from a div in page B
i am using .net 2005 and my sites are on the different domains at server
using the above function causes "permission denied" error
but when page A is on local host it works fine...
i call the function only with 3 parameters:
xmlHttp.open("GET", url ,true)
without username & password (i tried that too ofcourse)
can anyone tell me what's the problem?
thanx
wb
my mistake its opening page B from a div in page A
XmlHttpRequest can only open sites in the same domain as the source of
the calling page.
if you need to call another domain, you will need to put a proxy page on
the calling domain.
-- bruce (sqlwork.com)
wild_bunch wrote:
> hi all
> i am trying to use xmlHttp.open
> while opening page A from a div in page B
> i am using .net 2005 and my sites are on the different domains at
> server
> using the above function causes "permission denied" error
> but when page A is on local host it works fine...
> i call the function only with 3 parameters:
> xmlHttp.open("GET", url ,true)
> without username & password (i tried that too ofcourse)
> can anyone tell me what's the problem?
> thanx
> wb
>
> --
> wild_bunch
> ---
> Posted via http://www.codecomments.com
> ---
>
quote:
Originally posted by bruce barker
XmlHttpRequest can only open sites in the same domain as the source of
the calling page.
if you need to call another domain, you will need to put a proxy page on
the calling domain.
-- bruce (sqlwork.com)
wild_bunch wrote:
> hi all
> i am trying to use xmlHttp.open
> while opening page A from a div in page B
> i am using .net 2005 and my sites are on the different domains at
> server
> using the above function causes "permission denied" error
> but when page A is on local host it works fine...
> i call the function only with 3 parameters:
> xmlHttp.open("GET", url ,true)
> without username & password (i tried that too ofcourse)
> can anyone tell me what's the problem?
> thanx
> wb
>
> --
> wild_bunch
> ---
> Posted via http://www.codecomments.com
> ---
>
i open another page on the same domain as A
but i still can't reach permission to change a from it although they are on
the same domain...
did i got the wrong idea from what you tried to say to me?
quote:
Originally posted by wild_bunch
i open another page on the same domain as A
but i still can't reach permission to change a from it although they are on
the same domain...
did i got the wrong idea from what you tried to say to me?
oh and by the way i have changed the permissions to max on both sites
also site A must be client side only!
thanx
Permission to write a file
I'm coding a Web application which requires to write an XML file into a
folder. I'm wondering other than account Everyone which else I can set
permission so that my application can have the rights to write the file.You have to set permissions on the user that asp.net is working on.
By default it is ASPNET
Regards
Martin
"Hai Nguyen" <haiaggie@.neo.tamu.edu> wrote in message
news:ueILnPGVEHA.1048@.tk2msftngp13.phx.gbl...
> Hi all
> I'm coding a Web application which requires to write an XML file into a
> folder. I'm wondering other than account Everyone which else I can set
> permission so that my application can have the rights to write the file.
>
>
Permission to write a file
I'm coding a Web application which requires to write an XML file into a
folder. I'm wondering other than account Everyone which else I can set
permission so that my application can have the rights to write the file.You have to set permissions on the user that asp.net is working on.
By default it is ASPNET
Regards
Martin
"Hai Nguyen" <haiaggie@.neo.tamu.edu> wrote in message
news:ueILnPGVEHA.1048@.tk2msftngp13.phx.gbl...
> Hi all
> I'm coding a Web application which requires to write an XML file into a
> folder. I'm wondering other than account Everyone which else I can set
> permission so that my application can have the rights to write the file.
>
Friday, March 16, 2012
Persist DataTable Values
I have a DataTable that I have defined Globally. I populate this datatable
dynamically with file/folder information that I read directly from the
server. I use this datatable information to bind mainly to a DataGrid, but
I would also like it to persist for the duration that I have a particular
page open. I seem to be losing this data either thru postbacks or by the
way I have coded it. Does anyone have any suggestions on how I can keep
this datatable in memory? TIA
--
Best regards
Paul Perot
President
Perot Solutions
perotsolutions@dotnet.itags.org.earthlink.net
(770) 565 - 9151
(678) 852 - 7789 (c)You began by saying that the DataTable is "defined Globally." What does that
mean? Global to what? Obviously, it isn't truly global, or you wouldn't be
asking how to persist it. For example, if it was global to the Application
(in Application Cache, for example), you wouldn't need to persist it in any
other way. It would be truly global.
I only asked that to get you thinking along these lines, hopefully so that
this situation would not rear its ugly head again for you. The issue here is
scope. And a good understanding of ASP.Net scope is what is needed to
resolve it and any future issues of scope that may arise.
I suspect that by "defined Globally" you mean that you declared a variable
with Page scope, that is, defined in your Page class as a Field or Property
of your Page class, not inside a Method. However, the scope of such a
variable is global to only a single Page instance, and each Request for a
Page creates a new Page instance. A PostBack will not see the value of a
variable declared in a previous instance of this Page class, as the variable
will be re-initialized with the initialization of the Page class.
As you've defined the requirement that this variable be global to all
instances of this Page class (within the context of a single initial Request
and the related group of PostBacks), you could declare it as static (Shared
in VB.Net) in the Page class, or, if you want it re-initialized with each
non-PostBack (initial Request), you could put it into the Page's ViewState
or in Session. If you put it into ViewState, the size of it may affect the
time it takes for the Page to load in the browser (ViewState being a hidden
form field in the HTML form). The advantage of ViewState is that the
variable will disappear as soon as a different Page is Requested. If you use
Session, the Page will have to re-initialize the Session value when it is
Requested via non-PostBack (initial Request).
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Paul Perot" <perotsolutions@.earthlink.net> wrote in message
news:CyjCb.332$X97.100@.newsread2.news.atl.earthlin k.net...
> Hi All:
> I have a DataTable that I have defined Globally. I populate this
datatable
> dynamically with file/folder information that I read directly from the
> server. I use this datatable information to bind mainly to a DataGrid,
but
> I would also like it to persist for the duration that I have a particular
> page open. I seem to be losing this data either thru postbacks or by the
> way I have coded it. Does anyone have any suggestions on how I can keep
> this datatable in memory? TIA
> --
> Best regards
> Paul Perot
> President
> Perot Solutions
> perotsolutions@.earthlink.net
> (770) 565 - 9151
> (678) 852 - 7789 (c)
Persistent Forms Authentication - and Session Variables
I'm doing an ASP.NET project which uses Persistent Forms Authentication
(i.e. once user logged in, they don't have to log in again). However Session
variables are erased after Session has timed out. So I need to re-populate
user specific session variables (such as user email, DOB, Full Name...etc)
when Session has ended.
But strangely, when I tried to do something like...
Dim strArrayUserInfo(10) as String
strArrayUserInfo(0) = drDataReader("FName").ToString
strArrayUserInfo(1) = drDataReader("LName").ToString
strArrayUserInfo(2) = drDataReader("Email").ToString
Session("UserInfoArray") = strArrayUserInfo
I get System.StackOverflowException. If I comment out that line, application
runs correctly but fail at the point where Session("UserInfoArray") is
accessed (i.e. Null Exception). So I de-comment the above code and I was
thrown System.StackOverflowException again.
What could be the problem? I was merely assigning a variable to Session
variable collection. Why ASP.NET throws System.StackOverflowException'
Thank you all in advance!!!!
Max"Max" <zero@.maxdot.com.com> wrote in message
news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Hi All!
> I'm doing an ASP.NET project which uses Persistent Forms Authentication
> (i.e. once user logged in, they don't have to log in again). However
> Session variables are erased after Session has timed out. So I need to
> re-populate user specific session variables (such as user email, DOB, Full
> Name...etc) when Session has ended.
> But strangely, when I tried to do something like...
> Dim strArrayUserInfo(10) as String
> strArrayUserInfo(0) = drDataReader("FName").ToString
> strArrayUserInfo(1) = drDataReader("LName").ToString
> strArrayUserInfo(2) = drDataReader("Email").ToString
> Session("UserInfoArray") = strArrayUserInfo
> I get System.StackOverflowException. If I comment out that line,
> application runs correctly but fail at the point where
> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
> de-comment the above code and I was thrown System.StackOverflowException
> again.
> What could be the problem? I was merely assigning a variable to Session
> variable collection. Why ASP.NET throws System.StackOverflowException'
I bet you have something else called "Session". Change the line to refer to
HttpContext.Current.Session and see if that's any better.
John Saunders
Hi John,
Thanks for the quick response! Unfortunately, I get the same error :(
Any ideas?
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> I bet you have something else called "Session". Change the line to refer
> to HttpContext.Current.Session and see if that's any better.
> John Saunders
>
"Max" <zero@.maxdot.com.com> wrote in message
news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Hi John,
> Thanks for the quick response! Unfortunately, I get the same error :(
Several ideas, none brilliant.
1) Simplify, simplify, simplify
1a) Instead of filling from the datareader, try setting the array elements
to constants. It's simpler.
1b) Try using Session("a"). It's simpler.
2) Are you setting all 10 elements of the array?
3) Turn Options Strict On.
John Saunders
> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>
Hi John,
I tried reducing the Array length to 3 and still it didn't work. This is a
mystery and a nightmare.
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Several ideas, none brilliant.
> 1) Simplify, simplify, simplify
> 1a) Instead of filling from the datareader, try setting the array elements
> to constants. It's simpler.
> 1b) Try using Session("a"). It's simpler.
> 2) Are you setting all 10 elements of the array?
> 3) Turn Options Strict On.
> John Saunders
>
>
>
"Max" <zero@.maxdot.com.com> wrote in message
news:erNBq2U8EHA.2124@.TK2MSFTNGP14.phx.gbl...
> Hi John,
> I tried reducing the Array length to 3 and still it didn't work. This is a
> mystery and a nightmare.
Did you try using an array filled with constants? Did you try using
Session("a")? Have you turned Options Strict On?
John Saunders
> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
>
Persistent Forms Authentication - and Session Variables
I'm doing an ASP.NET project which uses Persistent Forms Authentication
(i.e. once user logged in, they don't have to log in again). However Session
variables are erased after Session has timed out. So I need to re-populate
user specific session variables (such as user email, DOB, Full Name...etc)
when Session has ended.
But strangely, when I tried to do something like...
Dim strArrayUserInfo(10) as String
strArrayUserInfo(0) = drDataReader("FName").ToString
strArrayUserInfo(1) = drDataReader("LName").ToString
strArrayUserInfo(2) = drDataReader("Email").ToString
Session("UserInfoArray") = strArrayUserInfo
I get System.StackOverflowException. If I comment out that line, application
runs correctly but fail at the point where Session("UserInfoArray") is
accessed (i.e. Null Exception). So I de-comment the above code and I was
thrown System.StackOverflowException again.
What could be the problem? I was merely assigning a variable to Session
variable collection. Why ASP.NET throws System.StackOverflowException??
Thank you all in advance!!!!
Max"Max" <zero@.maxdot.com.com> wrote in message
news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Hi All!
> I'm doing an ASP.NET project which uses Persistent Forms Authentication
> (i.e. once user logged in, they don't have to log in again). However
> Session variables are erased after Session has timed out. So I need to
> re-populate user specific session variables (such as user email, DOB, Full
> Name...etc) when Session has ended.
> But strangely, when I tried to do something like...
> Dim strArrayUserInfo(10) as String
> strArrayUserInfo(0) = drDataReader("FName").ToString
> strArrayUserInfo(1) = drDataReader("LName").ToString
> strArrayUserInfo(2) = drDataReader("Email").ToString
> Session("UserInfoArray") = strArrayUserInfo
> I get System.StackOverflowException. If I comment out that line,
> application runs correctly but fail at the point where
> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
> de-comment the above code and I was thrown System.StackOverflowException
> again.
> What could be the problem? I was merely assigning a variable to Session
> variable collection. Why ASP.NET throws System.StackOverflowException??
I bet you have something else called "Session". Change the line to refer to
HttpContext.Current.Session and see if that's any better.
John Saunders
Hi John,
Thanks for the quick response! Unfortunately, I get the same error :(
Any ideas?
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>> Hi All!
>>
>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>> (i.e. once user logged in, they don't have to log in again). However
>> Session variables are erased after Session has timed out. So I need to
>> re-populate user specific session variables (such as user email, DOB,
>> Full Name...etc) when Session has ended.
>>
>> But strangely, when I tried to do something like...
>>
>> Dim strArrayUserInfo(10) as String
>>
>> strArrayUserInfo(0) = drDataReader("FName").ToString
>> strArrayUserInfo(1) = drDataReader("LName").ToString
>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>
>> Session("UserInfoArray") = strArrayUserInfo
>>
>> I get System.StackOverflowException. If I comment out that line,
>> application runs correctly but fail at the point where
>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>> de-comment the above code and I was thrown System.StackOverflowException
>> again.
>>
>> What could be the problem? I was merely assigning a variable to Session
>> variable collection. Why ASP.NET throws System.StackOverflowException??
> I bet you have something else called "Session". Change the line to refer
> to HttpContext.Current.Session and see if that's any better.
> John Saunders
"Max" <zero@.maxdot.com.com> wrote in message
news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Hi John,
> Thanks for the quick response! Unfortunately, I get the same error :(
Several ideas, none brilliant.
1) Simplify, simplify, simplify
1a) Instead of filling from the datareader, try setting the array elements
to constants. It's simpler.
1b) Try using Session("a"). It's simpler.
2) Are you setting all 10 elements of the array?
3) Turn Options Strict On.
John Saunders
> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>> "Max" <zero@.maxdot.com.com> wrote in message
>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>> Hi All!
>>>
>>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>>> (i.e. once user logged in, they don't have to log in again). However
>>> Session variables are erased after Session has timed out. So I need to
>>> re-populate user specific session variables (such as user email, DOB,
>>> Full Name...etc) when Session has ended.
>>>
>>> But strangely, when I tried to do something like...
>>>
>>> Dim strArrayUserInfo(10) as String
>>>
>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>
>>> Session("UserInfoArray") = strArrayUserInfo
>>>
>>> I get System.StackOverflowException. If I comment out that line,
>>> application runs correctly but fail at the point where
>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>> de-comment the above code and I was thrown System.StackOverflowException
>>> again.
>>>
>>> What could be the problem? I was merely assigning a variable to
>>> Session variable collection. Why ASP.NET throws
>>> System.StackOverflowException??
>>
>> I bet you have something else called "Session". Change the line to refer
>> to HttpContext.Current.Session and see if that's any better.
>>
>> John Saunders
>>
>>
Hi John,
I tried reducing the Array length to 3 and still it didn't work. This is a
mystery and a nightmare.
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
>> Hi John,
>>
>> Thanks for the quick response! Unfortunately, I get the same error :(
> Several ideas, none brilliant.
> 1) Simplify, simplify, simplify
> 1a) Instead of filling from the datareader, try setting the array elements
> to constants. It's simpler.
> 1b) Try using Session("a"). It's simpler.
> 2) Are you setting all 10 elements of the array?
> 3) Turn Options Strict On.
> John Saunders
>
>> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
>> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>> "Max" <zero@.maxdot.com.com> wrote in message
>>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>> Hi All!
>>>>
>>>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>>>> (i.e. once user logged in, they don't have to log in again). However
>>>> Session variables are erased after Session has timed out. So I need to
>>>> re-populate user specific session variables (such as user email, DOB,
>>>> Full Name...etc) when Session has ended.
>>>>
>>>> But strangely, when I tried to do something like...
>>>>
>>>> Dim strArrayUserInfo(10) as String
>>>>
>>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>>
>>>> Session("UserInfoArray") = strArrayUserInfo
>>>>
>>>> I get System.StackOverflowException. If I comment out that line,
>>>> application runs correctly but fail at the point where
>>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>>> de-comment the above code and I was thrown
>>>> System.StackOverflowException again.
>>>>
>>>> What could be the problem? I was merely assigning a variable to
>>>> Session variable collection. Why ASP.NET throws
>>>> System.StackOverflowException??
>>>
>>> I bet you have something else called "Session". Change the line to refer
>>> to HttpContext.Current.Session and see if that's any better.
>>>
>>> John Saunders
>>>
>>>
>>
>>
"Max" <zero@.maxdot.com.com> wrote in message
news:erNBq2U8EHA.2124@.TK2MSFTNGP14.phx.gbl...
> Hi John,
> I tried reducing the Array length to 3 and still it didn't work. This is a
> mystery and a nightmare.
Did you try using an array filled with constants? Did you try using
Session("a")? Have you turned Options Strict On?
John Saunders
> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
>> "Max" <zero@.maxdot.com.com> wrote in message
>> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
>>> Hi John,
>>>
>>> Thanks for the quick response! Unfortunately, I get the same error :(
>>
>> Several ideas, none brilliant.
>>
>> 1) Simplify, simplify, simplify
>> 1a) Instead of filling from the datareader, try setting the array
>> elements to constants. It's simpler.
>> 1b) Try using Session("a"). It's simpler.
>> 2) Are you setting all 10 elements of the array?
>> 3) Turn Options Strict On.
>>
>> John Saunders
>>
>>
>>
>>> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
>>> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>> "Max" <zero@.maxdot.com.com> wrote in message
>>>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>>> Hi All!
>>>>>
>>>>> I'm doing an ASP.NET project which uses Persistent Forms
>>>>> Authentication (i.e. once user logged in, they don't have to log in
>>>>> again). However Session variables are erased after Session has timed
>>>>> out. So I need to re-populate user specific session variables (such as
>>>>> user email, DOB, Full Name...etc) when Session has ended.
>>>>>
>>>>> But strangely, when I tried to do something like...
>>>>>
>>>>> Dim strArrayUserInfo(10) as String
>>>>>
>>>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>>>
>>>>> Session("UserInfoArray") = strArrayUserInfo
>>>>>
>>>>> I get System.StackOverflowException. If I comment out that line,
>>>>> application runs correctly but fail at the point where
>>>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>>>> de-comment the above code and I was thrown
>>>>> System.StackOverflowException again.
>>>>>
>>>>> What could be the problem? I was merely assigning a variable to
>>>>> Session variable collection. Why ASP.NET throws
>>>>> System.StackOverflowException??
>>>>
>>>> I bet you have something else called "Session". Change the line to
>>>> refer to HttpContext.Current.Session and see if that's any better.
>>>>
>>>> John Saunders
>>>>
>>>>
>>>
>>>
>>
>>