Warm tip: This article is reproduced from serverfault.com, please click

How Insert column looping in datagridview VB.NET

发布于 2020-11-27 04:38:36

Please Check Image

I ask for vb net datagridview,

How do you fill in the "aging" column with status on or off ...

If SC01 has three POS, where one of the POS has ttl_stat OFF, the "aging" column will be filled OFF.

And if SC02 only has one POS and ttl_stat on then the "aging" column will also be ON

Thank you

Questioner
tama moka
Viewed
0
Alex B. 2020-11-27 20:24:39

You can do this in SQL:

SELECT *,  
        (SELECT CASE WHEN EXISTS(  
         (SELECT t2.kd_store FROM test_stack t2
            WHERE t.kd_store = t2.kd_store 
            AND t2.ttl_stat = 'OFF'
          )
        ) THEN 'OFF' ELSE 'ON' END
       ) AS Aging
FROM test_stack t