c#怎么样才能在dataGridView3指定列(已有列)写入内容

string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\家族业务表.xls;Extended Properties=Excel 8.0";

DataSet ds = new DataSet();
OleDbDataAdapter oada = new OleDbDataAdapter("select 工作日期 from [" + dataGridView1.CurrentRow.Cells["Column1"].Value.ToString() + "$]", strConn);
oada.Fill(ds);
dataGridView3.DataSource = ds.Tables[0];
现在是直接在末尾添加新列

可以先在datatable里面加一个空字段或者直接在sql语句里面加一个空列的查询,然后利用datagridview的编辑属性来修改列。
http://blog.csdn.net/lllljz/article/details/7718201 这个是datagridview编辑设置的参考。追问

我是很想这样做啦,但是这样有些功能就没办法实现了

温馨提示:答案为网友推荐,仅供参考
相似回答