我正在使用實體框架代碼第一個4.3 + Azure並且難以連接到數據庫。我得到的錯誤是以下(第一查詢):實體框架代碼第一個Azure連接
Keyword not supported: 'server'.
,我有以下連接在我的web.config成立
<configSections>
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<connectionStrings>
<add name="TestDBContext"
connectionString="Server=tcp:[SUBSCR].database.windows.net,1433;Database=[MyDB];User ID=[user];Password=[pass];Trusted_Connection=False;Encrypt=True;PersistSecurityInfo=True"
providerName="System.Data.EntityClient" />
</connectionStrings>
我的DbContext實現類使用連接字符串的名字:
public class MyContext : DbContext, IMyContext
{
public MyContext()
: base("TestDBContext")
{
Configuration.LazyLoadingEnabled = true;
Configuration.ProxyCreationEnabled = true;
}
你能告訴發生了什麼事嗎?
嘗試過它,它不起作用... 1433是SQL Server的默認端口,我複製粘貼來自Azure訂閱/數據庫的連接字符串。 – 2012-02-11 13:44:12