Re: Datasets - Best approach to use?
From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 01/12/05
- Previous message: DMI: "How to connect Multiple Combo Boxes?"
- In reply to: Dave Stumbles: "Datasets - Best approach to use?"
- Next in thread: Dave: "Re: Datasets - Best approach to use?"
- Reply: Dave: "Re: Datasets - Best approach to use?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 Jan 2005 13:32:52 -0800
If the books told you to mirror your data (replicate would be better as
mirroring makes everything backwards), then you got the wrong books. This is
a widely discussed issue. First, when working with toy databases where there
are a few tables and not many rows (a few thousand at most), then it does
not make much difference what you do--especially if there is only one user.
When you're trying to implement a serious DBMS where many people need to
share the data, simply building a DataSet that contains the contents of a
table won't work--not for long. It simply won't scale. Using ASP (or
ASP.NET) makes the problem worse. In this case you're dealing with DataSets
that are created and (by default) destroyed as soon as the page renders the
HTML back to the client (browser). If you try to save these large DataSet in
the Session state (or wherever), you'll choke the system before long.
No, the approach to take is to create a DataSet that contains the
information that the user needs NOW and work from there. When you create a
DataAdapter, you can create action commands (UPDATE, INSERT, DELETE) into
its infrastructure so that when you execute Update these commands make
changes to the database. No, the bound controls won't call Update--you have
to do that in your code. In an ASP application the bound controls also won't
post the changes to the server-side DataSet--you'll have to do that in your
code. The ONLY thing bound controls will do in ASP is to move the data from
the inbound DataSet (DataTable) to the control so you can see the rows.
I discuss these issues in far more depth in my book and so does David
Sceppa.
-- ____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "Dave Stumbles" <Dave Stumbles@discussions.microsoft.com> wrote in message news:D8C8A27E-4C43-4E96-8153-EDC2D7ECBF56@microsoft.com... >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? > > If so, how is this achieved effectively? I only seem to be able to bring > across a table at a time. > > Any help would be greatly appreciated. > > Dave. >
- Previous message: DMI: "How to connect Multiple Combo Boxes?"
- In reply to: Dave Stumbles: "Datasets - Best approach to use?"
- Next in thread: Dave: "Re: Datasets - Best approach to use?"
- Reply: Dave: "Re: Datasets - Best approach to use?"
- Messages sorted by: [ date ] [ thread ]