MessageBox.Show("操作失败!" + ex.ToString());
}
DataSet ds = new DataSet();
try
{
da.Fill(ds);
this.dataGridView1.DataSource = ds.Tables[0];
// for (int v = 0; v < dataGridView1.Rows.Count; v++) {
string c1 = dataGridView1.Rows.Count.ToString();//获取行数
int c2 = int.Parse(c1);
c2 = c2 - 1;
c1 = c2.ToString();
string a11 = dataGridView1.Rows[0].Cells[1].Value.ToString();//获取 第一行第二列数值 ————Rows行
// ------cells列
MessageBox.Show(a11, c1, MessageBoxButtons.OK, MessageBoxIcon.Information);
int zy = 1;
for (int v = 0; v < c2 ; v++)
{
for (int v1 = 1; v1 <= 17; v1++)
{
string zx;
zx = zy.ToString();
a[v1] = dataGridView1.Rows[v].Cells[v1].Value.ToString();