Hello everyone,
In the page_load section of my aspx.vb, when reloading the page (postback), I have to retrieve the datasets using a (long) list of assignments
[tt]
Set dsMyDataSet1 = session("dsMyDataSet1")
Set dsMyDataSet2 = session("dsMyDataSet2")
Set dsMyDataSet3 = session("dsMyDataSet3")
...
[/tt]
(followed with similar instructions with dataviews)
I have already been able to replace the "daDataAdapter1.Fill(dsMyDataSet1)" list with a loop in the "if Not IsPostBack" subsection of Page_Load, and similarly to loop the saving of these datasets and dataviews in the session object.
I (somehow) store the datasets in a hashtable and then execute something like this in the Page_PreRender:
[tt]
Dim dsTemp as DataSet
For Each sTemp as String In htHashTable.Keys
dsTemp = htHashTable.Item(sTemp)
session(dstemp.DataSetName) = dsTemp
next
[/tt]
I am now trying to do the converse, i.e. to set the (existing) dataset objects back to the values stored in the session. Naturally, these datasets are used elsewhere than just in the page_load sub.
Of course, changing the above code [tt]session(dstemp.DataSetName) = dsTemp[/tt] with [tt]dsTemp=session(dstemp.DataSetName)[/tt] cannot work.
Does anyone have an idea on how to automatize these [tt]dataset=session("...")[/tt] lines ?
Thanks,
Warren
In the page_load section of my aspx.vb, when reloading the page (postback), I have to retrieve the datasets using a (long) list of assignments
[tt]
Set dsMyDataSet1 = session("dsMyDataSet1")
Set dsMyDataSet2 = session("dsMyDataSet2")
Set dsMyDataSet3 = session("dsMyDataSet3")
...
[/tt]
(followed with similar instructions with dataviews)
I have already been able to replace the "daDataAdapter1.Fill(dsMyDataSet1)" list with a loop in the "if Not IsPostBack" subsection of Page_Load, and similarly to loop the saving of these datasets and dataviews in the session object.
I (somehow) store the datasets in a hashtable and then execute something like this in the Page_PreRender:
[tt]
Dim dsTemp as DataSet
For Each sTemp as String In htHashTable.Keys
dsTemp = htHashTable.Item(sTemp)
session(dstemp.DataSetName) = dsTemp
next
[/tt]
I am now trying to do the converse, i.e. to set the (existing) dataset objects back to the values stored in the session. Naturally, these datasets are used elsewhere than just in the page_load sub.
Of course, changing the above code [tt]session(dstemp.DataSetName) = dsTemp[/tt] with [tt]dsTemp=session(dstemp.DataSetName)[/tt] cannot work.
Does anyone have an idea on how to automatize these [tt]dataset=session("...")[/tt] lines ?
Thanks,
Warren