C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






View Message



Sender Super

Recipient(s) Jaya Kumar

Date 10 Sep 2009


Re: Re: Re: Re: Re your article on uploading Excel

Hi Jaya,
I've still had problems so did some research on this and came up with this article:
http://blog.lab49.com/archives/196

It seems that
"ADO.NET scans the first 8 rows of data, and based on that guesses the datatype for each column. Then it attempts to coerce all data from that column to that datatype, returning NULL whenever the coercion fails!"

You wouldnt know how to get round this problem or force each cell in the spreadsheet to be read as text or converted to text





>>> On 10 Sep 2009, Jaya Kumar wrote:

No it will work, it will take the values from the excel sheet and insert into datatable



>>> On 10 Sep 2009, Super wrote:

Thanks very much Jaya - that works.
One other question - the import only seems to pick up numbers on the spreadsheet not text.
Do you know why ?



>>> On 10 Sep 2009, Jaya Kumar wrote:

Hi "'Import$" is the name of the Worksheet, may be in your worksheet the name may be changed. so please check the name of the worksheet which contains the data



>>> On 10 Sep 2009, Super wrote:

Hi Jaya,
I have been trying to get this article you wrote to work but get the error message at the following breakpoint

OleDbDataReader dr = cmd.ExecuteReader();

"Could not find the object 'Import$' Make sure the object exists.

I cant seem to figure out what I am doing wrong
Any suggestions would be much appreciated.

What tables am I meant to have set up before hand in the database

Thanks
Sean





(http://www.dotnetspider.com/resources/15076-Import-Excel-Sheet-Data-To-Data-Grid-View.aspx)






dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use