Pergunta

I use VS2010, Entity Framework and a SQL Server Compact edition database. I use this connection string:

<add name="ConnNew" 
     connectionString="metadata=res://*/Code.Model1.csdl|res://*/Code.Model1.ssdl|res://*/Code.Model1.msl;provider=System.Data.SqlServerCe.3.5;provider connection string=&quot;Data Source=|DataDirectory|\MyDB.sdf&quot;" 
     providerName="System.Data.EntityClient" />

It's working in my system. but after setup application in other system, it's not working and get this error:

Unhandled exception has occurred in your application. if you click continue, the application will ignore this error and attempt to continue. if you click quit. the application will close immediately.

The specified store provider cannot be found in the configuration, or is not valid.

Details:
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

***** Exception Text *******
System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.

Foi útil?

Solução

Make sure your application references the System.Data.SqlServerCe.dll assembly and it is set to copy the assembly locally as well

Check the link on how to deploy the SQL Server CE 3.5 Database

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top