473,378 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

delcaring variables to share in different methods

Hi I have a c# windows application vs2005 with a main section and two public
static methods.
Anyhow I am using the same variable in the main section as well as the
methods but in each case I had to create a new variable. Is there a way to
have the variable declared and set in Main and usable in the methods without
passing them into the methods? The methods would only need to read the
variable.
Thanks.
--
Paul G
Software engineer.
Aug 12 '08 #1
0 1150

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

Similar topics

5
by: Larry Woods | last post by:
I am losing Session variables, but only those that are set in the page previous to a redirect to a secure page. Anyone seen ANY situation where Session variables just "disappear?" Note that...
4
by: Rahul Chatterjee | last post by:
Hello All I have 2 websites both using different style sheets (.css). The stylesheets are stored in a session variable and get set at the time the site gets invoked. What is happening is...
5
by: Wysiwyg | last post by:
I'm new to c# programming and can't figure out how to avoid duplicating common code in multiple classes when I'm restricted to using different system base classes.. I'm using c# in asp.net to write...
4
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in...
6
by: tfsmag | last post by:
here is some test code i've set up trying to figure out how to share variables between two different methods. __________________________________________________ Public Class test Inherits...
7
by: Victor | last post by:
I've got two domain names sharing the same IP address that use ASP VBScript If I set a session variable with domain 1, it is only available for domain 1 - this is correct? If I set an...
6
by: Victor | last post by:
I've got a website that displays the same whether it is accessed using www. or not. ex: http://www.mysite.com and http://mysite.com give me exactly the same website (both represent the top...
3
by: Oops-c++ | last post by:
All, I came to know that, we can define #pragma variables to share values between the processes. #pragma data_seg(".shared") var1 variable2 #pragma data_seg()
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a c# windows application vs2005 with a main section and two public static methods. Anyhow I am using the same variable in the main section as well as the methods but in each case I had...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.