DataTable dt = new DataTable();
for (int i = 0; i < this.dgv_制造指令.ColumnCount; i++)
{
dt.Columns.Add(this.dgv_制造指令.Columns[i].Name);
}
for (int j = 0; j < this.dgv_制造指令.RowCount; j++)
{
DataRow dr = dt.NewRow();
for (int k = 0; k < this.dgv_制造指令.ColumnCount; k++)
{
dr[this.dgv_制造指令.Columns[k].Name] = this.dgv_制造指令.Rows[j].Cells[k].Value.ToString();
}
dt.Rows.Add(dr);
}