S
sam
Hi,
I try to connect to Excel 2003 xls using OLDBConnection object. And I
use this connection String:
Dim str As String
str = "OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Data1.xls;Extended Properties=""Excel 8.0;HDR=Yes;"""
cnn = New OleDbConnection(str)
cnn.Open()
da = New OleDbDataAdapter("Select * From Employee", cnn)
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
It give me no exception but my DataGridView is empty.
And after I stop debug, it give me this in output windows
The thread 0x1798 has exited with code 0 (0x0).
The thread 0x1610 has exited with code 0 (0x0).
'ExcelDB.vshost.exe' (Managed): Loaded 'C:\Users\Thit\Documents\Visual
Studio 2008\Projects\ExcelDB\ExcelDB\bin\Debug\ExcelDB.exe', Symbols loaded.
'ExcelDB.vshost.exe' (Managed): Loaded
'C:\Windows\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll',
Skipped loading symbols. Module is optimized and the debugger option
'Just My Code' is enabled.
A first chance exception of type 'System.ArgumentException' occurred in
System.Data.dll
The thread 0x13ac has exited with code 0 (0x0).
The thread 0x171c has exited with code 0 (0x0).
The program '[5520] ExcelDB.vshost.exe: Managed' has exited with code 0
(0x0).
I try to google and everywhere give me the same connection string.
Even I take out all statements after cnn.open()
I still get the sam message in my output window.
Please advice
TIA
Sam
I try to connect to Excel 2003 xls using OLDBConnection object. And I
use this connection String:
Dim str As String
str = "OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Data1.xls;Extended Properties=""Excel 8.0;HDR=Yes;"""
cnn = New OleDbConnection(str)
cnn.Open()
da = New OleDbDataAdapter("Select * From Employee", cnn)
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
It give me no exception but my DataGridView is empty.
And after I stop debug, it give me this in output windows
The thread 0x1798 has exited with code 0 (0x0).
The thread 0x1610 has exited with code 0 (0x0).
'ExcelDB.vshost.exe' (Managed): Loaded 'C:\Users\Thit\Documents\Visual
Studio 2008\Projects\ExcelDB\ExcelDB\bin\Debug\ExcelDB.exe', Symbols loaded.
'ExcelDB.vshost.exe' (Managed): Loaded
'C:\Windows\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll',
Skipped loading symbols. Module is optimized and the debugger option
'Just My Code' is enabled.
A first chance exception of type 'System.ArgumentException' occurred in
System.Data.dll
The thread 0x13ac has exited with code 0 (0x0).
The thread 0x171c has exited with code 0 (0x0).
The program '[5520] ExcelDB.vshost.exe: Managed' has exited with code 0
(0x0).
I try to google and everywhere give me the same connection string.
Even I take out all statements after cnn.open()
I still get the sam message in my output window.
Please advice
TIA
Sam