Execute command saved in variable...

lidds

Well-known member
Joined
Oct 19, 2004
Messages
122
Programming Experience
Beginner
I don't know if this is possible, but what I want to have is a SQL table that contains has one column called "Command" that contains a VB.Net code E.g.

Me.btnHome.Enabled = False
Me.btnSave.Enabled = True

What I then want to do is query the database, and then loop through the datareader and execute each command. I am able to do the SQL call and datareader stuff, however I am not sure how to execute the VB.Net command held in the variable / datareader

Thanks

Simon
 
You need to be VERY careful what you allow in that column. What if the user enters this:
VB.NET:
Me.btnSave = Nothing
Your Save button will stop working. What if the user writes code to delete files? Apart from that, does it really make sense that the user knows, and needs to know, the variable names that you used for your controls when building the app?
 
Back
Top