I want to pass some values to different forms at there button click event. plz guide me.I am using c sharp.net 2005,win forms. I want to access the value in a sql query in form
Try this code, you have to do something like following code : inside this event you have to pass data to other
private void button1_Click(object sender, EventArgs e)
{
Form2 secondForm = new Form2();
secondForm.YourProperty = "This is your data";
secondForm.Show();
}
In the other form you have to declare a property :
public string YourProperty { get; set; }
hope this help.