使用VB.Net(Windows应用程序)
表1
ID Formula
001 a+b+c
002 a-b*c
003 a*b
004 a/b
...
...
用户输入
Textbox1.text = id of the formula (users input)
Textbox2.text = value1
textbox3.text = value2
textbox4.text = value3
Conditons
If the user enter the value in the textbox1.text = 001
then it will add 3 value (textbox2.text + textbox3.text, + textbox3.text), because user selected the formula1
If the user enter the value in the textbox1.text = 003
then it should multiply (textbox2.text * textbox3.text), because user selected the formula2
....
我想根据他们的id获取一个公式,然后我想传递值a = textbox2.text,b = textbox3.text,c = textbox4.text
代码
cmd = "Select Formula from table1 where id = '" & textbox1.text & "'"
dim f1 as string
f1 = cmd.executescalar
所以公式存储在f1中,然后我想传递用户输入的值
例如
f1 = a + b * c表示我必须传递值a = textbox1.text,b = textbox2.text,c = textbox3.text
如何做到这一点。
需要VB.Net代码帮助