Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

VB.NET Desktop Dashboard Application

  • 06-12-2010 07:06PM
    #1
    Closed Accounts Posts: 22


    Im Programming a VB.NET desktop dashboard Application in VS 2010 using a MS Access database. I have a query in my database setup like this
    Year Location Count

    I want to display a table in my application like this:

    Year, Unique Location, Unique Location, Total
    Count Count
    Ive connected my datasource using the wizard and ive been messing around with dataviews and table adapters but i cant format the datagrid view in the way i want. I was thinking if I connected it I could set an array for the 5 locations and do a for each loop to find the count for each year but this isnt working for me......
    Anyone got any ideas


Comments

  • Registered Users, Registered Users 2 Posts: 1,028 ✭✭✭Hellm0


    Are you proficient in SQL?

    From the sounds of it you need to modify your data source, seemingly to use an grouped query (based solely upon your description of the ideal dataset).

    something like

    SELECT Year, Location, SUM(Total)
    FROM TableName
    GROUP BY Year, Location


  • Closed Accounts Posts: 22 shlen


    Hellm0 wrote: »
    Are you proficient in SQL?

    From the sounds of it you need to modify your data source, seemingly to use an grouped query (based solely upon your description of the ideal dataset).

    something like

    SELECT Year, Location, SUM(Total)
    FROM TableName
    GROUP BY Year, Location

    Problem is the schema has a table for each location, linked to hospitalArea ID table, then linked to Admissions then to Patient, due to the schema I cannot query the tables with the command......


  • Registered Users, Registered Users 2 Posts: 197 ✭✭dumb_parade


    Can you use a union command. i.e.
    Someting like this.

    SELECT Year,total,location
    FROM TableName1
    UNION
    SELECT Year,total,location
    FROM TableName2
    etc.

    You should be able to sort this out with SQL, and not need any looping in your code. Once this piece is ok, you just need to plug your dataTable into your grid.


Advertisement