473,503 Members | 10,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I can't get 'Public UserID As String' to work right.

I did have UserID as 'Dim UserID As String'. Ok, when I made it 'Public
UserID As String', in the Public Area of one program and took out all
the 'local' declairations of it, even in the other programs that need to
see the same value of UserID, UserID was getting the 'UserID is not
declaired' message in the other programs. Do I have to put 'Public
UserID As String' in the Public areas of all my programs, and if I do a
UserID = "something" in one program, will it still have that value in
the other programs? Or is there a better way?
Thanks,
Trint

.Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
4 1218
To set up a static member, you will want to have it in a module. This may
not be what you are aiming at. For application, consider setting up a
singleton as you application object. If the values are app wide, you can
also make them static (Shared keyword in VB.NET).

To go across programs, you will have to make a service, set up the value in
some form of persistant storage, or have a means of passing the value across
multiple apps.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Trint Smith" <tr********@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP12.phx.gbl...
I did have UserID as 'Dim UserID As String'. Ok, when I made it 'Public
UserID As String', in the Public Area of one program and took out all
the 'local' declairations of it, even in the other programs that need to
see the same value of UserID, UserID was getting the 'UserID is not
declaired' message in the other programs. Do I have to put 'Public
UserID As String' in the Public areas of all my programs, and if I do a
UserID = "something" in one program, will it still have that value in
the other programs? Or is there a better way?
Thanks,
Trint

Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2
Let me suggest that you post an example. I'm not sure we understand what
you mean by "one program" and "other programs." Post a few lines
demonstrating "this works" and "this doesn't work." But "no" you surely do
not declare what you hope to be a public variable in more than one place.
"Trint Smith" <tr********@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP12.phx.gbl...
I did have UserID as 'Dim UserID As String'. Ok, when I made it 'Public
UserID As String', in the Public Area of one program and took out all
the 'local' declairations of it, even in the other programs that need to
see the same value of UserID, UserID was getting the 'UserID is not
declaired' message in the other programs. Do I have to put 'Public
UserID As String' in the Public areas of all my programs, and if I do a
UserID = "something" in one program, will it still have that value in
the other programs? Or is there a better way?
Thanks,
Trint

Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3
I think you need to declare the variable as 'Public' in a module rather than
in one particular form's declaration area.

--
Paras
Your One Stop Entertainment Guide - http://www.paras.2ya.com/
"Trint Smith" <tr********@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP12.phx.gbl...
I did have UserID as 'Dim UserID As String'. Ok, when I made it 'Public
UserID As String', in the Public Area of one program and took out all
the 'local' declairations of it, even in the other programs that need to
see the same value of UserID, UserID was getting the 'UserID is not
declaired' message in the other programs. Do I have to put 'Public
UserID As String' in the Public areas of all my programs, and if I do a
UserID = "something" in one program, will it still have that value in
the other programs? Or is there a better way?
Thanks,
Trint

Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #4
So where do I put 'Public UserID As String' so that all the little blue
underscores under UserID go away? :)
I literally, WHERE does it go?
Thanks,
Trint
.Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6731
by: jez123456 | last post by:
Hi, I have the following method where I need to display which database is being processed, however, the label lblDatabase dosn't seem to work until the end. private void...
9
2290
by: Marc Miller | last post by:
Hi all, I have 2 dev. machines, the 1st is Win 2000 with .NET 7.0 and the 2nd is XP Pro with .NET 2003. My Web Server is Win 2000 Server with IIS 5.0. I can create a new project on my test...
1
2822
by: Jim Heavey | last post by:
Hello, I am running into something strange. I am getting the following error when the program attempts to execute a particular procedure: An unhandled exception of type...
9
999
by: Trint Smith | last post by:
I've looked for a 'module' and used the class viewer to put it in there, but 'Public UserID As String' is still not a globally visible string. How do I do this please? Thanks, Trint .Net...
1
1349
by: Andrew Morton | last post by:
I've got a stored procedure which works as expected using Run Stored Procedure in VS.NET:- ----------------------------------------------------------- ALTER PROCEDURE dbo.ValidateUser @Username...
1
1186
by: Ron | last post by:
Hello all, I had my code working using a number userid, then I chganged it to string and thought I did everything right, well now this function does not work. Anyone know what I am doing...
0
6590
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
6
3549
by: stoogots2 | last post by:
am using Visual Studio 2003, .Net Framework 1.1, C#. I get a SystemNullReferenceException when trying to do a hashtable.add(string,string) from a login page, and I do not understand why because all...
1
2256
by: chienee | last post by:
here is the code <?php session_cache_limiter('private,must-revalidate'); session_start(); require_once("config.php"); include ("classes/db_functions.php"); include ("classes/display.php");
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.