Moved to VB.NET.
If you are just trying to use the script control to evaluate an equation, then you want to use the Eval method. Don't include
c in the expression. You will use the Eval method to store the result of the expression in
c, don't forget you need to convert it to the correct data type.
See how I modified the expression stored in
s. On a side note, you should use the .NET version of MessageBox.Show.
Like this:
CODE
Dim a As Integer = 5, b As Integer = 6, s As String = ""
Me.AxScriptControl1.Language = "VBScript"
Me.AxScriptControl1.Reset()
s = "a * b"
Me.AxScriptControl1.AddObject("a", a)
Me.AxScriptControl1.AddObject("b", b)
Dim c As Integer = Convert.ToInt32(Me.AxScriptControl1.Eval(s))
MessageBox.Show(c.ToString)
This will display a message box with a value of 30.