DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Display query result on Windows Form

  1. #1
    Join Date
    Mar 2007
    Fort Lauderdale

    Question Display query result on Windows Form

    Hi, I'm working in VS2005 with VB.NET (just starting to learn).
    I've got two tables in a SQL Server 2000 database, MONITORS (pkMonitorID, fkWorksiteID, intCaseLoad, etc.) and
    WORKSITES (pkWorksiteID, fkMonitorID, intPositions, etc.)
    in a "one Monitor to many Worksites" relationship.
    I also have a Windows form with one DataGridView for Worksites and a second DataGridView for Monitors.

    I need some way to display the Monitors "Case Load" on the form. That will be the sum of intPositions in WORKSITES where keyMonitorID is the Monitor currently selected in the DataGridView.

    This query gives me a list of the Monitors total "case loads":

    SELECT SUM(intPositions) AS Positions, fkMonitorID
    FROM Worksites
    GROUP BY fkMonitorID

    I'm having major trouble figuring out how to either/or update the intCaseLoad field in the MONITORS table and display a Monitors totat current case load on the Windows Form.

    The reason I need to display it, is that each Monitor may be assigned up to, but no more than 35 "intPositions" or cases, so as Worksites are being assigned to Monitors I need to see how many intPosions they've been assigned so far. Each Monitor may be assigned to more than one Worksite.

    Thanks for any advice or examples. (I'm just learning).


  2. #2
    Join Date
    Mar 2007
    Fort Lauderdale
    No one has a clue?

  3. #3
    Join Date
    Mar 2007
    Fort Lauderdale
    Did I explain the problem poorly?

Similar Threads

  1. query about form retrieval from a database
    By prathimaprasun in forum .NET
    Replies: 0
    Last Post: 11-07-2006, 02:20 PM
  2. Replies: 1
    Last Post: 03-09-2005, 12:58 PM
  3. How to display a form from Windows Service
    By Sandeep Uppal in forum .NET
    Replies: 6
    Last Post: 07-10-2003, 05:59 AM
  4. Replies: 1
    Last Post: 08-02-2002, 07:40 AM
  5. Ho cai display my query result on the screen
    By Jide Bamisaye in forum VB Classic
    Replies: 1
    Last Post: 08-01-2002, 11:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center