The problem apperas when i call WriteString() function
Thanks
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient
'---------- // CLASS : StringComponents
Public Class StringComponents
Inherits Page
'---------- // SUB : WriteString
Public Sub WriteString(SayItNow as String)
Response.Write(SayItNow)
End Sub
End Class
'---------- // CLASS : DataComponents
Public Class DataComponents
Inherits Page
'---------- // FUNCTION : OpenOleDbConnection
Public Function OpenOleDbConnection(ByVal MyConnection As
OleDbConnection, ByVal connString As String) As Boolean
Dim bReturn As Boolean
Try
If MyConnection.State <> ConnectionState.Open Then
With MyConnection
.ConnectionString = connString
.Open()
bReturn = True
End With
Else
WriteString("ERROR: Trying to open connection " &
MyConnection.Database.ToString & ". Connection is already open.")
bReturn = False
End If
Catch ex As Exception
WriteString(ex.Message & ex.StackTrace)
bReturn = False
Finally
OpenOleDbConnection = bReturn
End Try
End Function
'---------- // FUNCTION : CloseOleDbConnection
Public Function CloseOleDbConnection(ByVal MyConnection As
OleDbConnection) As Boolean
Dim bReturn As Boolean
Try
If MyConnection.State <> ConnectionState.Closed Then
With MyConnection
.Close()
.Dispose()
bReturn = True
End With
Else
WriteString("ERROR: Closing connection. Connection already
closed.")
bReturn = False
End If
Catch ex As Exception
WriteString(ex.Message & ex.StackTrace)
bReturn = False
Finally
CloseOleDbConnection = bReturn
End Try
End Function
End Class
"Bryant Hankins" <bryanthankins@_NO_SPAM_hotmail.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
This is most likely a scope issue:
Is class1 in a namespace? If so ensure you fully qualify class1 with the
namespace like: mynamespace.class1
Are class 1 and class 2 in different assemblies? If so, make sure one is
referencing the other.
Is the method static? if not, make sure you have created an instance of
the object.
Does class 1 compile? If not, you won't be able to "see" it's method.
If none of these help can you post some sample code?
--
Bryant Hankins
Numinet Systems Inc.
http://www.numinet.com
"Pepehammer" <pe********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... Hi guys!
I got two classes, class1 and class2.
I'm trying to call a function defined in class1 from class2, but I get
the following error:
BC30451: Name 'WriteString' is not declared
How I can solve this issue?
Thanks a lot!