I have got this exception after I fixed this error, please check this post and read the following…!
Error Message:
“An invalid VARIANT was detected during a conversion from an unmanaged VARIANT to a managed object. Passing invalid VARIANTs to the CLR can cause unexpected exceptions, corruption or data loss.”
Fix:
Just go to the Debug menu in Visual studio and select Exceptions
Click and expand the Manage Debugging Assistants
Find the Invalid Variant node and uncheck the Thrown check box.
Click Ok and run the application, That’s all! Happy Programming..! If you want to read more about this issue, just read this post! :)
References:
http://www.dotnetspider.com/forum/299944-System.outofmemoryexception.aspx
http://blogs.msdn.com/b/yangxind/archive/2006/03/21/556837.aspx