VB.Net Global Variable

Posted on 2006-04-17
Last Modified: 2010-04-17
I have create a module namely globalvariable and want to create a global variable namely SQL type string when i am doing this it is showing errro on Global:

global SQL as string

I also want to use this variable on my form like this

SQL = "select * from userstable where username ='" & TextBox1.Text & "'"

in above statement it is showing error on SQL

Please guide how to create global variable and how could we call it on any form.

Rgds. Mehram
Question by:Mehram
    LVL 16

    Expert Comment

    Hi again,

    What is the error message?

    LVL 16

    Accepted Solution

    In your module,

    Try to use
    Public SQL as string

    instead of
    global SQL as string

    LVL 16

    Expert Comment

    Glad I could help again ;).


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    794 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now