Working with Excel files

Hi, Im in part 2 of the Working with Excel files video and I’m having the following error:

So far my project is exactly the same as the video and also the demo project. What am I missing here? I can’t find any difference from the demo project but I get that error.



The new .net framework requires type to be same

Try like this

New Object(){Name,Age,Income}

That should solve the issue


1 Like

Great, that works. But I don’t understand why. What does New Object() do?



It basically tells that all the items in the array are of type object…else one is a string other is interger and other might be string again…and .net dows not create arrays with multiple datatypes…ao we are saying all the types as object …which can cater for different datatypes…so it wont be an issue

Hope this helps


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.