473,509 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

memory variable

public bool Logon()

{

if (db!=null)

{

Login lg = new Login (db);

lg.ShowDialog ();

UserName = lg.UserName ;

DomainName = lg.DomainName ;

return true;

}

else

return false;

}

I'm using this code to get UserName and DomainName from a dialog.

It is a dll file.

But, when I call another function in that same dll UserName and DomainName
variables are empty!

How can I save there values so that I can use it in another functions?

Hrcko


Nov 17 '05 #1
3 1625
Where (in the same class as Logon() ??? ) is username and domain name
declared?
Do you re-initialize these fields accidentially right after the Login Call?

Some more wrapping code of Login() is needed to provide you help.

Greets, Sebastian Dau

"Hrvoje Voda" <hr*********@luatech.com> wrote in message
news:d7**********@ss405.t-com.hr...
public bool Logon()

{

if (db!=null)

{

Login lg = new Login (db);

lg.ShowDialog ();

UserName = lg.UserName ;

DomainName = lg.DomainName ;

return true;

}

else

return false;

}

I'm using this code to get UserName and DomainName from a dialog.

It is a dll file.

But, when I call another function in that same dll UserName and DomainName
variables are empty!

How can I save there values so that I can use it in another functions?

Hrcko


Nov 17 '05 #2
Here is a code.

public class ULogon

{

string sConnString="";

string UserName;

string DomainName;

Db db ;

ArrayList arrayList = new ArrayList();

public ULogon()

{
}

public void SetConnectionString(string sConnString)

{

db = new Db (sConnString);

}

public bool Logon()

{

if (db!=null)

{

Login lg = new Login (db);

lg.ShowDialog ();

UserName = lg.UserName ;

DomainName = lg.DomainName ;

return true;

}

else

return false;

}

}


"Sebastian Dau" <se***********@gmx.de> wrote in message
news:42*********************@read-nat.news.de.uu.net...
Where (in the same class as Logon() ??? ) is username and domain name
declared?
Do you re-initialize these fields accidentially right after the Login
Call?

Some more wrapping code of Login() is needed to provide you help.

Greets, Sebastian Dau

"Hrvoje Voda" <hr*********@luatech.com> wrote in message
news:d7**********@ss405.t-com.hr...
public bool Logon()

{

if (db!=null)

{

Login lg = new Login (db);

lg.ShowDialog ();

UserName = lg.UserName ;

DomainName = lg.DomainName ;

return true;

}

else

return false;

}

I'm using this code to get UserName and DomainName from a dialog.

It is a dll file.

But, when I call another function in that same dll UserName and
DomainName variables are empty!

How can I save there values so that I can use it in another functions?

Hrcko



Nov 17 '05 #3
Hrvoje,

Are you using new instances of the class each time? If so, then you
will have to store those values outside of the class, or in static
variables.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Hrvoje Voda" <hr*********@luatech.com> wrote in message
news:d7**********@ss405.t-com.hr...
Here is a code.

public class ULogon

{

string sConnString="";

string UserName;

string DomainName;

Db db ;

ArrayList arrayList = new ArrayList();

public ULogon()

{
}

public void SetConnectionString(string sConnString)

{

db = new Db (sConnString);

}

public bool Logon()

{

if (db!=null)

{

Login lg = new Login (db);

lg.ShowDialog ();

UserName = lg.UserName ;

DomainName = lg.DomainName ;

return true;

}

else

return false;

}

}


"Sebastian Dau" <se***********@gmx.de> wrote in message
news:42*********************@read-nat.news.de.uu.net...
Where (in the same class as Logon() ??? ) is username and domain name
declared?
Do you re-initialize these fields accidentially right after the Login
Call?

Some more wrapping code of Login() is needed to provide you help.

Greets, Sebastian Dau

"Hrvoje Voda" <hr*********@luatech.com> wrote in message
news:d7**********@ss405.t-com.hr...
public bool Logon()

{

if (db!=null)

{

Login lg = new Login (db);

lg.ShowDialog ();

UserName = lg.UserName ;

DomainName = lg.DomainName ;

return true;

}

else

return false;

}

I'm using this code to get UserName and DomainName from a dialog.

It is a dll file.

But, when I call another function in that same dll UserName and
DomainName variables are empty!

How can I save there values so that I can use it in another functions?

Hrcko




Nov 17 '05 #4

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

Similar topics

37
4599
by: Curt | last post by:
If this is the complete program (ie, the address of the const is never taken, only its value used) is it likely the compiler will allocate ram for constantA or constantB? Or simply substitute the...
32
3791
by: John | last post by:
Hi all: When I run my code, I find that the memory that the code uses keeps increasing. I have a PC with 2G RAM running Debian linux. The code consumes 1.5G memory by the time it finishes...
5
1763
by: August1 | last post by:
This is a short program that I have written from a text that demonstrates a class object variable created on the stack memory and another class object variable created on the heap memory. By way...
11
2824
by: William Buch | last post by:
I have a strange problem. The code isn't written by me, but uses the qsort function in stdlib. ALWAYS, the fourth time through, the memory location of variable list (i.e. mem location = 41813698)...
18
1336
by: CJ Taylor | last post by:
If I wanted to find out exactly how much memory a particular variable was using, how would I go about that. Or where to look for information would be appreciated. Just need a class/namespace ...
3
1103
by: Niels Jensen | last post by:
In an effort to try curbing the amount of memory my application is using I would like to ask a simple question... I have multiple forms with multiple subs in them. does a Dim statement clear...
62
17623
by: ivan.leben | last post by:
How can I really delete a preloaded image from memory/disk cache? Let's say I preload an image by creating an Image object and setting its src attribute to desired URL: var img = new Image();...
6
380
by: pauldepstein | last post by:
Could anyone explain (by giving a URL possibly) how to solve problems of the form "How much memory does the following piece of code take?" For example, consider the declaration/definition ...
18
2609
by: MajorSetback | last post by:
I am using the Redhat version of Linux and GNU C++. It is not clear to me whether this is a Linux issue or a C++ issue. I do not have this problem running the same program on Windows but...
4
1803
by: Bryan Parkoff | last post by:
We discussed about the union keyword on the previous threads 2-3 days earlier. I want to add. Two byte data inside struct and one word data are inside union. You modify word data. Then two byte...
0
7233
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
7135
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...
0
7342
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,...
1
7067
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...
0
7505
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...
1
5060
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
4729
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
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
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 ...

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.