As you said:
Error converting data type nvarchar to int.
It seems that the "textbox27" do not contains a valid integer so it couldn't be parsed also "Else" block here is fixed to zero, so could you please try something like this:
If RadioButton1.Checked = True Then
b.Add(Val(textBox27.Text))
Else
b.Add("0")
End If
Check out
VAL functionality here.