My problem consist in show values into a cell of a DGV control, for example:
MySQL Table:
ID - Name - Price - Type
1 Mouse Pad 2.85$ - a
2 Keyboard 10.50$ - a
3 Hard Disk 80.00$ - c
4 Web Cam 15.02$ - b
5 Printer 45.62$ - c
6 DVD Writer 20.00$ - b
My DataGridView Control:
ID - Name - PriceA - PriceB - PriceC
I want display the results Filtering with these conditions [VB.NET sintax]:
If SQLcolumn(Type) = a Then, show the price into PriceA into the DGV.
If SQLcolumn(Type) = b Then, show the price into PriceB into the DGV.
If SQLcolumn(Type) = c Then, show the price into PriceC into the DGV.
One way is to create a custom List with 5 columns : ID,Name,PriceA,PriceB,PriceC
and after getting data from database and filling the data into a datatable for example , you can proccess the datatable row by row and check if the Type column of your datatablerow is Type ‘a’ then add the row into the List and add the Price to the PriceA column of the list and after proccessing the whole datatable and adding all it’s rows to the List , you can set the List as Datagridview datasource !