473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dataset not persisted on PostBack

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
2 1108
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil Galey | last post by:
How do you get around the problem of empty tables in a dataset not being included when you do a WriteXML? When you later read the data back into a new dataset, those tables are gone, because they...
4
by: jaime | last post by:
1 I load a text file into a dataset, after doing a bit of work.. 2 Now I have a dataset full of data that I like to transfer to a data base 3 My problem is that if the rowstate of the row is set to...
4
by: Filippo Pandiani | last post by:
I have a grid that shows the file list from a folder. On the postback, how do I get a Dataset from this grid? Thanks, Filippo.
4
by: Bill | last post by:
I have a DataSet that is serialized to a local disk. One of the testers recently experienced a problem where data was saved and the Tablet PC she was testing later went offline. When she restarted...
1
by: Aidan Glendye | last post by:
Hi, I am trying to store various objects within session. Due to the site being hosted in a web farm we are going to have to use either State Server or SQL Server to persist the data in...
0
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
3
by: jhill | last post by:
i have a dataset object i put on my webform, i fill the dataset, bind it to my grid. the grid displays with my data. i put a button with no code in it, but just to have it force a postback. every...
2
by: Kiran | last post by:
Hi, This is something weird I noticed recently in ASP.Net. I have created typed dataset and I have filled the data. when a postback happens, the data of the dataset is lost. Is there a...
12
by: Dave | last post by:
I'm relatively new to ASP and .NET and having trouble getting my head round this. I want to read a datset from a database, and display information from one row at a time, using a Next and a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.