readin excel data into a dataset
-
Looking in the help index I find usefull code to read excel data into a dataset. Only I have one question about this subject and I hope someone has had this problem as well... Connecting and receiving data is done really quick using the code below. It's only that excel data can only be interpreted if values are doubles. Any other format can't be recognized and will give value DBNull... Does anybody know how to solve this problem? Thnx, .Netplayer ============================================================ 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() MyCommand.Fill(DS) MyConnection.Close() =================================================================