By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

Dataset not persisted on PostBack

P: n/a
I have a dataset which I fill in the Page_Load (only 'If Not
Page.IsPostBack'). When I debug the load:
dsmyds1.Tables(0).Rows.Count = 207

When I click on a button and it posts back the dataset and I debug:
dsmyds1.Tables(0).Rows.Count = 0

Any ideas why? The dataset is on the designer.

Thanks.


Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I used a session variable and this worked. Thanks.
"VB Programmer" <Ro************************@juno.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have a dataset which I fill in the Page_Load (only 'If Not
Page.IsPostBack'). When I debug the load:
dsmyds1.Tables(0).Rows.Count = 207

When I click on a button and it posts back the dataset and I debug:
dsmyds1.Tables(0).Rows.Count = 0

Any ideas why? The dataset is on the designer.

Thanks.

Nov 18 '05 #2

P: n/a
You would only want to use a session variable if you need the dataset between different pages. If you only require the information retained for the current page, you should use the ViewState object to store your dataset as it will only las as long as the page last.
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.