一个关于异常的问题.
我的程序如下:
Dim DS As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim MyConnection As System.Data.OleDb.OleDbConnection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\myData.XLS; " & _
"Extended Properties=Excel 8.0;")
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [Sheet1$]", MyConnection)
DS = New System.Data.DataSet
'Try
MyCommand.Fill(DS)
'Catch ex As Exception
'Finally
MyConnection.Close()
'End Try
但是运行时弹出对话框"未处理的“System.Data.OleDb.OleDbException”类型的异常出现在 system.data.dll 中"
为什么?