We help IT Professionals succeed at work.

ASP.NET data display

hitcher_lt asked

I'm looking for an advise on best approach to get this right from the first time.

I'm using ASP.NET and C# in development of the website.

Which is the best and most efficient way to display data from a database table in table/grid format as there will be large number of connections made

Database table1 has 10 columns and 32 rows per user.
10 columns and 32 rows must be displayed on the webpage at one time selecting 32 records based on userID.
All except two columns must be read only. One of the two is a text box that will accept user input and update the table1 with new value. The other control is a combo box being populated with values from database table2. Changes in combo box should update table1.

What are my options to implement this? DataGrid? Hardcoded HTML table with 32 rows of Label controls to display read only data and text box and combo box? Or perhaps better way to generate HTML table and map controls to the table dynamicaly? Any other ways?


Watch Question

-- Creating static html table with Label controls will kill the page with heavy viewstate.

-- Creating a serverside html table will

-- Generating an html table at run time from code behind would be best approach if you can manage the dynamically created controls effectively.

>> As there are two columns which will accept the user input you must take GridView.


can you elaborate please on the last option with some main points and steps in achieving this. thanks.
Create a gridView and add columns to it. Then define all columns as readonly which need not to be edited. Bind the grid and handle OnRowEditing,OnRowCancelingEdit,OnRowUpdating evnts

Here are some tutorials :





Thanks very much for info and links.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.