Take one form form1,take second form i named as FormDestination ,put a datagridcotrol with id as dataGridDest in second form (FormDestination)
Write the below code in from1 button click
private void button1_Click(object sender, EventArgs e)
{
FormDestination formDest = new FormDestination();
DataTable tableemp = new DataTable();
using (SqlConnection con = new SqlConnection("user id=sa;password=just4fun;database=sdp;data source=SITT244"))
{
using (SqlCommand cmd = new SqlCommand("select * from emp",con))
{
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(tableemp);
}
}
Control[] ctlgrid = formDest.Controls.Find("dataGridDest", true);
DataGridView grid =(DataGridView) ctlgrid[0];
grid.DataSource = tableemp;
formDest.Show();
}
From which table you bind data to datagrid in first form in the same way assign the same table to datagrid in FormDestination