Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2005, 05:21 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datasets - what is the best approach?

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Lotus approach and .NET joeri VS.NET 2002/2003 3 August 10th, 2007 08:47 AM
Need help with approach rickyc1 Classic ASP Databases 4 July 14th, 2005 10:26 AM
VS.NET MODULAR APPROACH 3Moose BOOK: ASP.NET Website Programming Problem-Design-Solution 2 January 16th, 2005 12:20 PM
what is the common approach for it? thanks Robin1 Classic ASP Databases 6 September 11th, 2004 04:14 AM
what is the benefits for each approach alyeng2000 SQL Server 2000 6 December 31st, 2003 05:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.