forum

Home / DeveloperSection / Forums / How to display data results in DatagridView in another Form?

How to display data results in DatagridView in another Form?

Pravesh Singh234120-Oct-2014
I'm having a tough time trying to display my data information in another form which has a DataGridView, if a button is clicked
 
To display the results in the same Form in dgv isn't a problem but to display it in Form 2 in a dgv is giving me a headache (:
 
Example:
Form1
cmd.commandText: SELECT * FROM tblproducts
 
void btnDisplay_Click(object sender, EventArgs e)
 
if (comboBox1.SelectedValue.ToString() != null && comboBox2.SelectedValue.ToString() != null)
 
try 
open connection
new Form2().ShowDialog();
 
?????? what next??
 
Form2
 
dataGridView1.DataSource = get Info from Form1;

Updated on 20-Oct-2014

Can you answer this question?


Answer

1 Answers

Liked By