What i am trying to achieve is if:Code:Dim result As Integer Dim rc As Integer = CType(FormView1.FindControl("rental_chargeTextBox"), TextBox).Text Dim ssm1 As Integer = CType(FormView1.FindControl("SSMTextBox"), TextBox).Text Dim ssm2 As Integer = CType(FormView1.FindControl("SSM2TextBox"), TextBox).Text Dim ssm3 As Integer = CType(FormView1.FindControl("SSM3TextBox"), TextBox).Text result = Int(rc) + Int(ssm1) + Int(ssm2) + Int(ssm3) CType(FormView1.FindControl("total_rental_chargeTextBox"), TextBox).Text = result
rc=10
ssm1=1
ssm2=0
ssm3=1
result would equal 12.
What i am getting is 1011.
Can anyone tell me why it is adding them together into a string instead of adding the textbox values together as a sum total?


Reply With Quote
(it will help you avoid problems like this)

