Re: How to Perform SQL Select on a DataSet

From: Sahil Malik (contactmethrumyblog_at_nospam.com)
Date: 03/15/05


Date: Tue, 15 Mar 2005 11:04:53 -0500

The closest similie to a Select on a dataset is to use a combination of
DataTable.Select/ DataRowsCollection.Find/
DataView.Find/DataView.FindRows/DataRelation.GetParentRow/
DataRelation.GetChildRows.

There is no way to do a direct select. You can however do xpath if you
really wanna go nuts.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/

<webbertsolutions@newsgroups.nospam> wrote in message
news:i8od311nlu6u5rpqonle802ico72o8ke0m@4ax.com...
> I am in the process of making a desktop version of an enterprise product.
> In doing so, there a many options that are stored in different tables in
> a database. These values are different depending on the installation.
> I have re-created the database tables necessary into XML files and store
> them on disk.
>
> I would like to take advantage of the current code that I have.
Currently,
> I perform select statements on the database to return a dataset.
>
> I would like to perform the same select statement on the DataSet in order
> to return the "same data" to the upper layers.
>
> For instance, if I had 3 database tables (now DataTables in a DataSet)
>
> +------+ +------+ +------+
> | Cust | | Addr | | Ordr |
> +------+ +------+ +------+
> | cid | | aid | | oid |
> | name | | cid | | cid |
> | | | city | | qty |
> +------+ +------+ +------+
>
> I would like to perform the following select
>
> select cust.name, addr.city, ordr.oid, ordr.qty
> from
> cust, addr, ordr
> where
> cust.cid = addr.cid,
> cust.cid = order.cid
> order by
> cust.name,
> ordr.oid
>
>
> The amount of data in the dataset will be reasonably small since it is
> configuration data.
>
> Is there an easy way to query the DataSet Tables to produce a DataSet that
> is equivalent to the DataSet when querying a database.
>
>
> Thanks,
> Dave
>



Relevant Pages

  • Re: Syncronize dataset with database in multithreaded application.
    ... The configuration data is also stored in at database. ... The DataSet is a reference type, so it's allways passed by reference. ... Of course you need make sure client code doesn't cache the reference to the shared DataSet. ...
    (microsoft.public.dotnet.framework.adonet)
  • Persistency frameworks ?
    ... I am thinking about my configuration data, that resides in a database. ... rewrite of my class structure? ... Best way of syncing the data from the database and the one in any file ...
    (comp.programming)
  • Re: Help on proper method ????
    ... I do not need to keep syncronistaion of memeory with back end database ... becasue data which are pushed are configuration data that never change. ... Whnen a request is coming, I should be abvle to send back message 1, message ... If your memory cache is too ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Web.config on load balanced servers
    ... But then of course you have a bootstrapping problem of how to tell each server what database to connect to. ... each server needs to be informed where to go look for your configuration data. ... config information in static classes or in the cache that someone ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Release of GNADE 1.5.2
    ... Michael> Dear all the GNU Ada Database Development Environment Version ... This release of the GNADE project is intended for building with GNAT ... The GNADE project installation procedure provides for theses product ... 566413 1.3.5a static libraries not build for adbc Makefile modified ...
    (comp.lang.ada)