//int i = dataGridView1.CurrentCell.RowIndex;
//DataRow dr = ds.Tables["DressingWheel"].Rows[i];
//dr["修整輪名稱"] = dataGridView1.CurrentRow.Cells[0].Value.ToString();
////dr["修整輪名稱"] = dataGridView1.Rows [i].Cells[0].Value.ToString();
//dr["修整輪直徑"] = dataGridView1.CurrentRow.Cells[1].Value.ToString();
//dr["修整輪圓角半徑R1"] = dataGridView1.CurrentRow.Cells[2].Value.ToString();
//dr["修整輪圓角半徑R2"] = dataGridView1.CurrentRow.Cells[3].Value.ToString();
//dr["距離L1"] = dataGridView1.CurrentRow.Cells[4].Value.ToString();
//dr["距離L2"] = dataGridView1.CurrentRow.Cells[5].Value.ToString();
//dr["修整輪修整高度H"] = dataGridView1.CurrentRow.Cells[6].Value.ToString();
這是異常處理,ex是異常對象,裡面還有異常信息
http://www.cnblogs.com/lxw0109/archive/2013/04/05/CSharp-Exception.html