sql->excel:读取记录后用for循环写入excel(如果excel是模板,其模板也不会被破坏);
excel->sql:利用oledb(连接字符串:"Provider=Microsoft.Jet.OLEDB.4.0;"
+
"Data
Source="
+
ExcelPath
+
";Extended
Properties=Excel
8.0;",查询语句例如(查询sheet1的内容):select
*
from
[sheet1$])读取excel到dataset里,然后用for循环insert到数据库中即可。