TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manoj Patel
NA
26
14.9k
VB.net WPF :Unable to cast object of type 'Ocean.GeneralMast
Apr 24 2013 7:01 AM
Dear Experts,
I'm using wpf with vb.net. When i tried below code then i'm getting an error
Error--------------
Unable to cast object of type 'Ocean.GeneralMaster' to type 'System.Windows.Forms.Form'.
------------------
Dim objForm As Form
Dim sValue As String
Dim FullTypeName As String
Dim FormInstanceType As Type
' Form class name
sValue = "GeneralMaster"
' Assume that form classes' namespace is the same as ProductName
FullTypeName = "Ocean" & "." & sValue
' Now, get the actual type
FormInstanceType = Type.GetType(FullTypeName, True, True)
' Create an instance of this form type
objForm = CType(Activator.CreateInstance(FormInstanceType), Form)
' Show the form instance
objForm.Show()
Reply
Answers (
0
)
How To Impliment Security in WCF?
WCF WSDL vs ASMX WSDL