Ah, no. The TableAdapter is a strongly typed class that's constructed by
Visual Studio code generators at design time.
I suggest building one or more Command objects at runtime. They can be
configured with any SELECT statement(s) you need and the DataReader created
by the Command ExecuteReader method can be used to build an untyped
DataTable.
I discuss this in my book at length...
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
"John" <(E-Mail Removed)> wrote in message
news:O#(E-Mail Removed)...
> Hi Gregory
>
> I need to do this at runtime as there are two many options to add at
> design time.
>
> Thanks
>
> Regards
>
> "Gregory A. Beamer" <(E-Mail Removed)> wrote in message
> news:7DAA3EDF-74DF-435D-B085-(E-Mail Removed)...
>> Open the DataSet in the designer and right click on the table in
>> question. you can then choose to add a new command. Add each command you
>> desire, one by one, and you are done.
>>
>> While this is not a precise answer to your question, there is a
>> step-by-step for creating new queries in this blog entry:
>> http://gregorybeamer.spaces.live.com/Blog/cns!B036196EAF9B34A8!974.entry
>>
>> --
>> Gregory A. Beamer
>> MVP: MCP: +I, SE, SD, DBA
>>
>> Blog:
>> http://feeds.feedburner.com/GregoryBeamer
>>
>> ********************************************
>> | Think Outside the Box! |
>> ********************************************
>> "John" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> You are correct TableAdapter. How do I add additional sql to it such as
>>> FillByFieldA, FillByFieldAandFieldB etc.
>>>
>>> Thanks
>>>
>>> Regards
>>>
>>> "William Vaughn (MVP)" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> The (obsolete) DataAdapter can only accept on SelectCommand. While that
>>>> Command can contain several SELECT statements and these can have
>>>> multiple Parameters, it returns one resultset and generates one
>>>> DataTable for each rowset returned.
>>>>
>>>> I expect what you need is a TableAdapter. This class can have several
>>>> Fill methods that can be programmed to return a rowset/DataTable given
>>>> different SELECT statements (as long as the same columns are returned)
>>>> and different Parameters.
>>>>
>>>> --
>>>> __________________________________________________________________________
>>>> William R. Vaughn
>>>> President and Founder Beta V Corporation
>>>> Author, Mentor, Dad, Grandpa
>>>> Microsoft MVP
>>>> (425) 556-9205 (Pacific time)
>>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>>> http://betav.com http://betav.com/blog/billva
>>>> ____________________________________________________________________________________________
>>>>
>>>>
>>>>
>>>> "John" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> Hi
>>>>>
>>>>> I need to add additional SELECT commands to dataadapter that take
>>>>> various filter and order by parameters. How do I add these additional
>>>>> commands to the dataadapter?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Regards
>>>>>
>>>>>
>>>
>>>
>>
>
>