Populating Web Controls in Web Pages

Joined
Nov 1, 2005
Messages
16
Reaction score
0
I am very new to programming in C# .Net (using Visual Studio 2003) and would like an answer to something that should, in my mind, be relatively easy. I have looked extensively in books and on the Internet, but seem unable to find a satisfactory explanation.

Scenario

I am developing a Web Page which displays data from a single row of an Employee table in a number of Web Controls (i.e. TextBoxes, DropDownBoxes, RadioButtons etc) dependent on an Employee ID entered by the end-user in the same Web Page. The data includes such things as name, address, telephone etc. Once the Employee data has been displayed it must be possible to Update or Delete the employee. What I need to know is the following:

1. Is it better to make use of a Dataset (filled once during Page_Load) or to use a SqlDataReader each time a new employee is selected?

2. How do I fill the Web Controls from the Dataset or the Read method of the SqlDataReader dependent on which of these 2 methods I use? Almost all the examples I have come across seem to fill DataGrids or DataLists with data, but not individual Web Controls.

3. How do I display the Web page again each time I have chosen a new Employee?

4. Do I need to read the Employee table again, at the moment of update, to compare the old data (i.e. the original data) with the new (i.e. any modified data in the Web Controls)?



I need to be able to achieve all this using Visual Studio 2003 (in the code-behind page (EmployeesForm.aspx) and the Web Form page (EmployeesForm.aspx.cs)).



Many Thanks in advance.

Nigel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top