I don't know who else to ask for help.
Here in my company we are migrating the system. 2.0 to 3.5 net
We use enterprise library 3.1 and we are migrating to 5.0
I used the tool for configuration file
The compilation was ok but when I run, i receive this message:
Activation error occured while trying to get instance of type Database, key "MrvFramework"
Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "MrvFramework".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.
At the time of the exception, the container was:
Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database
I spent a lot of time on internet:
I had made this tests:
All DLL required by enterprise library are referenced in the project
var database = DatabaseFactory.CreateDatabase(MrvFramework)
var database = EnterpriseLibraryContainer.Current.GetInstance<Database>(MrvFramework)
var database = new SqlDatabase(MrvFramework)
This is my app.config (snippet-code)
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<dataConfiguration defaultDatabase="MRVFramework"/>
<connectionStrings>
<add name="MRVFramework" connectionString="Data Source=H:\MRV\Projetos\MRV Framework\Branch\Update SqlServerCe\MRV.Framework.Seguranca.Console\MRVFramework.sdf;Persist Security Info=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
This is my machine.config file
<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<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" />
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
Add this Code to your web.config
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<qualifyAssembly partialName="Microsoft.Practices.EnterpriseLibrary.Data" fullName="Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblyBinding>
</runtime>
I was getting same exception while executing the below code;
Database db = DatabaseFactory.CreateDatabase();
Resolved exception once i updated the code to
Database db = DatabaseFactory.CreateDatabase("Connection String"); // config file string
Related
So I've been struggling to try and get this resolved for a week or so now. When I attempt to run my application on another computer other than my development machine, I get the following error:
Schema specified is not valid. Errors:
EntityFramework.RemManagerDBModel.ssdl(2,79): error 0175:
The ADO.Net provider with invariant name 'System.Data.SQLite.EF6' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.
I attempted to retrieve the inner exception using this method, but to no avail. I'm not sure why it seems to think there is an inner exception, when in fact there isn't?
With regard to attempting to fix the issue myself, I have tried (I believe) all of the relevant possible solutions that are found under this SO question.
Currently my app.config looks something along the lines of what is shown below. An example of the connection string that is created is also included. The application uses Entity Framework 6 from a database first configuration. The entity model and diagram have been newly generated from the database file. I am able to open the entity diagram with no problems and regenerating it via the "run custom tool" option hasn't made any difference. The issue only seems to be present if I try to run the installed application on another computer. In this case, the computer is a totally clean (factory restored) version of Windows 10.
If any more information is required, I can add it in as necessary.
App.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="RemManager.Forms.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<!-- See Datasource.ConnectionController for the connection string builder.-->
</connectionStrings>
<entityFramework>
<providers>
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.106.0, Culture=neutral" />
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.106.0, Culture=neutral" />
</providers>
</entityFramework>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider"
invariant="System.Data.SQLite"
description="Data Provider for SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
<add name="SQLite Data Provider (Entity Framework 6)"
invariant="System.Data.SQLite.EF6"
description=".NET Framework Data Provider for SQLite (Entity Framework 6)"
type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
</DbProviderFactories>
</system.data>
</configuration>
Example Connection String:
metadata=res://*/EntityFramework.RemManagerDBModel.csdl|res://*/EntityFramework.RemManagerDBModel.ssdl|res://*/EntityFramework.RemManagerDBModel.msl;provider=System.Data.SQLite.EF6;provider connection string="data source=C:\Users\MacbookPro\AppData\Roaming\RemManager\Datasource\RemManagerDB.db;default timeout=5000;failifmissing=True;read only=False;version=3"
I found the fix here: SQL DDEX for EF6 as I had installed VS into a new laptop.
steps:
Install latest SQLCEToolbox (this is a .vsix add-on to be able to open SQLite DB within VS IDE). Follow the installer prompts, it may need to stop tasks you need to click "End Task" to continue the install
Install SQLite in GAC (note: x86 not x64)
Once per machine. Download the latest sqlite-netFx46-setup-bundle-x86-2015-1.0.xxx.0.exe (from https://system.data.sqlite.org/index.html/doc/trunk/www/downloads-unsup.wiki)
Select all checkbox: "Full Installation", Install the assemblies into the global assembly cache and Install VS designer components
Restart VS
to check:
in VS main menu: Tools, there is a new entry SQLite/SQLServer compact toolbox. Click on that and it will open a new tab where Solution Explorer is located near it. Click the About (question mark icon) and check both GAC and DDEX provider are "Yes"
I am use Database MySQL in ASP.NET c# application.When I use simple Steps for connect the MySQL database and create ADO.NET connections working fine. But I want to use Microsoft Enterprise Library for my application.I added Reference given below
Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.EnterpriseLibrary.Data
Microsoft.Practices.EnterpriseLibrary.Data.S
MySql.Data
MySql.Web
Below is my web.comfig code
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.4.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<dataConfiguration defaultDatabase="db1"></dataConfiguration>
<connectionStrings>
<add name="constr" connectionString="Server=localhost;Database=db1;user id=test;persistsecurityinfo=True;" providerName="MySql.Data.MySqlClient;"/>
</connectionStrings>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
</configSections>
and when I use in code by below code
if (_connectionMode == DatabaseConnectionMode.UseConnectionStringName)
{
_Database = new DatabaseProviderFactory().Create(_dbConnectionString) as Database;
}
here throw the below error
The requested database db1does not have a valid ADO.NET provider name set in the connection string.
Give me proper solution with reason why this happening.
Your connection string name needs to match the default database:
<dataConfiguration defaultDatabase="db1"></dataConfiguration>
<connectionStrings>
<add name="db1" connectionString="Server=localhost;Database=db1;user id=test;persistsecurityinfo=True;" providerName="MySql.Data.MySqlClient;"/>
</connectionStrings>
I'm using for my application Entity Framework and System.Data.SQLite using WPF and C# on .NET 4.5
On my machine al work well, but on a test machine a received this error when I access to the sqlite db via EntityFramework:
The 'DbProviderFactories' section can only appear once per config
file.
I found that the error was that in the test machine, in the machine.config:
<system.data>
<DbProviderFactories>
<add name="IBM DB2 for i5/OS .NET Provider" invariant="IBM.Data.DB2.iSeries" description=".NET Framework Data Provider for i5/OS" type="IBM.Data.DB2.iSeries.iDB2Factory, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26"/>
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add name="IBM DB2 for i .NET Provider" invariant="IBM.Data.DB2.iSeries" description=".NET Framework Data Provider for IBM i" type="IBM.Data.DB2.iSeries.iDB2Factory, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26" />
</DbProviderFactories>
<!-- This is the line to remove - empty element -->
<DbProviderFactories/>
</system.data>
I remove the last empty element and now all work.
I think it's something related the IBM.Data.DB2.iSeries installation (IBM Client Access).
My question is:
How to remove the empty element without manually edit machine.config? I have tried to insert the tag <clear /> in the app.config file but not work.
I found another question similar to mine but not one suggest how to solve the problem without edit manually the machine.config to solve the problem.
this is my app.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<system.xml.serialization>
<xmlSerializer useLegacySerializerGeneration="true" />
</system.xml.serialization>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<!--STAI MOLTO ATTENTO-->
<legacyUnhandledExceptionPolicy enabled="1"/>
</startup>
<connectionStrings>
<add name="db" connectionString="Data Source=clients.db;Version=3;New=False;Compress=True;" />
<add name="icmdbEntities" connectionString="metadata=res://*/MainModel.csdl|res://*/MainModel.ssdl|res://*/MainModel.msl;provider=System.Data.SQLite;provider connection string="data source=.\icmdb.db"" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<system.data>
<DbProviderFactories>
<clear />
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
<appSettings>
<add key="ditta" value="default" />
<add key="demo" value="true"/>
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
I experienced this problem today.
The machine.config files are located in:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
The corrupted version of machine.config contains:
<system.data>
<DbProviderFactories>
<add name="IBM DB2 for i .NET Provider" invariant="IBM.Data.DB2.iSeries" description=".NET Framework Data Provider for IBM i" type="IBM.Data.DB2.iSeries.iDB2Factory, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26" />
</DbProviderFactories>
<DbProviderFactories/>
</system.data>
Installing the iSeries drivers corrupted the following machine.config files:
| Framework | Platform | Factory Added? | Corrupted Machine.config? |
|-----------|----------|----------------|---------------------------|
|v4.0.30319 | x64 | Yes | Yes |
|v4.0.30319 | x86 | Yes | Yes |
|v2.0.50727 | x86 | No | No |
|v2.0.50727 | x64 | No | No |
It's nice that you only have to worry about IBM corrupting half your machine.config files; and of those only applications that use .NET 4.
Files to fix
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config (ok)
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config (ok)
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config (corrupt)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config (corrupt)
From an elevated Notepad, open the two files, and remove the extraneous empty <DbProviderFactories/> element, leaving you with:
<system.data>
<DbProviderFactories>
<add name="IBM DB2 for i .NET Provider" invariant="IBM.Data.DB2.iSeries" description=".NET Framework Data Provider for IBM i" type="IBM.Data.DB2.iSeries.iDB2Factory, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26" />
</DbProviderFactories>
</system.data>
And you're fixed.
The problem is caused by installing IBM iAccess for Windows -- specifically the .NET Provider for DB2 component. I've seen it firsthand in V7R1, but others have referenced the same issue with V6R1.
IBM is aware of the problem and has a fix in one of the service releases.
From the V7R1 service release documentation:
DESCRIPTION OF PROBLEM FIXED FOR APAR SE45767 :
Under unknown circumstances, corruption to the machine.config XML file is occurring when the .Net data provider is installed (either as part of a Complete or Custom install type). The corruption is isolated to portions of the XML data related to the DbProviderFactories - and generally has been observed to include duplication of some lines of the XML data.
CORRECTION FOR APAR SE45767 :
A preventive fix will be provided which will eliminate the likely cause of the machine.config corruption.
A corrective fix to update already corrupted machine.config files will not be provided. Utilize the documented local fix or circumvention if possible.
CIRCUMVENTION FOR APAR SE45767 :
If the .Net data provider is not needed, this problem may be avoided by performing a custom install and ensuring the .Net Data provider will not be installed. If the .Net provider is required, no circumvention is known. Utilize the local fix to resolve the issue.
As for fixing the problem once it has occurred, you need to fix machine.config (both 32-bit and 64-bit), because it does not conform to the schema defined for system.data. That's easy -- just write a simple .NET app that uses XmlDocument to load machine.config, locate the duplicate DbProviderFactories element, delete it and save the file. Or use a PowerShell script or anything else that can manipulate XML documents.
Here's an IBM APAR discussing this issue in V6R1.
I'm new on this. I got a sample project that runs perfectly on another pc but get an error when running on my own pc. I changed the connection string and restored the database only. I am using a SQLServer connection, but when I run the project it shows a MySQLRoleProvider error. I searched web.config for this configuration but it isn't there. How can I solve this issue?
The message:
`Parser Error Message: Could not load file or assembly 'MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=+++' or one of its dependencies.
<add name="MySQLRoleProvider"
type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=***"
connectionStringName="LocalMySqlServer"
applicationName="/"/>`
You need to install the MySQL Connector binaries first for this to work.
http://dev.mysql.com/downloads/connector/net/
If after installation you still face problems, verify that the dll's are declared in machine.config file of the framework version that you're running.
Add following to config file...
<configuration>
<!--Other omited-->
<system.data>
<DbProviderFactories>
<clear />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=6.6.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<!--Other omited-->
</configuration>
I am currently developing a project in MVC3 Visual Studio 2012. I am connecting to an external database but when I try to add a new controller I get this error.
Unable to retrieve metadata for 'Project.Models.Class'. Unable to find the requested .Net Framework Data Provider. It may not be installed.
I cannot figure out why it can't find my .Net Framework Data provider. I have altered the two machine.config files I can find, and they now look like this.:
<system.data>
<DbProviderFactories>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.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=89845dcd8080cc91"/>
<add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<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>
<system.data>
<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<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"/>
<add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.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=89845dcd8080cc91"/></DbProviderFactories>
</system.data>
My connection string looks like this:
<connectionStrings>
<add name="NottherealnameTest" providerName=".NET Framework Data Provider for SQL Server" connectionString="Data Source=*****************;Initial Catalog=************;Persist Security Info=True;User ID=*************;Password=*****************" />
</connectionStrings>
</configuration>
I have of course censored some information for security purposes but that is the basic layout.
Can anyone see an error I cant? or has any idea why this may be happening? Any help would be greatly appreciated.