Re: Dynamically calling classes and properties
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Thu, 22 Mar 2007 01:59:37 +0100
What is it that you are using this for?
I suspect that, as in most cases when someone asks for dynamic variables, it can be solved in a different way.
wisaunders@xxxxxxxxx wrote:
I have several different classes that contain the same four
properties. I tell my application property of which class to call in
the configuration file.
Here are the values from my config file
<class>AAAA</class>
<property>1111</property>
This is how I current have it working.
Dim sql As String = ""
Select Case classVariable
Case "AAAA"
Dim extract As New AAAA
Select Case propertyVariable
Case "1111"
sql = extract.1111
Case "2222"
sql = extract.2222
Case "3333"
sql = extract.3333
Case "4444"
sql = extract.4444
Case Else
'quit function
End Select
Case "BBBB"
Dim extract As New BBBB
Select Case propertyVariable
Case "1111"
sql = extract.1111
Case "2222"
sql = extract.2222
Case "3333"
sql = extract.3333
Case "4444"
sql = extract.4444
Case Else
'quit function
End Select
Case "CCCC"
Dim extract As New CCCC
Select Case propertyVariable
Case "1111"
sql = extract.1111
Case "2222"
sql = extract.2222
Case "3333"
sql = extract.3333
Case "4444"
sql = extract.4444
Case Else
'quit function
End Select
End Select
Is there a was to call these classes and properties dynamically with
variable from my config file.
Something that looks like this? I don't want to have to add another
case and select case for every new class.
Dim extract as new [classVariable]
Sql = extract.[propertyVariable]
Thanks in advance,
Will
--
Göran Andersson
_____
http://www.guffa.com
.
- References:
- Dynamically calling classes and properties
- From: wisaunders
- Dynamically calling classes and properties
- Prev by Date: Re: Trouble of GDI+ generic error!
- Next by Date: Collection: Find value by key, or key by value?
- Previous by thread: Re: Dynamically calling classes and properties
- Next by thread: How to change database when deploying application
- Index(es):
Relevant Pages
|