How to create a new data table from two or more datagridview values c#
I have windows form which has multiple datagridviews has no Database, my purpose is to create reports with user entered values. Please suggest me how to make a datatable with more than one datagridview values
DataTable dt1 = new DataTable();
dt1.Columns.Add("Gour", typeof(string));
dt1.Columns.Add("Seal", typeof(string));
dt1.Columns.Add("Melting", typeof(string));
foreach (DataGridViewRow dgr in dataGridView1.Rows)
{
if (dgr.Cells[0].Value != null)
dt1.Rows.Add(dgr.Cells[0].Value, dgr.Cells[1].Value, dgr.Cells[2].Value);
}
I have to add columns to this same datatable dt1 with values from dataGridview2