can't fetch value in excel table if first 25 rows are empty

A

André

Hi,

I don't now whether this is a problem with excel, with oledb provider or
asp.net, so i send it to those groups.

I created a table in excel with, to simplify, two fields and 30 records.
Now i fetch the values from that table with classic commands like:

Dim oConnection As OleDbConnection
Dim sConnection As String
oConnection = New OleDbConnection()
Dim comd As OleDbCommand
Dim dtreader As OleDbDataReader

SqlDataSource1.DataBind()
sConnection = SqlDataSource1.ConnectionString
oConnection.Open()
sql = "select * from data;"
comd = New OleDbCommand(sql, oConnection)
dtreader = comd.ExecuteReader
etc ...

My problem is this: suppose field1 is filled in each row, but field2 only
the last record. If the value of that last record is alfanumeric (e.g. a)
then no problem, dtreader can fetch it, but if it's numeric (e.g. 1),
dtreader doesn't fetch it (no value). When checking it with response.write,
i see the 'a' but no the 1.
The threshold is, according to trial and error, 25 rows. If the first 25
rows or more are empty, the numeric value in row 30 is 'lost', but not with
'a'.

Any acceptable reason for this?
Thanks
André
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top