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.

    Code Snippet

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

    I would like the resulting DataTable to have column names like., cars.make, cars.model,, 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)

    Any advice would be appreciated.


    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