System. InvalidCastException: Unable to cast object of type SqlDataProvider to type DataProvider

Source: Internet
Author: User
Tags dotnetnuke
Error: Edit Content is currently unavailable.
DotNetNuke. Services. Exceptions. ModuleLoadException:
The type initializer
'M2land. Modules. FlashImageRotator. DataProvider 'threw an exception.
---> System. TypeInitializationException: The type initializer
'M2land. Modules. FlashImageRotator. DataProvider 'threw an exception.
---> System. InvalidCastException: Unable to cast object of type
'M2land. Modules. FlashImageRotator. sqldataprovider' to type
'M2land. Modules. FlashImageRotator. dataprovider'.
M2Land. Modules. FlashImageRotator. DataProvider. CreateProvider () in
E: "Development" DotNetNuke "InstallArea" DotNetNuke_04.08.03_Source "Website" DesktopModules "M2Land. FlashImageRotator" Provider "DataProvider" SqlDataProvider "DataProvider. cs line
55 at M2Land. Modules. FlashImageRotator. DataProvider .. cctor () in
E: "Development" DotNetNuke "InstallArea" DotNetNuke_04.08.03_Source "Website" DesktopModules "M2Land. FlashImageRotator" Provider "DataProvider" SqlDataProvider "DataProvider. cs line
49 --- End of inner exception stack trace ---
M2Land. Modules. FlashImageRotator. DataProvider. Instance ()
M2Land. Modules. FlashImageRotator. FlashImageRotatorController. GetFlashImageRotator (Int32
ModuleId) in
E: "Development" DotNetNuke "InstallArea" using "Website" using topmodules "M2Land. FlashImageRotator" Provider "DataProvider" SqlDataProvider "FlashImageShowController. cs: line
111
M2Land. Modules. FlashImageRotator. EditFlashImageRotator. Page_Load (Object
Sender, EventArgs e) in
E: "Development" DotNetNuke "InstallArea" DotNetNuke_04.08.03_Source "Website" shorttopmodules "M2Land. FlashImageRotator" EditFlashImageRotator. ascx. cs: line
68 --- End of inner exception stack trace ---

The reason is that this project was migrated from StartKit. In App_Code, there are DataProvider and SqlDataProvider files with the same name, so the type obtained during reflection does not match.

Delete the DataProvider and SqlDataProvider files in App_Code to solve the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.