Thanks for your reply. It seems like I've thought about needing this
capability at different times in different projects. The one that is on my
mind currently involves creating a control panel dynamically in a report
viewer program. I posted a request for this earlier today under the subject
'Dynamic Master/Detail Controls', but as I started abstracting the
requirements I started to see a more broad application.
In this case when the user selects which report they want to run from a ddl
then controls are created on the web page dynamically for each parameter in
the report (based on records stored in sql).
For example a report may require 2 ddl's for parameters - one for State and
another for City. My code will read from sql that it needs to create a ddl
and populate it with a list of states (also from a table in sql) and then
create another ddl and populate it with a list of cities (also from a table
in sql). The code I'm using to create the parameter controls is pretty
abstract so that it can pretty much create whatever kind of control I need
(i.e. ddl, textbox, calender, etc). The problem I'm running into now is that
I need to be able to populate ddl's based on selections the user makes. In
this example if the user selects a state from the State ddl I want to
repopulate the City ddl with a list of cities in the state selected.
If these were static controls I could just use the SelectedIndexChanged
event for the State ddl to repopulate the City ddl, so I thought if I could
'save' the SelectedIndexChanged event code in sql and send it to an Execute
method then this would meet my need. I'm open to any suggestions!
"Kevin Spencer" wrote:
How about posting your actual requirements? While it is certainly possible,
it is a heck of a lot of trouble, processing, overhead in general, and more
or less breaks the .Net object model. If we can go back to your actual
business requirements, we can probably come up with a much better solution.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"pbb" <pb*@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com... Is it possible to retrieve VB code stored in SQL Server as text and
execute
it in code behind in an ASP.Net app? I guess what I'm looking for is an
object that would have an Execute method that could be called and pass in
text for the VB code to be executed.