Re: commandBuilder Update SQL generation for > 1 table?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: William Ryan eMVP (dotnetguru_at_comcast.nospam.net)
Date: 05/12/04


Date: Tue, 11 May 2004 21:33:17 -0400


"Mark" <mark.lerch@quest.com> wrote in message
news:afb00bd2.0405111702.61057799@posting.google.com...
> In ADO, I could issue a query (using an MSS provider) which returned a
> result set from multiple tables, and update the data in a grid and
> post it. (I'm actually not quite sure how that works but it does).
>
> In ADO.NET I can't do this, I have to roll my own UPDATE, which isn't
> possible for ad-hoc queries.
>
> Does anyone know why this changed and if there is any technique to
> allow updates of ad-hoc queries in a data grid involving multiple
> tables?

It changed b/c the ADO.NET paradigm entails decoupling the data from the
database. In old school ado, you'd have a bitch of a time grabbing a
recordset from SQL Server and having it elegantly created in excel. Not so
in ADO.NET. You'd have a bear of a time grabbing data from all sorts of
places.
>
> Thanks

You don't need to roll your own logic although it's advisable to . You have
TRemendous power in client side queries with DataTables and DataViews and
while it isn't as rich as ANSI SQL, it's not far from it. So the trick is
to pull your data over into different tables that mirror your database, link
them with DataRelations where applicable, modify your data, and send
updates against each individual table. If you don't care about performance
or concurrency, the commandbuilder will do it for you. Check out
www.betav.com ->Articles ->MSDN, Weaning develoeprs from the
CommandBuilder...it's a great discussion on this topic.

HTH,

Bill



Relevant Pages

  • Re: VB 6 and MS SQL Server 2000 - (Yudkin)
    ... Since you have multiple SELECT statement, ... If I need to use ADO, what components do I have to include in my project? ... GetClipString is an RDO API. ... SQL SP's have no concept of event flows. ...
    (microsoft.public.vb.general.discussion)
  • Re: ADO and Multithreading
    ... >I am devloping av program for merging PDF-files at specific times during the ... Multiple merges can occur at the same time and therefore I will use ... >I am also able to get access to the database using ADO and retreive data. ...
    (alt.comp.lang.borland-delphi)
  • Re: Microsoft Access and Multiple result sets
    ... > With ADO v1.1 you can return multiple result sets via a single DataReader. ... the Jet OleDb provider does not support multiple SQL commands. ...
    (microsoft.public.data.ado)
  • Problems in Client/Server Implementation of an MFC application
    ... Can I make a general implementation by using ADO? ... Now I am using Multiple SQL queries for multiple table updations. ... But I think MySQL won't support transactions...Is there any other ...
    (microsoft.public.vc.mfc)
  • commandBuilder Update SQL generation for > 1 table?
    ... I could issue a query (using an MSS provider) which returned a ... allow updates of ad-hoc queries in a data grid involving multiple ...
    (microsoft.public.dotnet.framework.adonet)