Is there an equivalent vb.net eval function for vbscript eval
I want to execute the code that is passed as a string to my function, the code wil开发者_高级运维l be passed at runtime. This is an example code that may be passed as a string to my function.
p is a dataset, which is declared and has some values, this code is executed in a asp.net page
p.Tables(0).Rows(0)("disp_status") = "Approved by CEO";
p.Tables(0).Rows(0)("status") = "Approved";
Session("fnc") = "generate po";
Session("rec_id") = p.Tables(0).Rows(0)("IndexID");
Session("ord_ref")="PR No.";
Server.Execute("../rlm/mne_pr_form_f.asp");
p.Tables(0).Rows(0)("status") = "Order Raised"
p.Tables(0).Rows(0)("disp_status") = "Order Raised"
p.Tables(0).Rows(0)("lock_record") = "Yes";
Session("fnc") = "";
Session("rec_id") = "";
There's no Eval
function as such, but depending on exactly what you want to do, you can do things like this using Reflection and here is a CodeProject article that includes a library to let you do this: Runtime Compilation (A .NET eval statement)
精彩评论