Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2005

Tip: Looking for answers? Try searching our database.

Get an Object reference from string?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Code Blue - 30 Apr 2005 09:29 GMT
Hi,

In C#, is it possible to obtain an object reference from a string
representation of the object's name?

for example, if I have a TableName = "TblName", and the dataAdapter
associated with that table is called "daTblName", however, I will not know
the TableName till run time.

so at run time, the user will have 20 tablenames to choose from on a page,
and I will pass the chosen table name as a QueryString
(Table.aspx?tablename="TblName"), so I don't have a reference to the data
adapter referring to this particular table, but I know the data adapter's
name.

Is it possible, knowing that the data adapter's object name, to get a
reference to it at run time, perhaps by using Reflection?

Thanks,

CB
Code Blue - 30 Apr 2005 10:30 GMT
Ok, I think that using Remoting or Reflection is overkill here, if not
impossible.  I guess the best way is to use a hashtable to associate the
tables with their data adapters.

however, I am a little surprised that no simple method exists to do this.

CB

> Hi,
>
[quoted text clipped - 17 lines]
>
> CB

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.