Solved

Store values from datareader

Posted on 2008-06-12
2
183 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

13 Experts available now in Live!

Get 1:1 Help Now