ASP.NET using Excel as a datasource

I'm working on an application that uses an Excel spreadsheet to temporarily populate a gridView.  Everything works fine except one single column that displays an ID.  The format for this ID is P12345, with every entry having a 'P' at the beginning of it.  For whatever reason, this field won't show up in the gridView.  If I go into the data and delete the P, shows up fine, otherwise it won't.  Anyone else run into this?  
stretch73Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ken ButtersCommented:
With the removal of the 'P' the value could be interpreted as in numeric.   Does the error only happen with 'P' or will any non-numeric cause the same problem?
0
stretch73Author Commented:
It only happens with the P.  If I take the P off, the remaining number is displayed.
0
Ken ButtersCommented:
No ... what I mean is.... do you have the same result with an "A" or a "B" or a "C" as you do a "P".  My thought being is that somewhere along the line in your code, you are assigning the value to a numeric variable.  Something along those lines could cause the variable assignment to fail, resulting in no display of the ID.  

Extending my first question.... if you put ANY letter in ANY position of the ID field... does it still show up as blank?

Do you have code anywhere that defines the ID field as numeric? or integer? or long? etc....
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

MattiCommented:
Hi!

Link the  Excel table into an Access MDB and access that form ASP.
Excel will have some format problems, so maybe you need a sub for filter it before display, In my knowledge linking data to mdb will remove this problem.

Matti
0
stretch73Author Commented:
Okay, I've made a little progress.  It looks like, for whatever reason, the field is being read in as a a DBNULL.  I started to do a manual import into SQL Server, just to see what the mappings would say, and the default type on the field when I'm pulling it in is set to float.  It's like it wants it to be a number but since it has an alpha character it doesn't know what to do with it once it gets there.
0
stretch73Author Commented:
Thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.