SqlDataAdapter da = new SqlDataAdapter("select * from zg_table",con);
con.Open();
SqlCommandBuilder sb = new SqlCommandBuilder();
DataSet ds = new DataSet();
da.Fill(ds, "zg");
dataGridView1.DataSource = ds.Tables[0].DefaultView;
Column1.DataPropertyName = ds.Tables[0].Columns[0].ColumnName;
Column2.DataPropertyName = ds.Tables[0].Columns[1].ColumnName;
Column3.DataPropertyName = ds.Tables[0].Columns[2].ColumnName;
Column4.DataPropertyName = ds.Tables[0].Columns[3].ColumnName;
Column5.DataPropertyName = ds.Tables[0].Columns[4].ColumnName;
Column6.DataPropertyName = ds.Tables[0].Columns[5].ColumnName;
Column7.DataPropertyName = ds.Tables[0].Columns[6].ColumnName;
Column8.DataPropertyName = ds.Tables[0].Columns[7].ColumnName;
Column9.DataPropertyName = ds.Tables[0].Columns[8].ColumnName;
Column10.DataPropertyName = ds.Tables[0].Columns[9].ColumnName;
Column1.DataPropertyName = dataGridView1.Columns[0].DataPropertyName;
con.Close();
上面这段代码执行以后。Datagridview 中会出现两份记录,怎么去掉默认的那一份