TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Richard Smith
NA
3
9k
How do I fix :Cannot convert null to double?
Feb 11 2020 12:46 PM
hello,
Do I am reading an Excel spredsheet and puting the data into arrays like so:
string col1[] = new string[rowCount]; //This is fine
double col2[] = new double[rowCount];
for(int i -= 1, i <= rowCount - 1 ; i++)
{
col1[i] = myWorkBook.Cells[i + 1, 1].Value;
col2[i] = myWorkBook.Cells[i + 1, 2].Value; //Throws Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Cannot convert null to 'double' because it is a non-nullable value type
I tried doing my array as Nullable but that an 8.0 feature and still in 7.3 and cannot upgrade is there a fix to this?
Thanks
Reply
Answers (
2
)
How to use List with c# 8 Range?
Vectors and matrix in #