Hi, I need help with sections of my web config ; I am getting the following error "Failed to find or load the registered .Net Framework Data Provider. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider. " Stack Trace: [ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.] System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) +1401682 System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +88 WebMatrix.Data.DbProviderFactoryWrapper.CreateConnection(String connectionString) +64 WebMatrix.Data.<>c__DisplayClass15.<OpenConnectionStringInternal>b__14() +16 WebMatrix.Data.Database.get_Connection() +19 WebMatrix.Data.Database.EnsureConnectionOpen() +13 WebMatrix.Data.<QueryInternal>d__0.MoveNext() +72 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +327 System.Linq.Enumerable.ToList(IEnumerable`1 source) +58 WebMatrix.Data.Database.Query(String commandText, Object[] parameters) +98 ASP._Page_EventData_cshtml.Execute() +357 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +209 System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +68 System.Web.WebPages.WebPage.ExecutePageHierarchy() +123 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78 System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) +226 Here are a couple of sections from my web config file system.data> <DbProviderFactories> <remove invariant="System.Data.SqlServerCe.4.0" /> <add invariant="System.Data.SqlServerCe.4.0" name="Microsoft® SQL Server® Compact 4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=??????" /> </DbProviderFactories> .... </system.webServer> <connectionStrings> <add name="db_connection" connectionString="Data Source=tcp:s04.Winhost.com;Initial Catalog=DB_?????_File;User ID=DB_?????_user;Password='*******' ;Integrated Security=False;" /> </connectionStrings> </configuration> Can anyone help point out the error please
Resolved Just an update, I resolved the issue, had 6 more, but all now working, and website working with Database content. Thanks
What was the solution. We would like to know for others to also learn from. Base from the thread it sounds like you do not have the proper .Net framework picked for your site.
Solution Had the wrong provider information, corrected in web.config as below; <system.data> <DbProviderFactories> <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </DbProviderFactories> </system.data> <connectionStrings> <add connectionString="Uid=DB_NNNNN_eventlist_user;Server=s??.Winhost.com;Database=DB_NNNNN_eventlist;Pwd=********" name="db_MyDB" providerName="System.Data.SqlClient" /> </connectionStrings>