473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Instantiate object with name stored in variable

I am getting the value of an object to be instantiated from the database so
all I have is the name of it stored in a string variable.

How do I instaintiate the object using the variable?
Jul 21 '05 #1
1 1487
"whornak" <wh*****@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
I am getting the value of an object to be instantiated from the database so
all I have is the name of it stored in a string variable.

How do I instaintiate the object using the variable?


See the System.Activator.CreateInstance() function.

http://msdn.microsoft.com/library/de...tancetopic.asp

-- Alan
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joe Blow via DotNetMonster.com | last post by:
Hello, I have a design problem involving class instances as global variables. To give you my background, I've programmed lots in Java, and most of it has been large class structures. I'm...
5
by: Glenn Serpas | last post by:
I have Class A and Class B .. Class B has a private member that is a pointer to a Class A object. private: B *mypointer ; I instantiate the A object A* myobject new = A();
4
by: Lucas Sain | last post by:
Hi, I think thta for this I have to use reflection... but I'm not shure. How can I find/get an object at runtime by looking for its name that is stored in a variable. For example: I have a...
3
by: XenofeX | last post by:
How can i call to object from string variable ? For instance string x = "textBox1"; i want to call the object which name is stored in the x string variable. The most important thing is the...
7
by: J-T | last post by:
I can instantiate my object in my *ASP.NET* application in two ways: A) public sealed class RSSingleton { private static ReportingServiceProxy m_RsProxy=null; static RSSingleton() {...
13
by: Brian | last post by:
I have many similar classes in a project, one for each type of report my app can create. I want to instantiate them based on a value passed in by a scheduler module. Right now I have Sub...
1
by: whornak | last post by:
I am getting the value of an object to be instantiated from the database so all I have is the name of it stored in a string variable. How do I instaintiate the object using the variable?
5
by: John | last post by:
Hi, is it possible to instantiate a class with a variable. example class foo: def method(self): pass x='foo'
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.