DataTable table = new DataTable();
table.TableName = "SelectedMinOcc";
table.Columns.Add("ID", typeof(Int32));
table.Columns.Add("Name", typeof(string));
table.Columns.Add("LAT", typeof(double));
table.Columns.Add("LONG", typeof(double));
foreach (DataGridViewRow row in dgvSearchResults.SelectedRows)
{
table.Rows.Add(Convert.ToInt32(row.Cells["ID"].Value)
, Convert.ToString(row.Cells["Name"].Value)
, Convert.ToDouble(row.Cells["LAT"].Value)
, Convert.ToDouble(row.Cells["LONG"].Value)
);
}
table.TableName = "SelectedMinOcc";
table.Columns.Add("ID", typeof(Int32));
table.Columns.Add("Name", typeof(string));
table.Columns.Add("LAT", typeof(double));
table.Columns.Add("LONG", typeof(double));
foreach (DataGridViewRow row in dgvSearchResults.SelectedRows)
{
table.Rows.Add(Convert.ToInt32(row.Cells["ID"].Value)
, Convert.ToString(row.Cells["Name"].Value)
, Convert.ToDouble(row.Cells["LAT"].Value)
, Convert.ToDouble(row.Cells["LONG"].Value)
);
}
No comments:
Post a Comment