Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Problems calling business component


Message #1 by "Hugh McLaughlin" <hugh@k...> on Fri, 1 Feb 2002 18:05:30
Hello Everyone and thanks for your help in advance.  I am building a

business component for accessing a database via and ASP.net page.  It is

similar to pages on the IBuySpy example on www.asp.net.  I am running into

problems when I try to call the function.  The code for my component is:



Imports System.Data

Imports System.Data.SqlClient



Namespace MyPortal



	Public Class ManageUsersDB



		Public Function ReadUsers AS DataSet



			Dim myConnection As New SqlConnection

(ConfigurationSettings.AppSettings("connectionString"))



      			Dim myCommand As New SQLDataAdapter

("sp_ReadUsers",myConnection)



			Dim myDataset AS New DataSet



			myCommand.Fill(myDataSet)



			Return myDataset



		End Function



	End Class



	Public Class HelloVB



		Public Function SayHello() As String



			Return "Hello World - I'm a component"



		End Function



	End Class



End Namespace



And the code for my ASPX page that calls the function is:



<%@ Import Namespace="MyPortal" %>



<script runat="server">





	Sub Page_Load()



		Dim myRecordSet As New ManageUsersDB()



		myDatagrid.DataSource=myRecordSet.ReadUsers



		Page.Databind()



	End Sub

		

</script>

<ASP:DataGrid id="MyDataGrid" runat="server" />



I am receiving the following error message:



Compiler Error Message: BC30456: 'ReadUsers' is not a member 

of 'MyPortal.ManageUsersDB'.



You may notice that I also have a "hello world" example which I put in 

strictly for

test purposes.  I am able to successfully call this part of the component.



Any help would be greatly appreciated.  Thanks

  Return to Index