Hi,
Please try following might be helpful.
Dim dr As DataRow
Dim WeightedAverage As Integer = IIf( Convert.ToInt32(dr("Number of A Levels"))>3,((Convert.ToInt32(dr("UCAS Points")/3)*(Convert.ToInt32(dr("Number of A Levels")-(1-(1/Convert.ToInt32(dr("Number of A Levels")))))/Convert.ToInt32(dr("Number of A Levels"),Convert.ToInt32(dr("UCAS Points")/Convert.ToInt32(dr("Number of A Levels"))
i have use
dr that will be value of your
Data Set current Row.
Thanks,
Imdadhusen