I'm generally looking for a bit of guidance to the scenario below as I am not sure of the best path to take.
I am creating an ASP.NET site which needs to meet the following requirements:
- Will connect to a database
- Database data needs to be displayed in a custom layout (so no table/grid layout)
- Some of the displayed data will be read-only, so will only be displayed. Other data will need the option to be edited by the user.
- It is possible in the future that some of the read-only data will need to be updated to provide the ability to be edited by the user.
- Program functionality wise I need the ability to read certain values from the retrieved database data.
- Site needs to be as secure as possible.
A simple example could be contact details and car parts. The car parts will be read-only at present and the contact details will be the data that can be edited. In the future it is possible that the car parts could be edited by the user.
The issues I am trying to decide on are:
Which will be the best method to implement which will allow the least amount of code change in the future when the read-only fields need to be edited:-
- Should I go down the SQLDataSource route and bind these to a detailsview/datalist. (As I have only been using ASP for a limited time I'm not sure if I'm able to change the layout of these web controls enough using either CSS or the properties options to meet the display requirements of the site).
- Should I go down the DataSet and TableAdapter route where I can read the data retrieved from the database and the set 'Text' properties of, for example, label controls. I know this is probably the easiest method for reading certain values from the retrieved data.
I realise each method allows me to add in extra functionality in the future to allow the user to update/insert into the database, but I'm not sure which will be the best method for my requirements.
I am kind of leaning towards the DataSet/TableAdapter route, but feel I may not be aware to the full potential of the SQLDatasource method. Any help or advise is much appreciated.
Thanks
AdamPosted Mar 11, 2010, 5:46 AM
To answer your first point - As I am using an AJAX Tab Control, some tabs just display some unique data in a custom layout whereas other tabs will display multiple records in a grid like fashion.
With regards to your second point I realise I may have caused some confusion by not stating this is an ASP.NET site. At the moment I have implemented the use of Datasets and TableAdapters. To do this all I have done is add Datasets to the project via the solution explorer. I've then add TableAdapters to those datasets and implemented the code to 'interface' with the database. Then using instances of those datasets I've utilised the coded functions to perform the required task.
Thanks
Sam HobbsPosted Mar 10, 2010, 12:26 PM
Are you sure you can use a TableAdapter in an ASP application? I think you can do it using Silverlight but I am not sure. If you know how to use a TableAdapter in an ASP application without Silverlight, then please tell me how.