Solved

name of class

Posted on 2012-03-30
4
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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