Re: Dynamic VB Code Behind

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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" <pbb@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:41169AC4-4874-423F-B910-1113836BF5F7@xxxxxxxxxxxxxxxx
> > 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.
>
>
>
.



Relevant Pages

  • Re: Adding a field
    ... maintain, slower to develop, and slower to execute, for no benefit. ... there is no way to set the default behavior for DDL queries. ... I don't believe that works under DAO, so it probably won't work if you ... Is there anyway to get them to default to true using SQL? ...
    (microsoft.public.access.queries)
  • Re: Dynamic table comparision issue
    ... Are you comparing the tables DDL or their contents? ... No need for dynamic SQL here as table names are arguments to ... concatenate arguments into a dynamic SQL statement like you do instead ... concatenate it into your statement and execute that statement ...
    (comp.databases.oracle.server)
  • Re: Executing multiple DDL statements using C#
    ... GO is not DDL, it is SQL Query Analyzer specific. ... execute each segment array element. ... > I'm having trouble executing multiple DDL statements in one SQL file. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Strange problem with max()?
    ... Below you can see select sql ... When I execute the entire statement, ... or whatever you need to do to make it a scalar correlated subquery. ... Without DDL, it is hard to say more. ...
    (comp.databases.sybase)
  • Re: Question about Class Helpers
    ... This was "inspired" by my previous life as a Gupta SQL Windows developer ... The "containers" could be variables or GUI controls!! ... really viable to support only a specific set of classes, ... I implemented a set of binder classes (a binder class being truly ...
    (borland.public.delphi.non-technical)