none
Joined SQL and full table Names from Dataset? RRS feed

  • Question

  • Hello,
    I am creating a DataSet  from a SQL Join query and I would like the Table names to be displayed as the column name. It  seems like the DataSet renames the fieldname with an incremented number.

    Here is a sample.

    SQL:
    Code Snippet

    SELECT     cars.*, people.*
    FROM         cars INNER JOIN
                          people ON cars.name = people.name



    I would like the resulting DataTable to have column names like.

    cars.name, cars.make, cars.model, people.name, people.ags

    I know I can add an alias in the SQL  but I was hoping to have it more generic .
    (is this my only option) http://www.theserverside.net/discussions/thread.tss?thread_id=38636

    Any advice would be appreciated.


    Thanks

    Drew
    Thursday, May 1, 2008 2:18 PM

All replies

  • You need to create aliases in this case and ADO.NET will not do it for you automatically.

    Friday, May 2, 2008 9:53 AM
    Moderator