以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码在保存时提示表达式不是方法是什么原因?(已解决)  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=74080)

--  作者:jiterp
--  发布时间:2015/9/1 20:11:00
--  代码在保存时提示表达式不是方法是什么原因?(已解决)
以下代码在保存时提示表达式不是方法,是什么原因?

\'取出对应的代码内容
Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim str as string = txt.text
Dim A As New SQLCommand  
Dim rundm As String
A.CommandText = "selec t runcode fro m sy_from where menuname =\'" & str & "\'"
rundm = A.ExecuteScalar()

\'运行对应的代码内容
If rundm Is Nothing Then  
     Return
Else
     rundm
End If

[此贴子已经被作者于2015/9/6 16:44:53编辑过]

--  作者:jiterp
--  发布时间:2015/9/1 21:47:00
--  
各位老师,我这个问题是啥情况呀
--  作者:大红袍
--  发布时间:2015/9/2 1:09:00
--  

Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim str As String = txt.text
Dim A As New SQLCommand 
Dim rundm As String
A.CommandText = "selec t runcode fro m sy_from where menuname =\'" & str & "\'"
rundm = A.ExecuteScalar()


\'运行对应的代码内容
If rundm Is Nothing Then 
     Return
End If


--  作者:jiterp
--  发布时间:2015/9/2 12:37:00
--  
rundm  是一段代码内容,我想表达的意思,是当出来的rundm是空的话,就停止,如果不是空的话,就执行这段代码!

Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim str as string = txt.text
Dim A As New SQLCommand  
Dim rundm As String
A.CommandText = "selec t runcode fro m sy_from where menuname =\'" & str & "\'"
rundm = A.ExecuteScalar()

\'运行对应的代码内容
If rundm Is Nothing Then  
     Return
Else
     rundm
End If


--  作者:大红袍
--  发布时间:2015/9/2 12:47:00
--  

动态编译

 

Functions.remove("函数")
Dim Code As String
Code = "msgbox(123)" & vbcrlf
Functions.Add("函数",Code)
Functions.Complie()
Functions.Execute("函数")