Solved

Store values from datareader

Posted on 2008-06-12
2
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# MVC Insert Multiple Row into DB 2 101
asp web application 3 55
Shared Service Environment 2 54
Delete command SQLdatasource in asp.net, vb 2 23
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…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

751 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