Fields with mixed string/number data
- From: Peter A <paitken@xxxxxxxxxxxxxx>
- Date: Thu, 25 Jan 2007 08:41:03 -0500
I am using ADO.Net to extract data from a table in an Excel workbook.
Some of the columns are a combination of text and number data - the text
"n.a." when there is no measurement for that point and a number when
there is a measurement. When ADO gets the data the numbers are ignored,
treated as blanks. It's those numbers I need!
Here's the code.
cn = New System.Data.OleDb.OleDbConnection _
("provider=Microsoft.Jet.OLEDB.4.0;" & _
"data source=" & WorkbookFileName & _
";Extended Properties=Excel 8.0;")
Dim cmd As OleDbCommand = New OleDbCommand _
("select * from [WorksheetName$] where IsDate(Time) _
order by Time", cn)
cn.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader
Thanks in advance,
--
Peter Aitken
.
- Follow-Ups:
- Re: Fields with mixed string/number data
- From: Bob Barrows [MVP]
- Re: Fields with mixed string/number data
- Prev by Date: attn: gregorio - truly inviting fast downloads - fom - (1/1)
- Next by Date: Re: Fields with mixed string/number data
- Previous by thread: attn: gregorio - truly inviting fast downloads - fom - (1/1)
- Next by thread: Re: Fields with mixed string/number data
- Index(es):
Loading