Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27153

VS 2010 how can add a column's value to use in an expression of another datatable's column

$
0
0
hi
i use 3 datatable in my form named DT1 , DT2 and DT3 than each datatable has one column named "Value1" , "Value2" and "Value3"
i want to use values of columns from DT2 and DT3 to use in expression of DT1 columns.
please look at the examples :
i want a thing like this :
Code:

DT1.Columns("Value1").Expression=( DT2.Columns("Value2") + DT3.Columns("Value3"))
so if i can do this , in each row of dt2 or dt3 , if i change the value of the cells , then the value of the cells of dt1 that their column name is "Value1" will change.
i mean :
Code:

for example :

 dt2.Rows(0).Item("Value2")=125
 dt3.Rows(0).Item("Value3")=25
 
then :
 
dt1.Rows(0).Item("Value1")=150

how can i do this?

Viewing all articles
Browse latest Browse all 27153

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>