computed columns specification problem RRS feed

  • Question

  • Hi.
    i created a small database with a table to store two numbers and the sum. num1,num2 and sum column. In sql i used the computed columns specification to assign sum as num1+num2.

    running the database, everything works fine. i input the numbers and the sum is auto calculated.

    i try to do same thing by bring the table in a vb 2008 form using a datagrid view. when i run the application i can just enter the two values(num1 and num2) in the datagrid but the sum is not calculated despite pressing enter or tab and also the data entered is not saved.

    any help
    Sunday, February 17, 2008 9:09 PM


  • Hi,


    What you can do is if you set the Expression property of the sum column to the calculation you can get the same effect. The calculation will be happening at the database and that doesn't look to be brought in to your tables. Have a look in the help files for DataColumn.Expression property as it's very powerful and you can do quite a lot with it.


    Monday, February 18, 2008 7:35 PM