0 Replies - 1986 Views - Last Post: 26 July 2013 - 05:28 AM

#1 artemix22  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 142
  • Joined: 21-January 12

VB.NET - MySQL multiply two field, sum the result, then show it to DGV

Posted 26 July 2013 - 05:28 AM

i don't know if this is possible.

i have a datagridview on my application, i need to multiply two field from database, sum the result then show it to datagridview.

maybe something like this :

Posted Image

i don't know how to use SINGLE QUERY to make it happen.

i know how to use
SUM(field1 * field2)

but it will give me the sum result without showing the multiply result.

so far i get this error : "operator + is not defined for dbNull", i multiply
(field1 * field2)
from query then sum the multiply result from datagridview.

or should i make 2 query? multiply the field
(field1 * field2)
sum(field1 * field2)
any suggestion will be appreciated.

thanks in advance.

This post has been edited by artemix22: 26 July 2013 - 06:23 AM

Is This A Good Question/Topic? 0
  • +

Page 1 of 1