|
Forums » .NET » Windows »
|
How to pass value from one application to another application |
Posted Date: 12 Jul 2012 Posted By:: umesh Member Level: Gold Member Rank: 632 Points: 2
Responses:
7
|
How to pass value from one application to another application
I have an application in which i have a button while clicking on that button another application should be opened and some value from application 1 should be passed to application 2
|
Responses
|
#680038 Author: jogesh Member Level: Gold Member Rank: 229 Date: 12/Jul/2012 Rating:  Points: 0 | Use querystring...
To Write... HttpContext.Current.Request.QueryString["value"] = value;
To read value in another application... string value = HttpContext.Current.Request.QueryString["value"];
| #680040 Author: Anil Kumar Pandey Member Level: Platinum Member Rank: 1 Date: 12/Jul/2012 Rating:  Points: 2 | You can make use of either a common database where the value can be stores and the other application can read it or else you can make use of a common file where both the application can read and write information.
Thanks & Regards Anil Kumar Pandey Microsoft MVP, DNS MVM
| #680077 Author: Ajatshatru Upadhyay Member Level: Gold Member Rank: 20 Date: 12/Jul/2012 Rating:  Points: 2 | Hi,
It is not possible to invoke entire application. If you want to do it, you have to use technology like web services. By using web services, you can call some method (web method) of another application and pass input(s) and can get processed output.
Hope it'll help you. Regards Ajatshatru
| #680096 Author: Paritosh Mohapatra Member Level: Diamond Member Rank: 6 Date: 12/Jul/2012 Rating:  Points: 4 | Use a global class file to get and set the values.
Please check the following code:
Class1.cs ---------
class Class1 { static string FirstName; static string LastName; static string EMail; public static string GetFirstName() { return FirstName; } public static string GetLastName() { return LastName; } public static string GetEmail() { return EMail; }
public static void SetData(string fname, string lname, string em) { FirstName = fname; LastName = lname; EMail = em; } }
In Form1, you can set the values of the TextBoxes using the following code:
private void button1_Click(object sender, EventArgs e) { Class1.SetData(textBox1.Text, textBox2.Text, textBox3.Text); }
private void button2_Click(object sender, EventArgs e) { Form2 f = new Form2(); f.Show(); }
In Form2, you can get the data using the following code:
private void Form2_Load(object sender, EventArgs e) { textBox1.Text = Class1.GetFirstName(); textBox2.Text = Class1.GetLastName(); textBox3.Text = Class1.GetEmail(); }
Thanks & Regards Paritosh Mohapatra Microsoft MVP (ASP.Net/IIS) DotNetSpider MVM
| #680154 Author: Rameshwar Member Level: Silver Member Rank: 622 Date: 12/Jul/2012 Rating:  Points: 2 | Dear Umesh,
The solution for passing value from one application to another is that you will have to use unique data base and use the data for both application. So that your problem is solve.
I think this will help you.
Regards Rameshwar
|
|
| Post Reply |
|
|
|
 | | This thread is locked for new responses. Please post your comments and questions as a separate thread. If required, refer to the URL of this page in your new post. |
|
|
|
|
 Follow us on Twitter: https://twitter.com/dotnetspider
|
|