Hi,

I got a problem by putting 3 SELECT statements in one DataAdatper. I try
to build a 'Select' DataAdatper, which only has select command. I put
following lines in select commandtext

Select * from Orders;
Select * from OrderProducts;
Select * from Products;

I use DataAdapter wizard. DataAdapter wizard will generate 3 tables
automatically like Table, Table1, Table2. Then I go to set table mappings
like Table --> Orders, Table1-->OrderProducts, and Table2 ---> Products. It
seems work find until I try to remove 2nd select. After I remove 2nd Select,
my table mappings are all messed up, Table-->Orders, Table1-->OrderProducts.
It is wrong. I thought if I remove 2nd Select, 2nd tab mapping should be
remove too. In fact, I am wrong. So my question is how to let TabMappings be
synchronized when a Select commad is removed.

Thanks !

fei

Re: TableMappings by Sahil

Sahil
Wed Jan 26 05:53:47 CST 2005

Fei,

The table names by default are

Table
Table1
Table2
....

TableMappings do an almost dumb replacement of the above names, by the names
that you specified.

So, if you had 3 selects and your table mappings work,
Table
Table1
Table2

.. and now you got rid of Table #2, what used to be Table #3 will end up
getting what used to be Table #2's name.

So how do you create a solution that is agnostic to the number of selects?
You can't - not using table mappings atleast.


- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik


"Fei" <fwang@NOSPAMcsystemssoftware.com> wrote in message
news:uhsgEWxAFHA.1300@TK2MSFTNGP14.phx.gbl...
> Hi,
>
> I got a problem by putting 3 SELECT statements in one DataAdatper. I try
> to build a 'Select' DataAdatper, which only has select command. I put
> following lines in select commandtext
>
> Select * from Orders;
> Select * from OrderProducts;
> Select * from Products;
>
> I use DataAdapter wizard. DataAdapter wizard will generate 3 tables
> automatically like Table, Table1, Table2. Then I go to set table mappings
> like Table --> Orders, Table1-->OrderProducts, and Table2 ---> Products.
> It seems work find until I try to remove 2nd select. After I remove 2nd
> Select, my table mappings are all messed up, Table-->Orders,
> Table1-->OrderProducts. It is wrong. I thought if I remove 2nd Select, 2nd
> tab mapping should be remove too. In fact, I am wrong. So my question is
> how to let TabMappings be synchronized when a Select commad is removed.
>
> Thanks !
>
> fei
>