-
Public member 'Show' on type 'fclsDataForm' not found
I used the data form wizard to create a new form called fclsDataForm.asxp
I created a dataset throught the wizard
Then I created a button on the form called btnShowDataForm
I doubleclicked the button and added the folowing code
DIM objDataForm = New fclsDataForm
objDataForm.Show()
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Here is the complete code:
Public Class WebForm
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents btnShowDataForm As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowDataForm.Click
End Sub
Private Sub btnShowDataForm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowDataForm.Click
Dim objDataForm = New WebForm
objDataForm.Show()
End Sub
End Class
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
I received the following error:
Server Error in '/VBNetUnleashed/WebApplication2' Application.
--------------------------------------------------------------------------------
Public member 'Show' on type 'fclsDataForm' not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMemberException: Public member 'Show' on type 'fclsDataForm' not found.
Source Error:
Line 29: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowDataForm.Click
Line 30: Dim objDataForm = New fclsDataForm
Line 31: objDataForm.Show()
Line 32: End Sub
Line 33: End Class
Source File: c:\inetpub\wwwroot\VBNetUnleashed\WebApplication2\WebForm1.aspx.vb Line: 31
Stack Trace:
[MissingMemberException: Public member 'Show' on type 'fclsDataForm' not found.]
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
WebApplication2.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\VBNetUnleashed\WebApplication2\WebForm1.aspx.vb:31
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(St ring eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
-
I think your line of code:
Code:
DIM objDataForm = New fclsDataForm
should be
Dim objDataForm As New fclsDataForm()
You only use the = to instantiate objects in C#, not VB.
Hope this helps.
Similar Threads
-
By Michael C in forum VB Classic
Replies: 3
Last Post: 07-30-2002, 02:15 AM
-
Replies: 6
Last Post: 04-10-2002, 05:22 AM
-
By Jan Vettenburg in forum Java
Replies: 1
Last Post: 11-30-2001, 11:57 AM
-
By Kunal Sharma in forum VB Classic
Replies: 2
Last Post: 04-25-2000, 03:45 PM
-
By Chris Ferraro in forum VB Classic
Replies: 8
Last Post: 04-05-2000, 05:31 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|