最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
excel数据导入到dataset代码
时间:2022-06-25 05:07:40 编辑:袖梨 来源:一聚教程网
excel数据导入到dataset代码
public dataset execleds(string filenameurl, string table)
{
string strconn = "provider=microsoft.jet.oledb.4.0;" + "data source='" + filenameurl + "';extended properties='excel 8.0; hdr=yes; imex=1'";
oledbconnection conn = new oledbconnection(strconn);
conn.open();
dataset ds = new dataset();
oledbdataadapter odda = new oledbdataadapter("select * from [sheet1$]", conn);
odda.fill(ds, table);
return ds;
}
select * from opendatasource('microsoft.jet.oledb.4.0','user id=admin;password=;data source=filenameurl;extended properties=''excel 8.0;imex=1''')...sheet1$
相关文章
- 原神恒常机关阵列荒海怎么进去 04-29
- 永劫无间淘金者怎么达成 04-29
- 全民奇迹怎么转生 04-29
- 重返未来1999收获季怎么玩 重返未来收获季签到活动介绍 04-29
- 无期迷途自由之海联动怎么玩 JOJO联动自由之海活动介绍 04-29
- 明日方舟新六星辅助干员魔王怎么获取 明日方舟新六星辅助干员魔王获取方法 04-29