473,748 Members | 8,530 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********@hotm ail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
4 1233
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********@hot mail.com> wrote in message
news:OT******** *****@TK2MSFTNG P12.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********@hotm ail.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********@hot mail.com> wrote in message
news:OT******** *****@TK2MSFTNG P12.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********@hotm ail.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********@hot mail.com> wrote in message
news:OT******** *****@TK2MSFTNG P12.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********@hotm ail.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********@hotm ail.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
6751
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 AddPathAndCallCompactDB(string dbFolder, string systemDB, string UserID, string Pwd, string dbFileName) { FileInfo dbFileInfo = new FileInfo(dbFolder + dbFileName); this.lblDatabase.Text = dbFileInfo.Name; if (dbFileInfo.Exists)
9
2304
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 server from the 1st machine, but I receive an 'HTTP/1.1 500 Internal Server error" from my Web Server. My userid/password are the same on all 3 machines.
1
2833
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 'System.MissingMemberException' occurred in microsoft.visualbasic.dll Additional information: Public member 'FindSearchValueRecord' on type 'ProfileRecordProcessing' not found. This seems to suggest that the function "FindSearchValueRecord" does not
9
1017
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 programmer trintsmith@hotmail.com *** Sent via Developersdex http://www.developersdex.com ***
1
1356
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 nVarChar(50), @Password nVarChar(24), @Valid nvarchar(36) OUTPUT as Select @Valid=cast(UserID as nvarchar(36)) From userdata Where Username=@Username
1
1194
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 wrong? And how can I fix it? So I am having a problem with struserid and my array looks like this: one element Accts(1).strUserID = "FredTran"
0
6614
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 object and transport it over the Internet using HTTP between a client and a server. On the other end, deserialization reconstructs the object from the stream. XML serialization serializes only the public fields and property values of an object...
6
3576
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 of the other data items from the Global.asax.cs are accessible in my pages. The key and value are not null (according to the watch window), so it is something else. This is likely something retarded, so I apologize in advance. It is my first...
1
2276
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
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3309
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 we have to send another system
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.