更新时间:2023-02-03 23:20:26
我会将excel文件加载到DataTable
对象中,然后从 DataTable 对象进入数据库。
这篇CP文章包含一个将Excel导入DataTable的类
(并且可以很好地确定正确的列数据类型)。
SQLXAgent - SQL Express的工作 - 第3部分,共6部分 [ ^ ]
在使用代码之前,请务必*阅读文章*。它会有很大的帮助。
I would load the excel file into aDataTable
object, and then add the records from theDataTable
object into the database.
This CP article includes a class that imports Excel into aDataTable
(and does a pretty good job of determining the correct column data types on the fly).
SQLXAgent - Jobs for SQL Express - Part 3 of 6[^]
Be sure to *read the article* before using the code. It will help immensely.