Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP .NET - Do not recognize share function created in public class global

Posted on 2004-04-22
3
Medium Priority
?
313 Views
Last Modified: 2010-04-07
Dear experts,

I created a public shared function (called GetTableData) inside the public class Global ( Global.aspx), syntax is like this
-------------------------------------------------------------------------------------------------------------
Imports System.Web
Imports System.Web.SessionState
Imports System.Data
Imports System.Data.OracleClient

Public Class Global
    Inherits System.Web.HttpApplication

    Public Shared Function GetTableData(ByVal strSQL As String) As DataTable
        Dim MyConnection As OracleConnection
        Dim sqlOverview As String
        Dim daOverview As OracleDataAdapter
        Dim dsOverview As DataSet
        MyConnection = New OracleConnection(HttpContext.Current.Application("Connection String"))
        MyConnection.Open()
        sqlOverview = strSQL
        'Create data adapter using sql and connection
        daOverview = New OracleDataAdapter(sqlOverview, MyConnection)
        dsOverview = New DataSet
        daOverview.Fill(dsOverview, "EMP_Table")
        Return dsOverview.Tables("EMP_Table")
        MyConnection.Close()
    End Function
    .
    .
    .
End Class

----------------------------------------------------------------------------------------------------------------------

However when I reference the function in another aspx page, it says the function is not declared.

Am I missing something?

Any help is appreciated.

etalexit
0
Comment
Question by:etalexit
[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
3 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 2000 total points
ID: 10893993
etalexit,
I've copy paste your code
and create a file WebForm1.aspx
in the codebehind i wrote
Global and when press "." symbol the GetTableData was shown in the list
you have to use Global.GetTableData not only GetTableData

B..M
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10895797
0
 
LVL 20

Expert Comment

by:ihenry
ID: 10895843
This thread have the similar case,

calling a global function from .aspx page
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20956406.html
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

705 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