I am writing a
VB.NET 2003 web application to operate on my company's intranet. It accesses data in an SQL Server database. I have developed a couple of pages that display data successfully. However, there is one area that I am having trouble getting a handle on, despite purchasing a couple of Wrox books.
Up until now, I have used a whole lot of data adapters and datasets to be able to display my information. The data is stored in a very hierarchical structured database. I now want to be able to edit, delete and add new records to most of these tables. The data would be edited in datagrids.
I have seen some information that indicates that having a 'mirror-image' of the original database stored in a dataset is the way to go, ie this is retrieved from the database, then modified and then sent back.
My questions are:
Is it best to have a single large dataset mimicking the tables and table structure in the database (ie do I bring across one DataSet via one DataAdapter, or use a new DataSet and DataAdapter for each new dropdownlist or datagrid)?
If so, how is this achieved effectively? I only seem to be able to bring across a table at a time.
Further information:
At the moment, it has a page which is a "Job Register", where the user selects an "Area" from a dropdownlist, which when chosen then populates another dropdownlist of "Departments", which when selected populates another dropdownlist of "Sections". When the section is chosen, it populates a datagrid of "Masters", which when chosen populates another datagrid of "Orders", then it populates "Items" (datagrid), then it populates "Subscripts" (datagrid).
(The reason I used datagrids is because I can't display more than one field in a dropdownlist and also because I want the ability to add new, update, delete records in each of these datagrids)
Once a Subscript has been chosen, a button is selected to "Create an Estimate", which then takes the user to another page. On this page there is another hierarchical structure where a dropdownlist is selected, which populates the next and so on. Once an answer is arrived at, the data can be added to a "cart" (a datagrid). This page works well, except I am unsure how to tackle the add new, edit, delete part of the datagrid.
My problems are mainly with the first page mentioned, where I want to add new, update, delete records in the various datagrids. Because each datagrid has been populated using an individual dataset, where the SQL is coded based on the selection of the previous datagrid, I am finding it confusing with how to then update the database and repopulate the datagrids to reflect the changes.
Any help would be greatly appreciated.
Dave.