Hii
I have problem.
I have one global variable (string query_type)
now i want the hold some valu inside in one function and the i want that value in anoyher function for checkinf purpose.
How to do this pls help.
Global Variable
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 17, 2013, 5:45 PM EST
I am not getting your que.
Correct me. you want to share some data between to function for that you global variable.
here i also some que.
Are you use window base or web base application?
kindly share more info about you problem.
Pranjal Mishra58 reputationPosted Jan 17, 2013, 6:08 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 17, 2013, 7:46 PM EST
if you want to share data between two function, you have two way
1) use share varible.
public string query_type = string.Empty;
public void SetTypeString()
{
query_type = "now it is set";
}
public void GetTypeString()
{
string ret = query_type;
}
2) pass data as parameter to other function.
public void SetTypeString()
{
string query_type = "now it is set";
}
public void GetTypeString(string mystring)
{
string ret = mystring;
}
hope this will help you.