473,508 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this bad asp.net design for populating a form?

I have a database with values. I retrieve the data from that database.

I want to display that data from the database on the webpage.

Is it incorrect to take that data and assign it manually like:

(assuming I have textboxes named like this)

txtLastName.Text = MyDataReader.Item("MyDatabaseColumn");

or, am I supposed to do it in a grid or some other control like this:

<ItemTemplate>
<asp:TextBox id="lbl_employer" runat="server" Width="200" text='<%#
DataBinder.Eval(Container.DataItem, "employer") %>'>
</asp:TextBox>
</ItemTemplate>

The former seems just like I did in Classic ASP, so it makes me think
it is "wrong." These textboxes are populated and then the user can
update, etc. from the form. This form doubles as dataentry for new
records also. I was just reusing everything. Does it matter?
Improper design?

Thank you for advice.

Nov 19 '05 #1
1 1162
ne***********@gmail.com wrote:
I have a database with values. I retrieve the data from that database.

I want to display that data from the database on the webpage.

Is it incorrect to take that data and assign it manually like:

(assuming I have textboxes named like this)

txtLastName.Text = MyDataReader.Item("MyDatabaseColumn");

or, am I supposed to do it in a grid or some other control like this:

<ItemTemplate>
<asp:TextBox id="lbl_employer" runat="server" Width="200" text='<%#
DataBinder.Eval(Container.DataItem, "employer") %>'>
</asp:TextBox>
</ItemTemplate>

The former seems just like I did in Classic ASP, so it makes me think
it is "wrong." These textboxes are populated and then the user can
update, etc. from the form. This form doubles as dataentry for new
records also. I was just reusing everything. Does it matter?
Improper design?

Thank you for advice.


What you propose, if I understood right, is fine. No need to stick it in
a grid if you only need a textbox....

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2170
by: deko | last post by:
This may be an easy question, but for some reason the multiple table design idea is throwing me. I'm trying to avoid using one large, wide table - so I've got multiple tables that hold different...
2
1352
by: SStory | last post by:
My client wants to design ever changing forms in Frontpage and have them mailed in HTML format to her. How could I go about using ASP or ASP.NET to take the information of any form she designed...
5
2264
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
3
6026
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
1
1877
by: keliie | last post by:
I have a relatively simple (I assume) issue which I am at a complete loss to address. My issues is: I want to populate fields in my tables with summary data from the same table. Let me explain: ...
2
1696
by: TerryStone | last post by:
I have created a control that displays a list of items. During design mode I fill it with junk data using calls from the constructor. So when I look at a form with the control on, instead of...
0
3663
by: Paul Hadfield | last post by:
I'm looking for thoughts on the "correct" design for this problem (DotNet 2.0 - in winforms, but that's not so important). I've got two combo boxes (combo1 and combo2), both are populating via...
13
3509
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
0
1673
by: koonda | last post by:
Hi all, I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my...
0
7225
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
7123
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
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.