PC Review


Reply
Thread Tools Rate Thread

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

 
 
André
Guest
Posts: n/a
 
      3rd Dec 2006
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é


 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      3rd Dec 2006
See the following. Look for information on IMEX

http://support.microsoft.com/default...b;en-us;257819
How To Use ADO with Excel Data from Visual Basic or VBA


http://www.dicks-blog.com/archives/2...ed-data-types/

--
Regards,
Tom Ogilvy


"André" <hjhhb@dd> wrote in message
news:OZ%(E-Mail Removed)...
> 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é
>



 
Reply With Quote
 
André
Guest
Posts: n/a
 
      3rd Dec 2006
Thanks

"Tom Ogilvy" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> See the following. Look for information on IMEX
>
> http://support.microsoft.com/default...b;en-us;257819
> How To Use ADO with Excel Data from Visual Basic or VBA
>
>
> http://www.dicks-blog.com/archives/2...ed-data-types/
>
> --
> Regards,
> Tom Ogilvy
>
>
> "André" <hjhhb@dd> wrote in message
> news:OZ%(E-Mail Removed)...
>> 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é
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Excel VBA Pivot table link cell fetch records asxastro Microsoft Excel Programming 1 10th Mar 2010 05:47 AM
Excel 2007 VBA Pivot table fetch records asxastro Microsoft Excel Programming 0 9th Dec 2009 07:26 AM
Hide empty rows in pivot table Excel 2003 menda Microsoft Excel Misc 2 20th Feb 2008 12:16 PM
How to Delete empty rows in excel in b/w rows with values =?Utf-8?B?RGVubmlz?= Microsoft Excel Worksheet Functions 3 28th Aug 2007 04:15 PM
can't fetch value in excel table if first 25 rows are empty André Microsoft ADO .NET 2 3rd Dec 2006 08:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:27 AM.