none
Query with UNION Clause RRS feed

  • Question

  • I am using VB 2008 and MS Access Database for creating WinForm Data Applicaton

    I am also using Typed Dataset and Data Bound Controls.

    My Question is when i use the "Add new Data Source" wizard, it does not show me the Views i created in the Database file having UNION clause.

    So how to add such views to Dataset?

    SANDEEP

    • Moved by Vicky SongMicrosoft employee Monday, February 13, 2012 2:20 AM dataset issue (From:Visual Studio Database Development Tools (Formerly "Database Edition Forum"))
    Saturday, February 11, 2012 2:42 PM

Answers

  • Hi SANDEEP,

    I think you can try to follow my steps:

    1. Add new Item---->Dataset

    2.Right Click the designer-->Add TableAdapter

    3. Follow the wizard---Choose the connectionstring-----Use SQL Statements

    4. Write the UNION T-SQL in SSMS to make sure it is right, My test code:

    select EmployeeId as Id, Name from Employees Union 
    Select ProductId, Name from Product
    Have a nice day.

    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 15, 2012 9:05 AM
    Moderator
  • Hi Alan

    Writing SQL having UNION clause mannualy is possible but why isn't that available in wizard?

    Alternatively i have created additional Query based on existing Union Query which selects all column from Union Query, now that this newly created Query(View) is available through Wizard.

    SANDEEP

    SANDEEP

    Wednesday, February 15, 2012 3:20 PM

All replies

  • Hi SANDEEP,

    I am moving your case to the ADO.NET DataSet forum so that you can get better support there.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 13, 2012 2:19 AM
  • This may helps you.

    http://www.oracle.com/technetwork/topics/dotnet/index.html

    Wednesday, February 15, 2012 8:05 AM
  • Hi SANDEEP,

    I think you can try to follow my steps:

    1. Add new Item---->Dataset

    2.Right Click the designer-->Add TableAdapter

    3. Follow the wizard---Choose the connectionstring-----Use SQL Statements

    4. Write the UNION T-SQL in SSMS to make sure it is right, My test code:

    select EmployeeId as Id, Name from Employees Union 
    Select ProductId, Name from Product
    Have a nice day.

    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 15, 2012 9:05 AM
    Moderator
  • Hi Alan

    Writing SQL having UNION clause mannualy is possible but why isn't that available in wizard?

    Alternatively i have created additional Query based on existing Union Query which selects all column from Union Query, now that this newly created Query(View) is available through Wizard.

    SANDEEP

    SANDEEP

    Wednesday, February 15, 2012 3:20 PM