Results 1 to 5 of 5

Thread: Queries in the IDE

  1. #1
    ulynen is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2015
    Posts
    22
    Reputation
    28

    Queries in the IDE

    I may not be in the right place.
    I added an mdb file using the add new datasource. this isn't terribly complicated. there are only 3 linked tables and some SQL queries. In the IDE when I display the dataset I can see all the tables but I cannot see any of the queries. Do they get imported when you add a new data source or do you have to manually add them?

    uwe

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,087
    Reputation
    2803
    You have to check "Views" when adding/configuring dataset - this will generate strongly typed tableadapters/tables/rows for the queries in database.
    These views will not show up in dataset designer (that only shows local version of db tables and local adapter queries), you can create the objects in code, or drag a view (from Data Sources window) to a form to have them generated in form.
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

  3. #3
    ulynen is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2015
    Posts
    22
    Reputation
    28
    I selected views but only the tables show up. The queries don't show at all. and under the tools for dataset everything is dimmed.

  4. #4
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,087
    Reputation
    2803
    I just tested with a sample Access database that had lots of queries (named 'qrySomething'), and they all showed up under Views in the Data Sources Configuration dialog, I believe these are called 'stored queries'. In Server Explorer I also see some 'qry' items that is listed under Stored Procedures, but these are not available in dataset, I couldn't find VS to support Access SPs in dataset designer.
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

  5. #5
    ulynen is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2015
    Posts
    22
    Reputation
    28
    thanks for your help
    I guess I have to type the queries in my VB.Net program and execute them. When I open the file in access everything works beautifully. The mdb is set up with ODBC and has 3 tables linked to a MySQL database. I don't manipulate any of those tables. There is a 4th table that gets rebuilt based on a query when the app starts. I run select queries to pick up patient info (a doctor's office) based on the caller id and use the 4th table to get their latest appointment.
    Uwe

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •