Re: Datasets - Best approach to use?

From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 01/13/05


Date: Wed, 12 Jan 2005 20:32:06 -0800

It really depends on the architecture of the application. Windows forms,
ASP, Web Service, etc all have different persistence strategies and
limitations.

-- 
____________________________________
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" <Dave@discussions.microsoft.com> wrote in message 
news:71F8DC4C-58A4-49EE-B2E7-7D9466F08C5A@microsoft.com...
> Thanks for an excellent reply, Bill. I also learned some things from the
> sample chapter of your book. Obviously worth buying!
>
> I am still trying to understand the best place to declare the DataAdpater
> and DataSet and the life cycle of each. Will continue to experiment.
>
> Thanks again,
>
> Dave.
>
> "William (Bill) Vaughn" wrote:
>
>> 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.
>> >
>>
>>
>> 


Relevant Pages

  • Re: Datasets - Best approach to use?
    ... > William (Bill) Vaughn ... Using ASP (or ... the bound controls won't call Update--you ... It accesses data in an SQL Server database. ...
    (microsoft.public.vb.database)
  • Re: Datasets - Best approach to use?
    ... Bill. ... The ONLY thing bound controls will do in ASP is to move the data from ... It accesses data in an SQL Server database. ...
    (microsoft.public.vb.database)
  • Re: Learning MS SQL Server 2000
    ... >that I will be able to handle any future updates required to the database as ... >and the material was not at all in-depth or specific to SQL Server 2000... ... Books Online, ... then some ASP and ASP.NET books ...
    (microsoft.public.sqlserver.programming)
  • Re: Validate logins with ASP, MS Access and Cookies error
    ... If you plan to do much more ASP, I would advise looking for tutorials ... return another column from the database that stores the users 1st ... 'create connection and recordset objects ... Set cnStr = Server.CreateObject ...
    (microsoft.public.inetserver.asp.db)
  • Re: Validate logins with ASP, MS Access and Cookies error
    ... If you plan to do much more ASP, I would advise looking for tutorials ... return another column from the database that stores the users 1st name ... 'create connection and recordset objects ... Set cnStr = Server.CreateObject ...
    (microsoft.public.inetserver.asp.db)