473,387 Members | 1,721 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,387 software developers and data experts.

Object from variable

Hi,

I am sorry if it has been discuss before I searched and could not find.

I want to create object from variable. I have name of Crystal Report in
Table and I want to create object from variable
any idea or clue

Thanks

Sohail
May 24 '06 #1
4 881
Hi,

Strange question in my eyes, however

Dim a as new object
a = "Whatever you want and whatever value you want"

I don't know if this is what you were after,

Cor

"news.microsoft.com" <sh****@peo.on.ca> schreef in bericht
news:OG**************@TK2MSFTNGP02.phx.gbl...
Hi,

I am sorry if it has been discuss before I searched and could not find.

I want to create object from variable. I have name of Crystal Report in
Table and I want to create object from variable
any idea or clue

Thanks

Sohail

May 24 '06 #2
Thanks for your reply, I think i was not clear in my problem.

normally it is
dim rpt as rptBudget = new rptBudget

rpt Budget is a Crystal Report

I want to do somehting like this
xyz = "rptBudget"
how can i create object of xyz

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:#J**************@TK2MSFTNGP03.phx.gbl...
Hi,

Strange question in my eyes, however

Dim a as new object
a = "Whatever you want and whatever value you want"

I don't know if this is what you were after,

Cor

"news.microsoft.com" <sh****@peo.on.ca> schreef in bericht
news:OG**************@TK2MSFTNGP02.phx.gbl...
Hi,

I am sorry if it has been discuss before I searched and could not find.

I want to create object from variable. I have name of Crystal Report in
Table and I want to create object from variable
any idea or clue

Thanks

Sohail


May 24 '06 #3

Use Activator.CreateInstance. For example:

theObject =
Activator.CreateInstance(Type.GetTypeFromProgID("M yNamespace.MyType"))


"news.microsoft.com" <sh****@peo.on.ca> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Thanks for your reply, I think i was not clear in my problem.

normally it is
dim rpt as rptBudget = new rptBudget

rpt Budget is a Crystal Report

I want to do somehting like this
xyz = "rptBudget"
how can i create object of xyz

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:#J**************@TK2MSFTNGP03.phx.gbl...
Hi,

Strange question in my eyes, however

Dim a as new object
a = "Whatever you want and whatever value you want"

I don't know if this is what you were after,

Cor

"news.microsoft.com" <sh****@peo.on.ca> schreef in bericht
news:OG**************@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I am sorry if it has been discuss before I searched and could not find.
>
> I want to create object from variable. I have name of Crystal Report in
> Table and I want to create object from variable
> any idea or clue
>
> Thanks
>
> Sohail
>
>



May 24 '06 #4
Thanks for all of you

I found very good example here

http://www.geocities.com/Jeff_Louie/OOP/oop20.htm

Sohail

"Robin Mark Tucker" <ro*************@removehotmail.comremove> wrote in
message news:e5*******************@news.demon.co.uk...

Use Activator.CreateInstance. For example:

theObject =
Activator.CreateInstance(Type.GetTypeFromProgID("M yNamespace.MyType"))


"news.microsoft.com" <sh****@peo.on.ca> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Thanks for your reply, I think i was not clear in my problem.

normally it is
dim rpt as rptBudget = new rptBudget

rpt Budget is a Crystal Report

I want to do somehting like this
xyz = "rptBudget"
how can i create object of xyz

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:#J**************@TK2MSFTNGP03.phx.gbl...
Hi,

Strange question in my eyes, however

Dim a as new object
a = "Whatever you want and whatever value you want"

I don't know if this is what you were after,

Cor

"news.microsoft.com" <sh****@peo.on.ca> schreef in bericht
news:OG**************@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I am sorry if it has been discuss before I searched and could not find. >
> I want to create object from variable. I have name of Crystal Report in > Table and I want to create object from variable
> any idea or clue
>
> Thanks
>
> Sohail
>
>



May 24 '06 #5

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

Similar topics

28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
4
by: Mark D. Anderson | last post by:
About a month ago Richard Cornford did an interesting analysis of a memory leak in jscript (internet explorer) when there are "circular" references between DOM objects and (real) jscript objects:...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
7
by: Arpan | last post by:
The .NET Framework 2.0 documentation states that An Object variable always holds a pointer to the data, never the data itself. Now w.r.t. the following ASP.NET code snippet, can someone please...
6
by: Shailen Sukul | last post by:
Observed a weird behaviour with object references. See code listing below: using System; using System.Collections.Generic; using System.Text; namespace PointerExceptionTest { /*
14
by: Philipp Reif | last post by:
Hi all, I've got a little hole in my head concerning references. Here's what I'm trying to do: I'm calling a function, passing the reference of a business object for editing. The function clones...
4
by: alex | last post by:
I am so confused with these three concept,who can explained it?thanks so much? e.g. var f= new Function("x", "y", "return x * y"); function f(x,y){ return x*y } var f=function(x,y){
0
by: zman77 | last post by:
EDIT: -- forgot to mention... I am using Visual Studio 2005, on Win XP, on an intel machine Hi. This is my first post, though I've "lurked" for a while because I find these forums very helpful....
23
by: Hugh Oxford | last post by:
How do I get an object's name? EG. $obj_FOO = new Bar; echo $obj_FOO->getName(); 'obj_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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.