Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VB.NET Desktop Dashboard Application

Options
  • 06-12-2010 8: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 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 Posts: 194 ✭✭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