Connecting Tech Pros Worldwide Forums | Help | Site Map

Dynamic VB Code Behind

pbb
Guest
 
Posts: n/a
#1: Nov 19 '05
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.

Brock Allen
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Dynamic VB Code Behind


Yeah, you could probabaly rig something up. Christophe has a sample that
does something similar. It might give you some ideas:

http://cfouquet.blogspot.com/

-Brock
DevelopMentor
http://staff.develop.com/ballen


[color=blue]
> 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.
>[/color]



Kevin Spencer
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Dynamic VB Code Behind


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" <pbb@discussions.microsoft.com> wrote in message
news:41169AC4-4874-423F-B910-1113836BF5F7@microsoft.com...[color=blue]
> 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.[/color]


pbb
Guest
 
Posts: n/a
#4: Nov 19 '05

re: Dynamic VB Code Behind


Thanks for the reply. I'll take a look at the post.

"Brock Allen" wrote:
[color=blue]
> Yeah, you could probabaly rig something up. Christophe has a sample that
> does something similar. It might give you some ideas:
>
> http://cfouquet.blogspot.com/
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>[color=green]
> > 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.
> >[/color]
>
>
>
>[/color]
pbb
Guest
 
Posts: n/a
#5: Nov 19 '05

re: Dynamic VB Code Behind


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:
[color=blue]
> 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" <pbb@discussions.microsoft.com> wrote in message
> news:41169AC4-4874-423F-B910-1113836BF5F7@microsoft.com...[color=green]
> > 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.[/color]
>
>
>[/color]
Closed Thread