我有一個實體4.0模型使用SqlServerCE數據庫作爲其提供者。在服務器上,我想使用相同的項目,只是將連接字符串切換爲使用實際的SqlServer數據庫。實體框架使用模型爲不同的提供者
這裏是我的連接字符串
<add name="Entities"
connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;
provider=System.Data.SqlClient;
provider connection string="
Data Source=xxxx;
Initial Catalog=xxxx;User ID=xxxx;Password=xxxx;""
providerName="System.Data.EntityClient" />
當我嘗試查詢實體模型,我得到以下錯誤:
SqlCeCommand.CommandTimeout does not support non-zero values.
如果我設置了上下文的超時時間爲0,然後說
Unable to cast object of type 'System.Data.SqlClient.SqlConnection'
to type 'System.Data.SqlServerCe.SqlCeConnection'.
如何將提供程序從SqlServerCE設置爲SqlClient?
採取了一些做,但我得到它的工作。仍然無法將其作爲資源加載。如果你從sqlserverCE到sqlserver,你必須添加Schema屬性。 – Kenoyer130 2010-10-17 23:49:35