Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column
Reading data from Excel with customized column Reading data from Excel with customized column
Reading data from Excel with customized column
Go Back  Xtreme Visual Basic Talk > > > Reading data from Excel with customized column


Reply
 
Thread Tools Display Modes
  #1  
Old 09-29-2011, 11:39 PM
Radnuss Radnuss is offline
Newcomer
 
Join Date: Aug 2011
Posts: 21
Default Reading data from Excel with customized column


hi all.......
Im new to this .NET programmin...i just need to know some basic stuff abt readin data from excel..
I just use ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + p_fileUrl + ";Extended Properties='Excel 8.0;Mode=Read;IMEX=1;'") to read data..
in a particular column,first ten or below cells hav no values and the rest has values....
but it fails to read the cells with data..in fact it reads nothing...how to read data as it is in excel..
Pls help solvin this issue....
Reply With Quote
  #2  
Old 09-30-2011, 03:28 AM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Hi,
Reading data from Excel workbooks are not so straighful as using real databases. The probably explanation for the issue here is that at runtime each column's datatype is determined based on either the first 8 rows of data or the first 25 rows (it's a registry setting that controls it)

So if the first ten rows containt nothing then You may get the result You see now.

Best option is to never leave any cells empty but that may not always be possible.

Which Office version do You target?
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
  #3  
Old 10-02-2011, 11:57 PM
Radnuss Radnuss is offline
Newcomer
 
Join Date: Aug 2011
Posts: 21
Default

Im useing Office 2007.the excel data is not of my choice.there may or may not be values in the first ten or 25 rows and so the rest cells.whatever may be the cells i have to read as it is..Im converting excel to datatable..i need the cells as it is in excel...
Reply With Quote
  #4  
Old 10-04-2011, 02:43 PM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Hi,

There is a setting in Excel that contols if Excel should put 0 in empty cells. Obviously there exist risks with this approach.

But again, Excel is not a database program although too many people believe it is. You need to go back to the source for these files and discuss it with them what to do.
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
  #5  
Old 10-06-2011, 11:54 PM
Radnuss Radnuss is offline
Newcomer
 
Join Date: Aug 2011
Posts: 21
Default

but We cant discuss the file creators and put zero in empty fields...however the excel sheet,we hav t read as it is....
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column Reading data from Excel with customized column
Reading data from Excel with customized column
Reading data from Excel with customized column
 
Reading data from Excel with customized column
Reading data from Excel with customized column
 
-->