Solved

Store values from datareader

Posted on 2008-06-12
2
187 Views
Last Modified: 2010-04-21
Greetings all

I have a series of values (eg. LatestTitle, Author, WhereAvailable) stored in a table (which will only ever contain a single record). This will be read when the page first loads and be dispalyed  appropriately.

My idea is to use a DataReader to retrieve the values and store them in AspHyperlink, AspLabel and ASPTextBox.

My questions:-

1.  Is the DataReader the best way to go for this (assuming that the data won't change)?
2.  Am I correct in saying that the fields, once populated, will retain their values during PostBAck?

In advance, thanks!

   allanmark
0
Comment
Question by:allanmark
2 Comments
 
LVL 21

Accepted Solution

by:
naspinski earned 200 total points
ID: 21768835
DataReader is fine as a data access method.  Of which there are countless (I am very fond of LINQ right now).
For speed of such a small entry I would probably use a local XML file as I am assuming this table is stored in a SQL db and that requires a DB call each time.

As for the postback question, you are correct, they will stay populated on postback.
0
 

Author Closing Comment

by:allanmark
ID: 31466521
Many thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp.net mvc return json 2 57
How to deploy to IIS 7 on 2008R2 server with DUO 2-step login? 2 37
Class object 2 27
Resolve Dependency Issues 4 48
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now