用SQL Server 2000 的DTS呗 C#中可以直接用SQL语句,都是微软的,还是很方便的连SQL Server,执行SELECT * into table FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="***.xls";User ID=Admin;Password=;Extended properties=Excel 8.0')...[table$]SELECT * into table FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="***.xls";User ID=Admin;Password=;Extended properties=text')...[#table]表名是不是这么写的不太清楚了,楼主可以试试。你也可以连本地数据库,这么上传 SELECT * into aaa IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] from aaa
我运行了 下面的语句SELECT * into table FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="***.xls";User ID=Admin;Password=;Extended properties=Excel 8.0')...[table$] 但出现了一下错误OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。验证失败。 [OLE/DB provider returned message: 无法启动应用程序。工作组信息文件丢失,或是已被其它用户以独占方式打开。]
我写的是这样 SELECT * into test_table FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="C:\Documents and Settings\Alimjan\桌面.xls";User ID=sa;Password=sql;Extended properties=Excel 8.0')...[table$]
BULK INSERT EBIDDB.dbo.EB_Admin_Good_New FROM 'd:\cpbuyaa20071018.txt' 這也是一種方式,但是權限要求比較大才行
EB_Admin_Good_New 是什么?
把execl读出到c#的自制table中 然后 根据table 建sql表放入
OpenDataSource里面写的是连接Excel的字符串,哪来的User ID=sa;Password=sql 还有文件是C:\Documents and Settings\Alimjan\桌面.xls么? Excel有名叫table的Sheet页么?
C#中可以直接用SQL语句,都是微软的,还是很方便的连SQL Server,执行SELECT * into table
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="***.xls";User ID=Admin;Password=;Extended properties=Excel 8.0')...[table$]SELECT * into table
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="***.xls";User ID=Admin;Password=;Extended properties=text')...[#table]表名是不是这么写的不太清楚了,楼主可以试试。你也可以连本地数据库,这么上传
SELECT * into aaa IN [ODBC]
[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;]
from aaa
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="***.xls";User ID=Admin;Password=;Extended properties=Excel 8.0')...[table$]
但出现了一下错误OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。验证失败。
[OLE/DB provider returned message: 无法启动应用程序。工作组信息文件丢失,或是已被其它用户以独占方式打开。]
SELECT * into test_table
FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="C:\Documents and Settings\Alimjan\桌面.xls";User ID=sa;Password=sql;Extended properties=Excel 8.0')...[table$]
还有文件是C:\Documents and Settings\Alimjan\桌面.xls么?
Excel有名叫table的Sheet页么?
自己调试通过的