Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
private void ministatement_Load(object sender, EventArgs e)
        {
             connect.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from transactions where user_name='" + label2.Text + "'", connect);
            DataSet ds = new DataSet();
            da.Fill(ds, "transactions");
            BindingSource bs = new BindingSource();
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "transactions".ToString();
}
}
}

and the label value comes from another form
private void button1_Click(object sender, EventArgs e)
        {
            ministatement mns = new ministatement();
            mns.Show();
            mns.label2.Text = label5.Text;
}
Posted

1 solution

hello abhinav is yur problem not yet solved and r u getting label4 value from same form or diff form
 
Share this answer
 
v2
Comments
Abhinav Chaudhary 15-Mar-14 5:56am    
no sir,it is solved now...i just wrote the whole code into the button event...and it is solved...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900