Solved

name of class

Posted on 2012-03-30
4
344 Views
Last Modified: 2012-03-30
Suppose I have a class called :  

Partial Public Class ShowTds_admin_agencyTable
end class


Is there a way to programmatically, at runtime, obtain the name of the class?
0
Comment
Question by:HLRosenberger
  • 2
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37788789
Obtain it from what? An instance of the class? If so, you would use Reflection.

e.g.

Dim x As New ShowTds_admin_agencyTable
Dim className As String = x.GetType().Name

Open in new window

0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37788852
Yes!  That's what I want.   Now, what about the name of the parent class, if the class is inherited?
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 37788956
Dim parentName As String = x.GetType().BaseType.Name

Open in new window

0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 37788972
Thanks so much!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now