Re: Datasets - Best approach to use?

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


Date: Thu, 13 Jan 2005 23:03:11 -0800

That's how I write all my books--how to transition from one technology to
the next.
Hope it helps.

-- 
____________________________________
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.
__________________________________
"Mitchell Vincent" <mitchell.vincent@gmail.com> wrote in message 
news:OL1eSgb%23EHA.2316@TK2MSFTNGP15.phx.gbl...
> Personally, I'm writing desktop applications so it is all Windows forms.
>
> The book looks good, I'll pick up a copy for sure.. It does seem odd 
> though that every book I've read on .NET is written from the point of view 
> of someone coming from pre-.NET up. I guess that will change over time, 
> but a book saying "this is how you do it" verses "this is how you do it in 
> ADO, and now how you do it in .NET, and why they changed it" would be much 
> better for people like myself that are veteran programmers (in 
> non-Microsoft languages) but new to .NET programming. Please, if you have 
> any suggestions let me know!
>
> Thanks for the reply!
>
> --
> - Mitchell
>
> "William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message 
> news:OeWLVjS%23EHA.1300@TK2MSFTNGP14.phx.gbl...
>> 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